61
Automation Interface, Add-Ins and Tools / Change the default name of a new element in dialog
« on: March 28, 2011, 01:15:33 pm »
Hi,
I'm using the EA_OnPreNewElement() event to:
1. Capture the name of the new element the user wants to add
2. See if the same element already exists in the repository
3. Warn the user if it already exists, and whether the user really wants to create a "duplicate".
The logic works fine, however if the user wants to duplicate the element, I want to be able to default the name of the element in the new element dialog (the first modal window EA pops up where you set the name, stereotype, notes etc...) to the one the user searched.
The dialog appears between the Pre and Post events. I can't see any way of returning a "modified" element on the Pre event for EA to use (IMHO - I would have EA pass in an empty element in the Pre event that you could modify and return for it to use in the rest of the processing).
any ideas? (apart from a hack to grab the active window and send it the text to display)?
Thanks,
David.
I'm using the EA_OnPreNewElement() event to:
1. Capture the name of the new element the user wants to add
2. See if the same element already exists in the repository
3. Warn the user if it already exists, and whether the user really wants to create a "duplicate".
The logic works fine, however if the user wants to duplicate the element, I want to be able to default the name of the element in the new element dialog (the first modal window EA pops up where you set the name, stereotype, notes etc...) to the one the user searched.
The dialog appears between the Pre and Post events. I can't see any way of returning a "modified" element on the Pre event for EA to use (IMHO - I would have EA pass in an empty element in the Pre event that you could modify and return for it to use in the rest of the processing).
any ideas? (apart from a hack to grab the active window and send it the text to display)?
Thanks,
David.