Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorptessier2014-03-28 12:19:03 -0400
committerptessier2014-03-28 12:19:03 -0400
commitc688a6391f657796f14e34414201e57b953dc4f6 (patch)
tree5dd9938b66ddfd53a74332cdba87b1b23ed4ba9c /plugins
parent4f1af28df69e9ba9a6181f719367e8114cfface7 (diff)
downloadorg.eclipse.papyrus-c688a6391f657796f14e34414201e57b953dc4f6.tar.gz
org.eclipse.papyrus-c688a6391f657796f14e34414201e57b953dc4f6.tar.xz
org.eclipse.papyrus-c688a6391f657796f14e34414201e57b953dc4f6.zip
431015: [Model Explorer] The context menu items should be ordered more
logically (some even renamed) and some items removed https://bugs.eclipse.org/bugs/show_bug.cgi?id=431015
Diffstat (limited to 'plugins')
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf.readonly/plugin.xml2
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.newchild/src/org/eclipse/papyrus/infra/newchild/CreationMenuFactory.java182
-rw-r--r--plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/plugin.xml2
-rw-r--r--plugins/infra/services/org.eclipse.papyrus.infra.services.validation/plugin.xml2
-rw-r--r--plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/plugin.xml2
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.import/plugin.xml2
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.newchild/plugin.xml2
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.newchild/src/org/eclipse/papyrus/views/modelexplorer/newchild/DynamicNewChild.java67
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.resourceloading/plugin.xml2
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/plugin.xml16
10 files changed, 158 insertions, 121 deletions
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.readonly/plugin.xml b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.readonly/plugin.xml
index 6232c1f3e44..3d9bc8ca18f 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.readonly/plugin.xml
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.readonly/plugin.xml
@@ -75,7 +75,7 @@
<menuContribution
allPopups="false"
- locationURI="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup?after=org.eclipse.papyrus.views.modelexplorer.resourceloading.UnloadResource">
+ locationURI="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup?after=tools">
<command commandId="org.eclipse.papyrus.infra.emf.readonly.EnableWriteCommand"
icon="icons/enable_write.png"
label="Enable write"
diff --git a/plugins/infra/org.eclipse.papyrus.infra.newchild/src/org/eclipse/papyrus/infra/newchild/CreationMenuFactory.java b/plugins/infra/org.eclipse.papyrus.infra.newchild/src/org/eclipse/papyrus/infra/newchild/CreationMenuFactory.java
index d278a9feb26..af3638c8f7a 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.newchild/src/org/eclipse/papyrus/infra/newchild/CreationMenuFactory.java
+++ b/plugins/infra/org.eclipse.papyrus.infra.newchild/src/org/eclipse/papyrus/infra/newchild/CreationMenuFactory.java
@@ -45,6 +45,7 @@ import org.eclipse.swt.widgets.MenuItem;
*
*/
public class CreationMenuFactory {
+
private TransactionalEditingDomain editingDomain;
/**
@@ -60,64 +61,66 @@ public class CreationMenuFactory {
/**
* construct a menu from a folder, this is a recursion
- * @param menu the current menu
- * @param folder the folder
- * @param selectedObject the current selection
+ *
+ * @param menu
+ * the current menu
+ * @param folder
+ * the folder
+ * @param selectedObject
+ * the current selection
* @return true if sub-menu has been added
*/
- public boolean populateMenu(Menu menu, Folder folder, EObject selectedObject){
- if(selectedObject!=null && folder!=null){
- org.eclipse.swt.widgets.MenuItem topMenuItem = new MenuItem(menu,SWT.CASCADE );
+ public boolean populateMenu(Menu menu, Folder folder, EObject selectedObject, int index) {
+ if(selectedObject != null && folder != null) {
+ org.eclipse.swt.widgets.MenuItem topMenuItem = new MenuItem(menu, SWT.CASCADE, index);
topMenuItem.setText(folder.getLabel());
- if(folder.getIcon()!=null){
+ if(folder.getIcon() != null) {
URL url;
try {
url = new URL(folder.getIcon());
- ImageDescriptor imgDesc=ImageDescriptor.createFromURL(url);
+ ImageDescriptor imgDesc = ImageDescriptor.createFromURL(url);
topMenuItem.setImage(imgDesc.createImage());
} catch (MalformedURLException e) {
e.printStackTrace();
}
}
- Menu topMenu=new Menu(menu);
+ Menu topMenu = new Menu(menu);
topMenuItem.setMenu(topMenu);
- boolean oneDisplayedMenu=false;
+ boolean oneDisplayedMenu = false;
for(org.eclipse.papyrus.infra.newchild.ElementCreationMenuModel.Menu currentMenu : folder.getMenu()) {
- boolean result=false;
- if( currentMenu instanceof Folder){
- result=populateMenu(topMenu, (Folder) currentMenu, selectedObject);
-
+ boolean result = false;
+ if(currentMenu instanceof Folder) {
+ result = populateMenu(topMenu, (Folder)currentMenu, selectedObject, topMenu.getItemCount());
+
}
- if( currentMenu instanceof CreationMenu){
- CreationMenu currentCreationMenu=(CreationMenu)currentMenu;
- EReference reference=null;
- String role=currentCreationMenu.getRole();
+ if(currentMenu instanceof CreationMenu) {
+ CreationMenu currentCreationMenu = (CreationMenu)currentMenu;
+ EReference reference = null;
+ String role = currentCreationMenu.getRole();
//the role is precised
- if( role!=null){
- EStructuralFeature feature= selectedObject.eClass().getEStructuralFeature(role);
- if( feature instanceof EReference){
- reference=(EReference)feature;
- result =constructMenu(selectedObject, topMenu, currentCreationMenu, reference);
+ if(role != null) {
+ EStructuralFeature feature = selectedObject.eClass().getEStructuralFeature(role);
+ if(feature instanceof EReference) {
+ reference = (EReference)feature;
+ result = constructMenu(selectedObject, topMenu, currentCreationMenu, reference);
}
- }
- else{//no precisison
- //test if all roles must be displayed
- if(currentCreationMenu.isDisplayAllRoles()){
- result = constructMenu(selectedObject, topMenu, currentCreationMenu);
- }
- else{
+ } else {//no precisison
+ //test if all roles must be displayed
+ if(currentCreationMenu.isDisplayAllRoles()) {
+ result = constructMenu(selectedObject, topMenu, currentCreationMenu);
+ } else {
- result = constructMenu(selectedObject, topMenu, currentCreationMenu, reference);
+ result = constructMenu(selectedObject, topMenu, currentCreationMenu, reference);
}
}
}
- if(result){
- oneDisplayedMenu=true;
+ if(result) {
+ oneDisplayedMenu = true;
}
}
- if(!oneDisplayedMenu){
+ if(!oneDisplayedMenu) {
topMenuItem.dispose();
}
return oneDisplayedMenu;
@@ -129,18 +132,21 @@ public class CreationMenuFactory {
/**
* create menu by displaying if possible different roles
- * @param selectedObject the current object
- * @param menu the current menu in creation
- * @param currentCreationMenu
+ *
+ * @param selectedObject
+ * the current object
+ * @param menu
+ * the current menu in creation
+ * @param currentCreationMenu
* @return true if sub-menu has been created
*/
protected boolean constructMenu(EObject selectedObject, Menu menu, CreationMenu currentCreationMenu) {
//find the feature between children and owner
ArrayList<EStructuralFeature> possibleEFeatures = getEreferences(selectedObject, currentCreationMenu);
- if(possibleEFeatures.size()==1){
- Command cmd=buildCommand(null, selectedObject, currentCreationMenu.getElementTypeIdRef());
- if( cmd.canExecute()){
+ if(possibleEFeatures.size() == 1) {
+ Command cmd = buildCommand(null, selectedObject, currentCreationMenu.getElementTypeIdRef());
+ if(cmd.canExecute()) {
MenuItem item = new MenuItem(menu, SWT.NONE);
fillIcon(currentCreationMenu, item);
item.setEnabled(true);
@@ -149,58 +155,59 @@ public class CreationMenuFactory {
return true;
}
return false;
- }
- else if(possibleEFeatures.size()>1){
- org.eclipse.swt.widgets.MenuItem topMenuItem = new MenuItem(menu,SWT.CASCADE );
+ } else if(possibleEFeatures.size() > 1) {
+ org.eclipse.swt.widgets.MenuItem topMenuItem = new MenuItem(menu, SWT.CASCADE);
topMenuItem.setText(currentCreationMenu.getLabel());
- Menu topMenu=new Menu(menu);
+ Menu topMenu = new Menu(menu);
topMenuItem.setMenu(topMenu);
for(EStructuralFeature eStructuralFeature : possibleEFeatures) {
- Command cmd=buildCommand((EReference)eStructuralFeature, selectedObject, currentCreationMenu.getElementTypeIdRef());
- if( cmd.canExecute()){
+ Command cmd = buildCommand((EReference)eStructuralFeature, selectedObject, currentCreationMenu.getElementTypeIdRef());
+ if(cmd.canExecute()) {
MenuItem item = new MenuItem(topMenu, SWT.NONE);
fillIcon(currentCreationMenu, item);
item.setEnabled(true);
- item.setText("As "+eStructuralFeature.getName());
+ item.setText("As " + eStructuralFeature.getName());
item.addSelectionListener(new CreationMenuListener(cmd, editingDomain));
}
}
- if(topMenu.getItemCount()==0){
+ if(topMenu.getItemCount() == 0) {
topMenu.dispose();
return false;
- }
- else{
+ } else {
return true;
}
- }
- else{
+ } else {
return false;
}
}
+
/**
* display an icon from a specified url or from Element type
+ *
* @param currentCreationMenu
* @param item
*/
protected void fillIcon(CreationMenu currentCreationMenu, MenuItem item) {
- if(currentCreationMenu.getIcon()!=null && !"".equals(currentCreationMenu.getIcon())){
+ if(currentCreationMenu.getIcon() != null && !"".equals(currentCreationMenu.getIcon())) {
URL url;
try {
url = new URL(currentCreationMenu.getIcon());
- ImageDescriptor imgDesc=ImageDescriptor.createFromURL(url);
+ ImageDescriptor imgDesc = ImageDescriptor.createFromURL(url);
item.setImage(imgDesc.createImage());
} catch (MalformedURLException e) {
e.printStackTrace();
}
- }else{
+ } else {
createIconFromElementType(currentCreationMenu, item);
}
}
+
/**
* it is used in order calculate all roles that can play an element to another
- * @param selectedObject
+ *
+ * @param selectedObject
* @param currentCreationMenu
* @return return the list of Ereference that can be calculated
*/
@@ -213,8 +220,8 @@ public class CreationMenuFactory {
if(eStructuralFeature instanceof EReference) {
EReference ref = (EReference)eStructuralFeature;
if(ref.isContainment()) {
- IElementType menuType = getElementType(currentCreationMenu.getElementTypeIdRef());
- if(menuType!=null && isSubClass(ref.getEType(), menuType.getEClass())) {
+ IElementType menuType = getElementType(currentCreationMenu.getElementTypeIdRef());
+ if(menuType != null && isSubClass(ref.getEType(), menuType.getEClass())) {
possibleEFeatures.add(eStructuralFeature);
}
}
@@ -246,29 +253,35 @@ public class CreationMenuFactory {
/**
* associate the icon from the element type
- * @param currentCreationMenu
- * @param item the current menu
+ *
+ * @param currentCreationMenu
+ * @param item
+ * the current menu
*/
protected void createIconFromElementType(CreationMenu currentCreationMenu, MenuItem item) {
- if(getElementType(currentCreationMenu.getElementTypeIdRef()).getIconURL()!=null){
- ImageDescriptor imgDesc=ImageDescriptor.createFromURL(getElementType(currentCreationMenu.getElementTypeIdRef()).getIconURL());
+ if(getElementType(currentCreationMenu.getElementTypeIdRef()).getIconURL() != null) {
+ ImageDescriptor imgDesc = ImageDescriptor.createFromURL(getElementType(currentCreationMenu.getElementTypeIdRef()).getIconURL());
item.setImage(imgDesc.createImage());
}
}
/**
- * create a submenu
- * @param selectedObject the selected object
- * @param topMenu the menu when will add menus
+ * create a submenu
+ *
+ * @param selectedObject
+ * the selected object
+ * @param topMenu
+ * the menu when will add menus
* @param currentCreationMenu
- * @param reference the role of the new element
+ * @param reference
+ * the role of the new element
* @return true if the menu can be created
*/
- protected boolean constructMenu(EObject selectedObject, Menu topMenu, CreationMenu currentCreationMenu, EReference reference) {
- boolean oneDisplayedMenu=false;
- Command cmd=buildCommand(reference, selectedObject, currentCreationMenu.getElementTypeIdRef());
- if( cmd.canExecute()){
- oneDisplayedMenu=true;
+ protected boolean constructMenu(EObject selectedObject, Menu topMenu, CreationMenu currentCreationMenu, EReference reference) {
+ boolean oneDisplayedMenu = false;
+ Command cmd = buildCommand(reference, selectedObject, currentCreationMenu.getElementTypeIdRef());
+ if(cmd.canExecute()) {
+ oneDisplayedMenu = true;
MenuItem item = new MenuItem(topMenu, SWT.NONE);
fillIcon(currentCreationMenu, item);
item.setEnabled(true);
@@ -280,17 +293,24 @@ public class CreationMenuFactory {
/**
* get the IelementType from a string
- * @param extendedType the string that represents the element type
+ *
+ * @param extendedType
+ * the string that represents the element type
* @return the element type or null
*/
- protected IElementType getElementType(String extendedType){
- return ElementTypeRegistry.getInstance().getType(extendedType);
+ protected IElementType getElementType(String extendedType) {
+ return ElementTypeRegistry.getInstance().getType(extendedType);
}
+
/**
* Construct a command of creation
- * @param reference the role of the element that will be created (maybe null)
- * @param container the container of the created elements
- * @param extendedType the extended type of the created element
+ *
+ * @param reference
+ * the role of the element that will be created (maybe null)
+ * @param container
+ * the container of the created elements
+ * @param extendedType
+ * the extended type of the created element
* @return a command that can be executed by the domain
*/
protected Command buildCommand(EReference reference, EObject container, String extendedType) {
@@ -308,16 +328,16 @@ public class CreationMenuFactory {
}
return UnexecutableCommand.INSTANCE;
}
+
/**
*
* @return
* the creation request to use in this handler
*/
protected CreateElementRequest buildRequest(EReference reference, EObject container, String extendedType) {
- if(reference==null){
- return new CreateElementRequest(editingDomain, container, getElementType(extendedType)) ;
+ if(reference == null) {
+ return new CreateElementRequest(editingDomain, container, getElementType(extendedType));
}
- return new CreateElementRequest(editingDomain, container, getElementType(extendedType), reference);
+ return new CreateElementRequest(editingDomain, container, getElementType(extendedType), reference);
}
}
-
diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/plugin.xml b/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/plugin.xml
index fa1d2142e5e..3ba0cc7c9fb 100644
--- a/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/plugin.xml
+++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/plugin.xml
@@ -21,7 +21,7 @@
point="org.eclipse.ui.menus">
<menuContribution
allPopups="false"
- locationURI="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup">
+ locationURI="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup?after=tools">
<command
commandId="org.eclipse.papyrus.infra.services.controlmode.createsubmodel"
icon="icons/CreateSubModel_16.png"
diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/plugin.xml b/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/plugin.xml
index efd3fed5ff9..13ce29aaac9 100644
--- a/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/plugin.xml
+++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/plugin.xml
@@ -21,7 +21,7 @@
point="org.eclipse.ui.menus">
<menuContribution
allPopups="false"
- locationURI="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup">
+ locationURI="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup?after=tools">
<menu
icon="icons/etool16/validate.gif"
id="org.eclipse.papyrus.views.modelexplorer.popup.validation"
diff --git a/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/plugin.xml b/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/plugin.xml
index 0164774e1dd..7c35fb4a71e 100644
--- a/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/plugin.xml
+++ b/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/plugin.xml
@@ -489,7 +489,7 @@
<extension point="org.eclipse.ui.menus">
<!-- Sub-menu declaration -->
- <menuContribution locationURI="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup" allPopups="false">
+ <menuContribution locationURI="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup?before=org.eclipse.papyrus.views.modelexplorer.popupmenu.creatediagram" allPopups="false">
<menu id="org.eclipse.papyrus.views.modelexplorer.popupmenu.createsysmlchild"
label="New SysML Child">
</menu>
diff --git a/plugins/uml/org.eclipse.papyrus.uml.import/plugin.xml b/plugins/uml/org.eclipse.papyrus.uml.import/plugin.xml
index 2aaf4d06a99..84d9239ec39 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.import/plugin.xml
+++ b/plugins/uml/org.eclipse.papyrus.uml.import/plugin.xml
@@ -25,7 +25,7 @@
<extension
point="org.eclipse.ui.menus">
<menuContribution
- locationURI="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup?before=org.eclipse.papyrus.views.modelexplorer.popupmenu.createchild">
+ locationURI="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup?after=tools">
<menu
icon="icons/import_wiz_16x16-papyrusColor.gif"
id="org.eclipse.papyrus.uml.import.menu"
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.newchild/plugin.xml b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.newchild/plugin.xml
index 8ab412ae377..bd442c984e7 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.newchild/plugin.xml
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.newchild/plugin.xml
@@ -4,7 +4,7 @@
<extension point="org.eclipse.ui.menus">
<menuContribution
allPopups="false"
- locationURI="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup">
+ locationURI="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup?before=org.eclipse.papyrus.views.modelexplorer.popupmenu.creatediagram">
<dynamic
class="org.eclipse.papyrus.views.modelexplorer.newchild.DynamicNewChild"
id="org.eclipse.papyrus.views.modelexplorer.newchild.dynamic">
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.newchild/src/org/eclipse/papyrus/views/modelexplorer/newchild/DynamicNewChild.java b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.newchild/src/org/eclipse/papyrus/views/modelexplorer/newchild/DynamicNewChild.java
index 8ad3cb8d6b1..831bb1dc4ae 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.newchild/src/org/eclipse/papyrus/views/modelexplorer/newchild/DynamicNewChild.java
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.newchild/src/org/eclipse/papyrus/views/modelexplorer/newchild/DynamicNewChild.java
@@ -21,6 +21,7 @@ import java.util.Iterator;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.jface.action.ContributionItem;
import org.eclipse.jface.action.IContributionItem;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
@@ -34,16 +35,17 @@ import org.eclipse.papyrus.infra.newchild.ElementCreationMenuModel.Folder;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.ui.ISelectionService;
import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.CompoundContributionItem;
/**
* This class has in charge to create menu from elementCreationMenuModel
*
*/
-public class DynamicNewChild extends CompoundContributionItem {
+public class DynamicNewChild extends ContributionItem {
protected TransactionalEditingDomain editingDomain;
+
protected CreationMenuRegistry creationMenuRegistry;
+
/**
*
* Constructor.
@@ -62,39 +64,46 @@ public class DynamicNewChild extends CompoundContributionItem {
public DynamicNewChild(String id) {
super(id);
}
-
-
- protected IContributionItem[] getContributionItems() {
- return new IContributionItem[0];
- }
-
- public boolean isDynamic(){
- return true;
- }
-
-
-
+
+
+ protected IContributionItem[] getContributionItems() {
+ return new IContributionItem[0];
+ }
+
+ public boolean isDynamic() {
+ return true;
+ }
+
+
+
public void fill(Menu menu, int index) {
- super.fill(menu, index);
- EObject eObject= getSelection();
- 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);
+ EObject eObject = getSelection();
+ if( eObject!=null){
+ CreationMenuFactory creationMenuFactory = new CreationMenuFactory(editingDomain);
+ ArrayList<Folder> folders = creationMenuRegistry.getRootFolder();
+ Iterator<Folder> iterFolder = folders.iterator();
+ while(iterFolder.hasNext()) {
+ Folder currentFolder = iterFolder.next();
+ boolean hasbeenBuild=creationMenuFactory.populateMenu(menu, currentFolder, eObject, index);
+ if( hasbeenBuild){
+ index++;
+ }
+ }
+ }
+ else{
+ super.fill(menu, index);
}
-
}
-
+
/**
* getSelected eObject in the model explorer
+ *
* @return eObject or null
*/
- protected EObject getSelection(){
+ protected EObject getSelection() {
ISelectionService selectionService = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService();
ISelection selection = selectionService.getSelection();
@@ -102,7 +111,7 @@ public class DynamicNewChild extends CompoundContributionItem {
Object selectedobject = ((IStructuredSelection)selection).getFirstElement();
EObject selectedEObject = EMFHelper.getEObject(selectedobject);
EObject editingDomainCitizen = selectedEObject;
-
+
if((editingDomainCitizen instanceof EReference) && (selection instanceof ITreeSelection)) {
// The user selected a reference in the Advanced presentation. Infer the editing domain from the parent node, which is the reference owner
ITreeSelection treeSel = (ITreeSelection)selection;
@@ -111,11 +120,11 @@ public class DynamicNewChild extends CompoundContributionItem {
editingDomainCitizen = EMFHelper.getEObject(paths[0].getSegment(paths[0].getSegmentCount() - 2));
}
}
-
+
try {
- editingDomain =ServiceUtilsForEObject.getInstance().getService(org.eclipse.emf.transaction.TransactionalEditingDomain.class, editingDomainCitizen);
+ editingDomain = ServiceUtilsForEObject.getInstance().getService(org.eclipse.emf.transaction.TransactionalEditingDomain.class, editingDomainCitizen);
} catch (Throwable ex) {
- Activator.log.error("Impossible to get the Transactional Editing Domain.",ex);
+ Activator.log.error("Impossible to get the Transactional Editing Domain.", ex);
}
return selectedEObject;
}
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.resourceloading/plugin.xml b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.resourceloading/plugin.xml
index 19edd38e430..9e2a384acd5 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.resourceloading/plugin.xml
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.resourceloading/plugin.xml
@@ -5,7 +5,7 @@
<!-- ModelExplorer Contextual menu -->
<menuContribution
allPopups="false"
- locationURI="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup?after=org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup.paste">
+ locationURI="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup?after=tools">
<separator
name="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup.loadSeparator"
visible="true">
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/plugin.xml b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/plugin.xml
index 9ab22b3f2d6..33beecaf52e 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/plugin.xml
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/plugin.xml
@@ -135,19 +135,19 @@
</and>
</visibleWhen>
</command>
- <separator name="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup.separator0" visible="true">
+ <separator name="rename" visible="true">
</separator>
<command commandId="org.eclipse.ui.edit.rename" icon="icons/etool16/rename.gif" id="org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup.rename" label="&amp;Rename" style="push" tooltip="Rename the element">
<visibleWhen checkEnabled="true">
</visibleWhen>
</command>
- <separator name="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup.separator1" visible="true">
+ <separator name="command" visible="true">
</separator>
<command commandId="org.eclipse.ui.edit.undo" id="org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup.undo" label="&amp;Undo" style="push">
</command>
<command commandId="org.eclipse.ui.edit.redo" id="org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup.redo" label="&amp;Redo" style="push">
</command>
- <separator name="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup.separator2" visible="true">
+ <separator name="diagramedit" visible="true">
</separator>
<command commandId="org.eclipse.papyrus.views.modelexplorer.popup.open.command" icon="icons/etool16/forward.gif" id="org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup.open" label="&amp;Open" style="push" tooltip="Open">
<visibleWhen checkEnabled="true">
@@ -169,7 +169,7 @@
<visibleWhen checkEnabled="true">
</visibleWhen>
</command>
- <separator name="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup.separator3" visible="true">
+ <separator name="edition" visible="true">
</separator>
<command commandId="org.eclipse.ui.edit.cut" id="org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup.cut" label="Cu&amp;t" style="push">
<visibleWhen checkEnabled="false">
@@ -198,6 +198,14 @@
</with>
</visibleWhen>
</command>
+ <separator
+ name="tools"
+ visible="true">
+ </separator>
+ <separator
+ name="addition"
+ visible="true">
+ </separator>
</menuContribution>
<!-- ModelExplorer Contextual menu -->

Back to the top