Call a method at component exchange creation (using palette)

Hi,
I’m trying to call a custom method at creation of component exchanges on a diagram using the palette.
To do so I plan to create a listener and to call the method I wrote at creation of component exchanges.
In which plugin can I find methods implementing objects creation?
Thanks
Grégoire

Hi,
It is possible to contribute to creation of elements:
https://wiki.polarsys.org/Capella/Tutorials/Extensibility/Ex tendCreationCommand
The given sample will create an additional element inside each newly created Component Exchanges.
This extension point will contribute to
all creations (in project explorer, in diagram palette tool or maybe in other programmatic calls, such as modeling accelerators)
Best regards,
Philippe

So there is no way to distinguish between (add element / palette tools) and programmatic calls?
In that case, it seems to be it is a bad idea to insert a dialog in the generic “constructor” of a model element.

Hi,
I think this extension point
may cover the needs of Gregoire.
@SBO, No. There is no way to distinguish programmatic creation and graphical creation right now.
BUT, programmatic calls are not always considered as a ‘creation tool’:

  • Creation tools:
    – Diagram Palette
    – Add Element in project explorer
    – Programatic calls such as modeling accelerators (i think of ‘generation of component exchanges’)
  • Other programmatic calls: (calling only the generic “constructor” of a model element)
    – Copy paste of an element
    – Transitions, Patterns, REC/RPL
    – other transformation mechanism
    This extension point is used in
    all creations tools, not on section called ‘Other programmatic calls’
    If you use a listener, such as a ResourceSetListener, it will cover all.
    Best regards,
    Philippe
Copyright © Eclipse Capella, the Eclipse Capella logo, Eclipse and the Eclipse logo are Trademarks of The Eclipse Foundation.