diff options
author | Florian Noyrit | 2016-01-29 10:02:50 +0000 |
---|---|---|
committer | Florian Noyrit | 2016-01-29 10:02:50 +0000 |
commit | c33bf090ae301abce757edc6969dbd8326084927 (patch) | |
tree | f6460855b0493b814fad96d7572a0cd89a3b7913 /plugins/uml/org.eclipse.papyrus.uml.service.types | |
parent | ea8ea3da07dd133eed8a6e3f81087c17ad9c5ee5 (diff) | |
download | org.eclipse.papyrus-c33bf090ae301abce757edc6969dbd8326084927.tar.gz org.eclipse.papyrus-c33bf090ae301abce757edc6969dbd8326084927.tar.xz org.eclipse.papyrus-c33bf090ae301abce757edc6969dbd8326084927.zip |
Improve ElementTypeConfiguration Framework to support:
- Advice execution ordering
- Prepare Multiple ClientContext in Papyrus
Change-Id: I00b5d3d5e090de1b8fc9926c9073913c90dda47e
Diffstat (limited to 'plugins/uml/org.eclipse.papyrus.uml.service.types')
5 files changed, 55 insertions, 19 deletions
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/model/StandardProfile.elementtypesconfigurations b/plugins/uml/org.eclipse.papyrus.uml.service.types/model/StandardProfile.elementtypesconfigurations index e67af61a759..882bd902578 100644 --- a/plugins/uml/org.eclipse.papyrus.uml.service.types/model/StandardProfile.elementtypesconfigurations +++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/model/StandardProfile.elementtypesconfigurations @@ -1,9 +1,30 @@ <?xml version="1.0" encoding="UTF-8"?>
-<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.0" xmi:id="_jfoLkGT_EeSEqNuV3JpFCA" metamodelNsURI="http://www.eclipse.org/uml2/5.0.0/UML/Profile/Standard">
- <elementTypeConfigurations xsi:type="elementtypesconfigurations:MetamodelTypeConfiguration" xmi:id="_Wv4tEGUAEeSEqNuV3JpFCA" name="UML::Stereotype::Trace" identifier="org.eclipse.papyrus.uml.stereotype.Trace" hint="UML::Stereotype::Trace" editHelperClassName="org.eclipse.papyrus.infra.gmfdiag.common.helper.DefaultEditHelper">
- <eClass href="platform:/plugin/org.eclipse.uml2.uml.profile.standard/model/Standard.ecore#//Trace"/>
+<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.0"
+ xmi:id="_jfoLkGT_EeSEqNuV3JpFCA"
+ identifier="org.eclipse.papyrus.uml.service.types.StandardProfile"
+ metamodelNsURI="http://www.eclipse.org/uml2/5.0.0/UML/Profile/Standard">
+ <elementTypeConfigurations
+ xsi:type="elementtypesconfigurations:MetamodelTypeConfiguration"
+ xmi:id="_Wv4tEGUAEeSEqNuV3JpFCA"
+ name="UML::Stereotype::Trace"
+ identifier="org.eclipse.papyrus.uml.stereotype.Trace"
+ hint="UML::Stereotype::Trace"
+ editHelperClassName="org.eclipse.papyrus.infra.gmfdiag.common.helper.DefaultEditHelper">
+ <eClass
+ href="../../../plugin/org.eclipse.uml2.uml.profile.standard/model/Standard.ecore#//Trace"/>
</elementTypeConfigurations>
- <elementTypeConfigurations xsi:type="elementtypesconfigurations:MetamodelTypeConfiguration" xmi:id="_Wv4tEWUAEeSEqNuV3JpFCA" name="UML::Stereotype::Refine" identifier="org.eclipse.papyrus.uml.stereotype.Refine" hint="UML::Stereotype::Refine" editHelperClassName="org.eclipse.papyrus.infra.gmfdiag.common.helper.DefaultEditHelper">
- <eClass href="platform:/plugin/org.eclipse.uml2.uml.profile.standard/model/Standard.ecore#//Refine"/>
+ <elementTypeConfigurations
+ xsi:type="elementtypesconfigurations:MetamodelTypeConfiguration"
+ xmi:id="_Wv4tEWUAEeSEqNuV3JpFCA"
+ name="UML::Stereotype::Refine"
+ identifier="org.eclipse.papyrus.uml.stereotype.Refine"
+ hint="UML::Stereotype::Refine"
+ editHelperClassName="org.eclipse.papyrus.infra.gmfdiag.common.helper.DefaultEditHelper">
+ <eClass
+ href="../../../plugin/org.eclipse.uml2.uml.profile.standard/model/Standard.ecore#//Refine"/>
</elementTypeConfigurations>
</elementtypesconfigurations:ElementTypeSetConfiguration>
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/model/uml-containments.elementtypesconfigurations b/plugins/uml/org.eclipse.papyrus.uml.service.types/model/uml-containments.elementtypesconfigurations index a693005f606..2df67356e20 100644 --- a/plugins/uml/org.eclipse.papyrus.uml.service.types/model/uml-containments.elementtypesconfigurations +++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/model/uml-containments.elementtypesconfigurations @@ -5,6 +5,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:elementtypesconfigurations="http://www.eclipse.org/papyrus/infra/elementtypesconfigurations/1.0"
xmi:id="_ScP1oFYCEeS0WsAAtVmToA"
+ identifier="org.eclipse.papyrus.uml.service.types.UMLContainmentsElementTypeSet"
metamodelNsURI="http://www.eclipse.org/uml2/5.0.0/UML">
<elementTypeConfigurations
xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration"
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations b/plugins/uml/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations index 81925cf2c02..96f19e86443 100644 --- a/plugins/uml/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations +++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations @@ -5,6 +5,8 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:elementtypesconfigurations="http://www.eclipse.org/papyrus/infra/elementtypesconfigurations/1.0" xmi:id="_ScP1oFYCEeS0WsAAtVmToA" + name="UMLElementTypeSet" + identifier="org.eclipse.papyrus.uml.service.types.UMLElementTypeSet" metamodelNsURI="http://www.eclipse.org/uml2/5.0.0/UML"> <elementTypeConfigurations xsi:type="elementtypesconfigurations:MetamodelTypeConfiguration" @@ -3732,12 +3734,13 @@ inheritance="all" target="_SccC-1YCEeS0WsAAtVmToA"/> <adviceBindingsConfigurations - xmi:id="_PBjP4BM9EeW4hZNFQ_NOtQ" - name="" description="" - identifier="org.eclipse.papyrus.uml.advice.ConstraintContextDestroyEditHelperAdvice" - editHelperAdviceClassName="org.eclipse.papyrus.uml.service.types.helper.advice.ConstraintContextDestroyEditHelperAdvice" - inheritance="all" - target="_SccC-1YCEeS0WsAAtVmToA"/> + xmi:id="_PBjP4BM9EeW4hZNFQ_NOtQ" + name="" + description="" + identifier="org.eclipse.papyrus.uml.advice.ConstraintContextDestroyEditHelperAdvice" + editHelperAdviceClassName="org.eclipse.papyrus.uml.service.types.helper.advice.ConstraintContextDestroyEditHelperAdvice" + inheritance="all" + target="_SccC-1YCEeS0WsAAtVmToA"/> <adviceBindingsConfigurations xmi:id="_R_pDcWT7EeSzFvTXGJPhUg" name="org.eclipse.papyrus.uml.advice.Classifier" diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/plugin.xml b/plugins/uml/org.eclipse.papyrus.uml.service.types/plugin.xml index 50035a3a30b..a0c5156019c 100644 --- a/plugins/uml/org.eclipse.papyrus.uml.service.types/plugin.xml +++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/plugin.xml @@ -1879,21 +1879,21 @@ <extension point="org.eclipse.papyrus.infra.elementtypesconfigurations.elementTypeSetConfiguration"> <elementTypeSet - id="org.eclipse.papyrus.uml.service.types.UMLElementTypeSet" + clientContextID="org.eclipse.papyrus.infra.services.edit.TypeContext" path="model/uml.elementtypesconfigurations"> </elementTypeSet> </extension> <extension point="org.eclipse.papyrus.infra.elementtypesconfigurations.elementTypeSetConfiguration"> <elementTypeSet - id="org.eclipse.papyrus.uml.service.types.UMLContainmentsElementTypeSet" + clientContextID="org.eclipse.papyrus.infra.services.edit.TypeContext" path="model/uml-containments.elementtypesconfigurations"> </elementTypeSet> </extension> <extension point="org.eclipse.papyrus.infra.elementtypesconfigurations.elementTypeSetConfiguration"> <elementTypeSet - id="org.eclipse.papyrus.uml.service.types.StandardProfileElementTypeSet" + clientContextID="org.eclipse.papyrus.infra.services.edit.TypeContext" path="model/StandardProfile.elementtypesconfigurations"> </elementTypeSet> </extension> diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/AbstractFeatureRelationshipReorientEditHelperAdvice.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/AbstractFeatureRelationshipReorientEditHelperAdvice.java index 214ec80e403..31d8d0b33de 100644 --- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/AbstractFeatureRelationshipReorientEditHelperAdvice.java +++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/AbstractFeatureRelationshipReorientEditHelperAdvice.java @@ -5,13 +5,16 @@ import java.util.List; 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.IElementType;
import org.eclipse.gmf.runtime.emf.type.core.ISpecializationType;
import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
import org.eclipse.papyrus.infra.elementtypesconfigurations.utils.ElementTypeRegistryUtils;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy;
+import org.eclipse.papyrus.infra.services.edit.internal.context.TypeContext;
abstract public class AbstractFeatureRelationshipReorientEditHelperAdvice extends AbstractEditHelperAdvice {
@@ -22,14 +25,22 @@ abstract public class AbstractFeatureRelationshipReorientEditHelperAdvice extend Object value = request.getParameters().get(DefaultSemanticEditPolicy.GRAPHICAL_RECONNECTED_EDGE);
if (value instanceof View) {
- List<IElementType> elementTypes = ElementTypeRegistryUtils.getElementTypesBySemanticHint(((View) value).getType());
- for (IElementType iElementType : elementTypes) {
- List<ISpecializationType> subs = Arrays.asList(ElementTypeRegistry.getInstance().getSpecializationsOf(elementTypeIDToSpecialize()));
- if (subs.contains(iElementType)) {
- return getFeatureRelationshipReorientCommand(request);
+ try {
+ IClientContext context = TypeContext.getContext();
+ List<IElementType> elementTypes = ElementTypeRegistryUtils.getElementTypesBySemanticHint(((View) value).getType(), context.getId());
+
+ for (IElementType iElementType : elementTypes) {
+ List<ISpecializationType> subs = Arrays.asList(ElementTypeRegistry.getInstance().getSpecializationsOf(elementTypeIDToSpecialize()));
+ if (subs.contains(iElementType)) {
+ return getFeatureRelationshipReorientCommand(request);
+ }
}
+ } catch (ServiceException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
}
+
}
return null;
|