Skip to content

CreationCommand

Philippe DUL edited this page Jan 24, 2020 · 1 revision

Creation of elements contribution

It is possible to extends default creation of objects (to create another elements while creating one, to rename a newly created element or other.)

  • Creation tools: covered by this extension point -- 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) are not covered by this extension point -- Copy paste of an element -- Transitions, Patterns, REC/RPL -- other transformation mechanism

The extension point is provided by:

  • the plug-in org.polarsys.capella.common.menu.dynamic
  • and its identifier MDEMenuItemContribution.

The contribution to the extension point is done in the plugin.xml file of the plugin. Open this file and focus on the plugin.xml tab:

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<extension point="org.polarsys.capella.common.menu.dynamic.MDEMenuItemContribution">
  <MDEMenuItemContribution
            class=""
            id="">
  </MDEMenuItemContribution>
</extension>

Detail of the different fields

Sample

When creating a State Machine, we create an inner Region

  • The Java class defining the contribution

  • Its registration within plugin.xml

  • In MANIFEST/MANIFEST.MF file we need to depend on org.polarsys.capella.core.menu.dynamic which export org.polarsys.capella.common.menu.dynamic

Clone this wiki locally