Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 2637545291bb5e971b73ad697e5c970ff1250f03 (plain) (blame)
1
<html><link rel="stylesheet" href="default.css" type="text/css"><H1>New Child Menu into the model explorer</H1><H2>Requirements</H2><pre>- AddNewChild (id=newChild001): <BR/> Papyrus shall add in the menu new child for new customized elements by using extended type</pre><pre>- HideElement (id=newChild002): <BR/> Papyrus shall not display all UML or SysML element creation</pre><pre>- newChildFromProfile (id=newChild003): <BR/> Papyrus shall add the creation of new element from a subset of profile</pre><pre>- newChildMenuDisplay (id=newChild004): <BR/> Papyrus shall be able to associated icons to folder or creation menu</pre><pre>- RoleAndElementCreation (id=newChild005): <BR/> When an element can created from several  roles for a container, Papyrus shall let the possibility to choose the role or to let to the possibility to be created from all role.</pre><H2>Use Cases</H2><P align="middle"><img src=C:/git/org.eclipse.papyrus/plugins/infra/org.eclipse.papyrus.infra.newchild/doc/imgDOC/UseCaseDiagram.png alt=UseCaseDiagram ></P><P align="middle">UseCaseDiagram</P></BR><H3>UseCreateMenu</H3><pre>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</pre><H4>How to</H4><pre>A user can create an element by  select element in the model explorer, click on it ant then click on the diagram.
<BR/>In order to not display a menu,  a user can edit the model that represent the creation menu and set the attribute visibility to false. </pre><P align="middle"><img src=C:\git\org.eclipse.papyrus\plugins\infra\org.eclipse.papyrus.infra.newchild\doc\imgDOC\EnableCreationMenu.png alt=EnableCreationMenu ></P><P align="middle">EnableCreationMenu</P></BR><H3>Create or modify ElementCreationModel</H3><pre>An advanced User is able to create of modify creation menu. This menu is a model that can be edited </pre><H4>How to</H4><pre>An advanced user can contribuate to the menu by adding a new plugin that contains:
<BR/>	-a xmi file that represents a creation menu. The model must be a instance of org.eclipse.papyrus.infra.newchild/resource/elementCreationMenuModel.ecore. It contains
<BR/>		•	CreationMenu
<BR/>			o	It correspond to a menu
<BR/>			o	The ElemenTypeIDRef correspond a reference to the element Type.
<BR/>			o	The role can be filled in order to specify the role play by the element.
<BR/>			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;
<BR/>		•	Folder
<BR/>			o	It is possible to add owns label an icon.
<BR/>			o  Visibilty to specify if the folder is visible.
<BR/>	-a reference to an extension point, to specify that papyrus must take in account this file display the menu
<BR/><code>
<BR/><extension
<BR/>         point="org.eclipse.papyrus.infra.newchild">
<BR/>      <menuCreationModel
<BR/>            model="YourCreationMenu.xmi">
<BR/>      </menuCreationModel>
<BR/></extension>
<BR/></code></pre><pre>In the following example, a menu creation for a package is presented. This menu is contained in the folder SimpleUMLTest. We have associated a image for this menu.</pre><P align="middle"><img src=C:\git\org.eclipse.papyrus\plugins\infra\org.eclipse.papyrus.infra.newchild\doc\imgDOC\PackageWithIconO.png alt=Creation menu for a package with a specific icon ></P><P align="middle">Creation menu for a package with a specific icon</P></BR><P align="middle"><img src=C:\git\org.eclipse.papyrus\plugins\infra\org.eclipse.papyrus.infra.newchild\doc\imgDOC\PackageWithIconOIllustration.png alt=Result for this menu ></P><P align="middle">Result for this menu</P></BR><pre>In this following example, a creation menu will be specify  to allow creation of nested classifier. That 's why the role "nestedClassifier" is precised. The label for this creation is "nestedClass"</pre><P align="middle"><img src=C:\git\org.eclipse.papyrus\plugins\infra\org.eclipse.papyrus.infra.newchild\doc\imgDOC\NestedClassifierIllustration.png alt=Result for the menu nestedClass ></P><P align="middle">Result for the menu nestedClass</P></BR><P align="middle"><img src=C:\git\org.eclipse.papyrus\plugins\infra\org.eclipse.papyrus.infra.newchild\doc\imgDOC\NestedClassifier.png alt=Creation menu model for nested class ></P><P align="middle">Creation menu model for nested class</P></BR><pre>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. </pre><P align="middle"><img src=C:\git\org.eclipse.papyrus\plugins\infra\org.eclipse.papyrus.infra.newchild\doc\imgDOC\AllPossibleActivities.png alt=Creation menu model for activity ></P><P align="middle">Creation menu model for activity</P></BR><P align="middle"><img src=C:\git\org.eclipse.papyrus\plugins\infra\org.eclipse.papyrus.infra.newchild\doc\imgDOC\AllPossibleActivitiesIllustration.png alt=Result for this menu activity ></P><P align="middle">Result for this menu activity</P></BR><H3>Generate "ElementCreationModel" from a profile</H3><pre>From a stereotyped profile, a model of new child menu can be generated.
<BR/>For example a user after designing a profile, want to have a dedicated menu  from this profile/
<BR/>For the moment this function is not implemented.</pre><H3>Hide, change order or add submenus</H3><pre>The User can modify the creation menu by adding submenus: order about new child menu, precise if the role must be displayed.</pre><H4>How to</H4><pre>test</pre><H3>Create or modify ElementCreationModel at runtime thanks to a GUI</H3><pre>A user  can edit a the model that represent the creation menu  at runtime for papyrus thanks to a dedicated UI.</pre><H2>Design</H2><P align="middle"><img src=C:/git/org.eclipse.papyrus/plugins/infra/org.eclipse.papyrus.infra.newchild/doc/imgDOC/Architecture.png alt=Architecture ></P><P align="middle">Architecture</P></BR><pre>The system is done by two plugins:
<BR/>	•	org.eclipse.papyrus.infra.newchild
<BR/>	It has in charge to provide and construct swt.Menu from the ecore model. To do that the developer has to:
<BR/>		o	instantiate a CreationMenuFactory, 
<BR/>		o	ask to get all Root model and populate it
<BR/>	<code>
<BR/>		CreationMenuFactory creationMenuFactory= new CreationMenuFactory(editingDomain);
<BR/>		ArrayList<Folder> folders= creationMenuRegistry.getRootFolder();
<BR/>		Iterator<Folder> iterFolder= folders.iterator();
<BR/>		while (iterFolder.hasNext()) {
<BR/>			Folder currentFolder= iterFolder.next();
<BR/>			creationMenuFactory.populateMenu(menu, currentFolder,eObject);
<BR/>		}
<BR/></code>
<BR/>	•	org.eclipse.papyrus.views.modelexplorer.newchild
<BR/>	It has in charge to add menu in the model explorer of papyrus.
<BR/></pre><P align="middle"><img src=C:/git/org.eclipse.papyrus/plugins/infra/org.eclipse.papyrus.infra.newchild/doc/imgDOC/NewDiagram.png alt=NewDiagram ></P><P align="middle">NewDiagram</P></BR><pre>This the structure of EMF model for model
<BR/>	•	CreationMenu
<BR/>		o	It correspond to a menu
<BR/>		o	The ElemenTypeIDRef correspond a reference to the element Type.
<BR/>		o	The role can be filled in order to specify the role play by the element.
<BR/>		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;
<BR/>	•	Folder
<BR/>		o	It is possible to add owns label an icon.
<BR/></pre><P align="middle"><img src=C:\git\org.eclipse.papyrus\plugins\infra\org.eclipse.papyrus.infra.newchild\doc\imgDOC\MenuExample.png alt=Example of obtained Menu ></P><P align="middle">Example of obtained Menu</P></BR><P align="middle"><img src=C:\git\org.eclipse.papyrus\plugins\infra\org.eclipse.papyrus.infra.newchild\doc\imgDOC\codeXML.PNG alt=Example of xml for a creation menu ></P><P align="middle">Example of xml for a creation menu</P></BR><pre>Here an example of xml of creation menu.</pre><H2>Tests</H2><H3>Create a model without nothing</H3><H3>createa model with only a root</H3><H3>create a model with elementType as String</H3><H3>Use a menu from a model without ElementType model</H3><H3>Use a menu with elementType model</H3><H3>Use a menu with stereotyped element</H3></html>

Back to the top