The Papyrus User shall use this functionality from the model explorer in order to create elements in the model. It can decide to display or not this element creation
A user can create an element by select element in the model explorer, click on it ant then click on the diagram. In order to not display a menu, a user can edit the model that represents the creation menu and set the attribute visibility to false.
An advanced User is able to create of modify creation menu. This menu is a model that can be edited
An advanced user can contribuate to the menu by adding a new plugin that contains: -a xmi file that represents a creation menu. The model must be an instance of org.eclipse.papyrus.infra.newchild/resource/elementCreationMenuModel.ecore. It contains • CreationMenu o It corresponds to a menu o The ElemenTypeIDRef corresponds a reference to the element Type. o The role can be filled in order to specify the role play by the element. o If displayAllRole is set to true, it displays all roles played by the element if the number of roles is greater than 1. By default this property is true; • Folder o It is possible to add owns label and icon. o Visibilty to specify if the folder is visible. -a reference to an extension point, to specify that papyrus must take in account this file to display the menu <code> <extension point="org.eclipse.papyrus.infra.newchild"> <menuCreationModel model="YourCreationMenu.xmi"> </menuCreationModel> </extension> </code>
In the following example, a menu creation for a package is presented. This menu is contained in the folder SimpleUMLTest. We have associated an image for this menu.
In this following example, a creation menu will be specified to allow creation of nested classifier. That 's why the role "nestedClassifier" is precised. The label for this creation is "nestedClass"
In the followin examplen a creation menu is created for activities. In this case, all roles are displayed. Thanks to this, when we want to associate an activity to a state, 3 roles are proposed.
From a stereotyped profile, a model of new child menu can be generated. For example a user after designing a profile, want to have a dedicated menu from this profile/ For the moment this function is not implemented.
The User can modify the creation menu by adding submenus: order about new child menu, precise if the role must be displayed.
test
A user can edit a the model that represent the creation menu at runtime for papyrus thanks to a dedicated UI.
An advance user shall have the possibility to deploy or undeploy creationMenuChild Model programmatically. This can be done using org.eclipse.papyrus.infra.newchild.CreationMenuRegistry.loadCreationMenuModel(URI uri).
An advance user shall have the possibility to deploy or undeploy creationMenuChild Model from workspace. This can be done with the contextuelle menu at the right click.
The system is done by two plugins: • org.eclipse.papyrus.infra.newchild It has in charge to provide and construct swt.Menu from the ecore model. To do that the developer has to: o instantiate a CreationMenuFactory, o ask to get all Root model and populate it <code> CreationMenuFactory creationMenuFactory= new CreationMenuFactory(editingDomain); ArrayList<Folder> folders= creationMenuRegistry.getRootFolder(); Iterator<Folder> iterFolder= folders.iterator(); while (iterFolder.hasNext()) { Folder currentFolder= iterFolder.next(); creationMenuFactory.populateMenu(menu, currentFolder,eObject); } </code> • org.eclipse.papyrus.views.modelexplorer.newchild It has in charge to add menu in the model explorer of papyrus.
This the structure of EMF model for model • CreationMenu o It correspond to a menu o The ElemenTypeIDRef correspond a reference to the element Type. o The role can be filled in order to specify the role play by the element. o If displayAllRole is set to true, it displays all roles played by the element if the number of roles is greater than 1. By default this property is true; • Folder o It is possible to add owns label an icon.
Here an example of xml of creation menu.
org.eclipse.papyrus.infra.newchild.tests.NewChildExtensionPointTests.NewChildExtensionPointTest() test if a creationMenuModel is well deployed using extension point.
Test done in org.eclipse.papyrus.infra.newchild.tests.DeployUndeployTests.DeployUndeployTest()
Test done in org.eclipse.papyrus.infra.newchild.tests.DeployUndeployTests.DeployUndeployTest()
TODO with rcptt when available for Papyrus.
TODO with rcptt when available for Papyrus.

New Child Menu into the model explorer

The purpose of this plugin is to offer the model and means to create new menu in the model explorer. More documentation (models and file.doc) has been store in the docs directory. The plugin in charge to do the connection with the model explorer is org.eclipse.papyrus.view.modelexplorer.newchild

OSGi System Bundle

The purpose of this plugin is to do the connection with the model explorer is org.eclipse.papyrus.view.modelexplorer.newchild. More documentation (models and file.doc) has been store in the docs directory of the plugin org.eclipse.papyrus.infra.newchild