Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/infra/gmfdiag')
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/META-INF/MANIFEST.MF2
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/model/gmfdiag-common.elementtypesconfigurations21
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/model/notation.elementtypesconfigurations2
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/DefaultEditHelper.java39
4 files changed, 31 insertions, 33 deletions
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/META-INF/MANIFEST.MF b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/META-INF/MANIFEST.MF
index 134a924bbfc..32b56b70010 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/META-INF/MANIFEST.MF
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/META-INF/MANIFEST.MF
@@ -62,7 +62,7 @@ Require-Bundle: org.eclipse.emf.ecore.edit;bundle-version="[2.9.0,3.0.0)",
org.eclipse.papyrus.infra.services.decoration;bundle-version="[1.2.0,2.0.0)";visibility:=reexport,
org.eclipse.gmf.runtime.diagram.ui.providers;bundle-version="[1.7.0,2.0.0)",
org.eclipse.papyrus.infra.emf.readonly;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.papyrus.infra.types.core;bundle-version="[2.0.0,3.0.0)";visibility:=reexport,
+ org.eclipse.papyrus.infra.types.core;bundle-version="[3.0.0,4.0.0)";visibility:=reexport,
org.eclipse.papyrus.infra.sync;bundle-version="[1.2.0,2.0.0)";visibility:=reexport,
org.eclipse.papyrus.infra.services.edit.ui;bundle-version="[2.0.0,3.0.0)";visibility:=reexport
Bundle-Vendor: %providerName
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/model/gmfdiag-common.elementtypesconfigurations b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/model/gmfdiag-common.elementtypesconfigurations
index fab8b64c560..02c3f0e8554 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/model/gmfdiag-common.elementtypesconfigurations
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/model/gmfdiag-common.elementtypesconfigurations
@@ -1,18 +1,3 @@
-<?xml version="1.0" encoding="ASCII"?>
-<elementtypesconfigurations:ElementTypeSetConfiguration
- xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:elementtypesconfigurations="http://www.eclipse.org/papyrus/infra/elementtypesconfigurations/1.1"
- xmi:id="_rWI4YHPzEeSnGJwaJWHCSg"
- description=""
- identifier="org.eclipse.papyrus.infra.gmfdiag.common.elementTypeSet"
- name="GMFDiagCommon"
- metamodelNsURI="http://www.eclipse.org/emf/2002/Ecore">
- <adviceBindingsConfigurations
- xsi:type="elementtypesconfigurations:AdviceBindingConfiguration"
- xmi:id="_jxuLwPvzEeWw0r4E4rSXyw"
- description=""
- identifier="org.eclipse.papyrus.infra.gmfdiag.common.advice.GMFDiagramDuplicateEditHelperAdvice"
- editHelperAdviceClassName="org.eclipse.papyrus.infra.gmfdiag.common.advice.GMFDiagramDuplicateEditHelperAdvice"/>
-</elementtypesconfigurations:ElementTypeSetConfiguration>
+<?xml version="1.0" encoding="ASCII" standalone="no"?><elementtypesconfigurations:ElementTypeSetConfiguration xmlns:elementtypesconfigurations="http://www.eclipse.org/papyrus/infra/elementtypesconfigurations/1.2" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" description="" identifier="org.eclipse.papyrus.infra.gmfdiag.common.elementTypeSet" metamodelNsURI="http://www.eclipse.org/emf/2002/Ecore" name="GMFDiagCommon" xmi:id="_rWI4YHPzEeSnGJwaJWHCSg" xmi:version="2.0">
+ <adviceBindingsConfigurations description="" editHelperAdviceClassName="org.eclipse.papyrus.infra.gmfdiag.common.advice.GMFDiagramDuplicateEditHelperAdvice" identifier="org.eclipse.papyrus.infra.gmfdiag.common.advice.GMFDiagramDuplicateEditHelperAdvice" xmi:id="_jxuLwPvzEeWw0r4E4rSXyw" xsi:type="elementtypesconfigurations:AdviceBindingConfiguration"/>
+</elementtypesconfigurations:ElementTypeSetConfiguration> \ No newline at end of file
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/model/notation.elementtypesconfigurations b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/model/notation.elementtypesconfigurations
index 0d813f220da..2219425490f 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/model/notation.elementtypesconfigurations
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/model/notation.elementtypesconfigurations
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="ASCII" standalone="no"?><elementtypesconfigurations:ElementTypeSetConfiguration xmlns:elementtypesconfigurations="http://www.eclipse.org/papyrus/infra/elementtypesconfigurations/1.1" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" identifier="org.eclipse.papyrus.infra.gmfdiag.common.NotationElementTypeSet" metamodelNsURI="http://www.eclipse.org/gmf/runtime/1.0.2/notation" name="NotationElementTypeSet" xmi:id="_ScP1oFYCEeS0WsAAtVmToA" xmi:version="2.0">
+<?xml version="1.0" encoding="ASCII" standalone="no"?><elementtypesconfigurations:ElementTypeSetConfiguration xmlns:elementtypesconfigurations="http://www.eclipse.org/papyrus/infra/elementtypesconfigurations/1.2" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" identifier="org.eclipse.papyrus.infra.gmfdiag.common.NotationElementTypeSet" metamodelNsURI="http://www.eclipse.org/gmf/runtime/1.0.2/notation" name="NotationElementTypeSet" xmi:id="_ScP1oFYCEeS0WsAAtVmToA" xmi:version="2.0">
<elementTypeConfigurations editHelperClassName="org.eclipse.papyrus.infra.gmfdiag.common.helper.DefaultEditHelper" identifier="org.eclipse.papyrus.gmfdiag.common.Diagram" name="GMF::Diagram" xmi:id="_ScP1oVYCEeS0WsAAtVmToA" xsi:type="elementtypesconfigurations:MetamodelTypeConfiguration">
<eClass href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.ecore#//Diagram"/>
</elementTypeConfigurations>
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/DefaultEditHelper.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/DefaultEditHelper.java
index 1923421b102..8a03c87f595 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/DefaultEditHelper.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/DefaultEditHelper.java
@@ -25,6 +25,7 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry;
+import org.eclipse.gmf.runtime.emf.type.core.IClientContext;
import org.eclipse.gmf.runtime.emf.type.core.IContainerDescriptor;
import org.eclipse.gmf.runtime.emf.type.core.IEditHelperContext;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
@@ -344,31 +345,43 @@ public class DefaultEditHelper extends AbstractNotifierEditHelper {
}
if (advices == null) {
-
if (editHelperContext instanceof EObject) {
- // IElementType type = ElementTypeRegistry.getInstance().getElementType((EObject) editHelperContext, req.getClientContext());
- // advices = CacheRegistry.getInstance().getEditHelperAdvice(req.getClientContext(), type);
advices = ElementTypeRegistry.getInstance().getEditHelperAdvice((EObject) editHelperContext, req.getClientContext());
+ IElementType[] types = ElementTypeRegistry.getInstance().getAllTypesMatching((EObject) editHelperContext, req.getClientContext());
+ Arrays.sort(advices, new AdviceComparator(types, req.getClientContext().getId()));
} else if (editHelperContext instanceof IElementType) {
advices = CacheRegistry.getInstance().getEditHelperAdvice(req.getClientContext(), ((IElementType) editHelperContext));
+ Arrays.sort(advices, new AdviceComparator((IElementType) editHelperContext, req.getClientContext().getId()));
} else if (editHelperContext instanceof IEditHelperContext) {
- IElementType type = ((IEditHelperContext) editHelperContext).getElementType();
- if (type != null) {
- advices = CacheRegistry.getInstance().getEditHelperAdvice(req.getClientContext(), type);
+ IClientContext clientContext = ((IEditHelperContext) editHelperContext).getClientContext();
+ IElementType elementType = ((IEditHelperContext) editHelperContext).getElementType();
+ EObject eObject = ((IEditHelperContext) editHelperContext).getEObject();
+
+ if (clientContext != null) {
+ if (elementType != null) {
+ advices = CacheRegistry.getInstance().getEditHelperAdvice(req.getClientContext(), elementType);
+ Arrays.sort(advices, new AdviceComparator(elementType, req.getClientContext().getId()));
+ } else if (eObject != null) {
+ IElementType[] types = ElementTypeRegistry.getInstance().getAllTypesMatching(eObject, req.getClientContext());
+ advices = ElementTypeRegistry.getInstance().getEditHelperAdvice(editHelperContext);
+ Arrays.sort(advices, new AdviceComparator(types, req.getClientContext().getId()));
+
+ }
} else {
- advices = ElementTypeRegistry.getInstance().getEditHelperAdvice(editHelperContext);
+ if (elementType != null) {
+ advices = CacheRegistry.getInstance().getEditHelperAdvice(req.getClientContext(), elementType);
+ Arrays.sort(advices, new AdviceComparator(elementType, req.getClientContext().getId()));
+ } else if (eObject != null) {
+ IElementType[] types = ElementTypeRegistry.getInstance().getAllTypesMatching(eObject, req.getClientContext());
+ advices = ElementTypeRegistry.getInstance().getEditHelperAdvice(editHelperContext);
+ Arrays.sort(advices, new AdviceComparator(types, req.getClientContext().getId()));
+ }
}
- } else {
- advices = ElementTypeRegistry.getInstance().getEditHelperAdvice(editHelperContext);
}
}
- if (null != advices) {
- Arrays.sort(advices, new AdviceComparator(req.getClientContext().getId()));
- }
-
return advices;
}

Back to the top