Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Wouters2014-03-14 13:51:50 +0000
committerLaurent Wouters2014-03-14 13:54:22 +0000
commitf515b310417b386c79d9fbd2500c5373a7179aa7 (patch)
tree1785439bb2467282b35964ab71c18f8e2fffff38 /plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties
parent832ceab5e78772d2b483348f620de7b47a4c091f (diff)
downloadorg.eclipse.papyrus-f515b310417b386c79d9fbd2500c5373a7179aa7.tar.gz
org.eclipse.papyrus-f515b310417b386c79d9fbd2500c5373a7179aa7.tar.xz
org.eclipse.papyrus-f515b310417b386c79d9fbd2500c5373a7179aa7.zip
399860: Papyrus shall enable to customize the creation policy of views
https://bugs.eclipse.org/bugs/show_bug.cgi?id=399860 Signed-off-by: Laurent Wouters <laurent.wouters@cea.fr>
Diffstat (limited to 'plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties')
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/META-INF/MANIFEST.MF3
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/model/notation/notation.ctx110
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/model/notation/ui/SingleDiagram.xwt4
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/GMFModelElement.java88
-rwxr-xr-xplugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/provider/ModelContentProvider.java78
-rwxr-xr-xplugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/util/LegacyOwnerObservable.java158
6 files changed, 385 insertions, 56 deletions
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/META-INF/MANIFEST.MF b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/META-INF/MANIFEST.MF
index d922ee2a532..cbdf8697d24 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/META-INF/MANIFEST.MF
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/META-INF/MANIFEST.MF
@@ -19,7 +19,8 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.papyrus.infra.core;bundle-version="1.0.0",
org.eclipse.papyrus.uml.tools;bundle-version="1.0.0",
org.eclipse.papyrus.infra.services.labelprovider;bundle-version="1.0.0",
- org.eclipse.papyrus.infra.gmfdiag.preferences;bundle-version="1.0.0"
+ org.eclipse.papyrus.infra.gmfdiag.preferences;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.viewpoints.policy;bundle-version="1.0.0"
Export-Package: org.eclipse.papyrus.infra.gmfdiag.properties.extension,
org.eclipse.papyrus.infra.gmfdiag.properties.modelelement
Bundle-Vendor: %Bundle-Vendor
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/model/notation/notation.ctx b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/model/notation/notation.ctx
index 530b8df9e75..484a6246643 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/model/notation/notation.ctx
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/model/notation/notation.ctx
@@ -37,9 +37,6 @@
<sections name="Single RelativeBendpoints" sectionFile="ui/SingleRelativeBendpoints.xwt">
<widget href="ui/SingleRelativeBendpoints.xwt#/"/>
</sections>
- <sections name="Single Diagram" sectionFile="ui/SingleDiagram.xwt">
- <widget href="ui/SingleDiagram.xwt#/"/>
- </sections>
<sections name="Single Image" sectionFile="ui/SingleImage.xwt">
<widget href="ui/SingleImage.xwt#/"/>
</sections>
@@ -184,18 +181,18 @@
<widget href="ui/SingleRulersAndGrid.xwt#/"/>
</sections>
</tabs>
- <views name="Single Diagram" sections="//@tabs.0/@sections.12" automaticContext="true" datacontexts="//@dataContexts.0/@elements.12">
+ <tabs label="General" id="general" category="org.eclipse.papyrus" priority="75">
+ <sections name="Single Diagram" sectionFile="ui/SingleDiagram.xwt">
+ <widget href="ui/SingleDiagram.xwt#/"/>
+ </sections>
+ </tabs>
+ <views name="Single Diagram" sections="//@tabs.2/@sections.0" automaticContext="true" datacontexts="//@dataContexts.0/@elements.12">
<constraints xsi:type="constraints:SimpleConstraint" name="isSingleDiagram">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="Diagram"/>
</constraints>
</views>
- <views name="Single Decorable Element" sections="//@tabs.0/@sections.58" automaticContext="true" datacontexts="//@dataContexts.1/@elements.0">
- <constraints xsi:type="constraints:SimpleConstraint" name="isDecorableElementConstraint">
- <constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.4"/>
- </constraints>
- </views>
<views name="Single Edge" sections="//@tabs.0/@sections.0" automaticContext="true" datacontexts="//@dataContexts.0/@elements.0">
<constraints xsi:type="constraints:SimpleConstraint" name="isSingleEdge">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
@@ -280,112 +277,112 @@
<properties xsi:type="constraints:ValueProperty" name="className" value="RelativeBendpoints"/>
</constraints>
</views>
- <views name="Single Image" sections="//@tabs.0/@sections.13" automaticContext="true" datacontexts="//@dataContexts.0/@elements.13">
+ <views name="Single Image" sections="//@tabs.0/@sections.12" automaticContext="true" datacontexts="//@dataContexts.0/@elements.13">
<constraints xsi:type="constraints:SimpleConstraint" name="isSingleImage">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="Image"/>
</constraints>
</views>
- <views name="Single Guide" sections="//@tabs.0/@sections.14" automaticContext="true" datacontexts="//@dataContexts.0/@elements.14">
+ <views name="Single Guide" sections="//@tabs.0/@sections.13" automaticContext="true" datacontexts="//@dataContexts.0/@elements.14">
<constraints xsi:type="constraints:SimpleConstraint" name="isSingleGuide">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="Guide"/>
</constraints>
</views>
- <views name="Single NodeEntry" sections="//@tabs.0/@sections.15" automaticContext="true" datacontexts="//@dataContexts.0/@elements.15">
+ <views name="Single NodeEntry" sections="//@tabs.0/@sections.14" automaticContext="true" datacontexts="//@dataContexts.0/@elements.15">
<constraints xsi:type="constraints:SimpleConstraint" name="isSingleNodeEntry">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="NodeEntry"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
</constraints>
</views>
- <views name="Single StringToPropertyValueMapEntry" sections="//@tabs.0/@sections.16" automaticContext="true" datacontexts="//@dataContexts.0/@elements.16">
+ <views name="Single StringToPropertyValueMapEntry" sections="//@tabs.0/@sections.15" automaticContext="true" datacontexts="//@dataContexts.0/@elements.16">
<constraints xsi:type="constraints:SimpleConstraint" name="isSingleStringToPropertyValueMapEntry">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="StringToPropertyValueMapEntry"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
</constraints>
</views>
- <views name="Single PropertyValue" sections="//@tabs.0/@sections.17" automaticContext="true" datacontexts="//@dataContexts.0/@elements.17">
+ <views name="Single PropertyValue" sections="//@tabs.0/@sections.16" automaticContext="true" datacontexts="//@dataContexts.0/@elements.17">
<constraints xsi:type="constraints:SimpleConstraint" name="isSinglePropertyValue">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="PropertyValue"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
</constraints>
</views>
- <views name="Single StringObjectConverter" sections="//@tabs.0/@sections.18" automaticContext="true" datacontexts="//@dataContexts.0/@elements.18">
+ <views name="Single StringObjectConverter" sections="//@tabs.0/@sections.17" automaticContext="true" datacontexts="//@dataContexts.0/@elements.18">
<constraints xsi:type="constraints:SimpleConstraint" name="isSingleStringObjectConverter">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="StringObjectConverter"/>
</constraints>
</views>
- <views name="Single Shape" sections="//@tabs.0/@sections.19" automaticContext="true" datacontexts="//@dataContexts.0/@elements.19">
+ <views name="Single Shape" sections="//@tabs.0/@sections.18" automaticContext="true" datacontexts="//@dataContexts.0/@elements.19">
<constraints xsi:type="constraints:SimpleConstraint" name="isSingleShape">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="Shape"/>
</constraints>
</views>
- <views name="Single Compartment" sections="//@tabs.0/@sections.20" automaticContext="true" datacontexts="//@dataContexts.0/@elements.20">
+ <views name="Single Compartment" sections="//@tabs.0/@sections.19" automaticContext="true" datacontexts="//@dataContexts.0/@elements.20">
<constraints xsi:type="constraints:SimpleConstraint" name="isSingleCompartment">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="Compartment"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
</constraints>
</views>
- <views name="Single ListCompartment" sections="//@tabs.0/@sections.21" automaticContext="true" datacontexts="//@dataContexts.0/@elements.21">
+ <views name="Single ListCompartment" sections="//@tabs.0/@sections.20" automaticContext="true" datacontexts="//@dataContexts.0/@elements.21">
<constraints xsi:type="constraints:SimpleConstraint" name="isSingleListCompartment">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="ListCompartment"/>
</constraints>
</views>
- <views name="Single Connector" sections="//@tabs.0/@sections.22" automaticContext="true" datacontexts="//@dataContexts.0/@elements.22">
+ <views name="Single Connector" sections="//@tabs.0/@sections.21" automaticContext="true" datacontexts="//@dataContexts.0/@elements.22">
<constraints xsi:type="constraints:SimpleConstraint" name="isSingleConnector">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="Connector"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
</constraints>
</views>
- <views name="Single StandardDiagram" sections="//@tabs.0/@sections.23" automaticContext="true" datacontexts="//@dataContexts.0/@elements.23">
+ <views name="Single StandardDiagram" sections="//@tabs.0/@sections.22" automaticContext="true" datacontexts="//@dataContexts.0/@elements.23">
<constraints xsi:type="constraints:SimpleConstraint" name="isSingleStandardDiagram">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="StandardDiagram"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
</constraints>
</views>
- <views name="Single DecorationNode" sections="//@tabs.0/@sections.24" automaticContext="true" datacontexts="//@dataContexts.0/@elements.24">
+ <views name="Single DecorationNode" sections="//@tabs.0/@sections.23" automaticContext="true" datacontexts="//@dataContexts.0/@elements.24">
<constraints xsi:type="constraints:SimpleConstraint" name="isSingleDecorationNode">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="DecorationNode"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
</constraints>
</views>
- <views name="Single BasicDecorationNode" sections="//@tabs.0/@sections.25" automaticContext="true" datacontexts="//@dataContexts.0/@elements.25">
+ <views name="Single BasicDecorationNode" sections="//@tabs.0/@sections.24" automaticContext="true" datacontexts="//@dataContexts.0/@elements.25">
<constraints xsi:type="constraints:SimpleConstraint" name="isSingleBasicDecorationNode">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="BasicDecorationNode"/>
</constraints>
</views>
- <views name="Single BasicCompartment" sections="//@tabs.0/@sections.26" automaticContext="true" datacontexts="//@dataContexts.0/@elements.26">
+ <views name="Single BasicCompartment" sections="//@tabs.0/@sections.25" automaticContext="true" datacontexts="//@dataContexts.0/@elements.26">
<constraints xsi:type="constraints:SimpleConstraint" name="isSingleBasicCompartment">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="BasicCompartment"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
</constraints>
</views>
- <views name="Single BasicSemanticCompartment" sections="//@tabs.0/@sections.27" automaticContext="true" datacontexts="//@dataContexts.0/@elements.27">
+ <views name="Single BasicSemanticCompartment" sections="//@tabs.0/@sections.26" automaticContext="true" datacontexts="//@dataContexts.0/@elements.27">
<constraints xsi:type="constraints:SimpleConstraint" name="isSingleBasicSemanticCompartment">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="BasicSemanticCompartment"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
</constraints>
</views>
- <views name="Single SemanticListCompartment" sections="//@tabs.0/@sections.28" automaticContext="true" datacontexts="//@dataContexts.0/@elements.28">
+ <views name="Single SemanticListCompartment" sections="//@tabs.0/@sections.27" automaticContext="true" datacontexts="//@dataContexts.0/@elements.28">
<constraints xsi:type="constraints:SimpleConstraint" name="isSingleSemanticListCompartment">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="SemanticListCompartment"/>
@@ -398,209 +395,214 @@
<properties xsi:type="constraints:ValueProperty" name="className" value="org.eclipse.papyrus.infra.gmfdiag.properties.constraint.IsSingleDiagramEditorConstraint"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple Edge" sections="//@tabs.0/@sections.29" automaticContext="true" datacontexts="//@dataContexts.0/@elements.0">
+ <views elementMultiplicity="-1" name="Multiple Edge" sections="//@tabs.0/@sections.28" automaticContext="true" datacontexts="//@dataContexts.0/@elements.0">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleEdge">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="Edge"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple Node" sections="//@tabs.0/@sections.30" automaticContext="true" datacontexts="//@dataContexts.0/@elements.1">
+ <views elementMultiplicity="-1" name="Multiple Node" sections="//@tabs.0/@sections.29" automaticContext="true" datacontexts="//@dataContexts.0/@elements.1">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleNode">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="Node"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple LayoutConstraint" sections="//@tabs.0/@sections.31" automaticContext="true" datacontexts="//@dataContexts.0/@elements.2">
+ <views elementMultiplicity="-1" name="Multiple LayoutConstraint" sections="//@tabs.0/@sections.30" automaticContext="true" datacontexts="//@dataContexts.0/@elements.2">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleLayoutConstraint">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="LayoutConstraint"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple Size" sections="//@tabs.0/@sections.32" automaticContext="true" datacontexts="//@dataContexts.0/@elements.3">
+ <views elementMultiplicity="-1" name="Multiple Size" sections="//@tabs.0/@sections.31" automaticContext="true" datacontexts="//@dataContexts.0/@elements.3">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleSize">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="Size"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple Location" sections="//@tabs.0/@sections.33" automaticContext="true" datacontexts="//@dataContexts.0/@elements.4">
+ <views elementMultiplicity="-1" name="Multiple Location" sections="//@tabs.0/@sections.32" automaticContext="true" datacontexts="//@dataContexts.0/@elements.4">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleLocation">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="Location"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple Bounds" sections="//@tabs.0/@sections.34" automaticContext="true" datacontexts="//@dataContexts.0/@elements.5">
+ <views elementMultiplicity="-1" name="Multiple Bounds" sections="//@tabs.0/@sections.33" automaticContext="true" datacontexts="//@dataContexts.0/@elements.5">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleBounds">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="Bounds"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple Ratio" sections="//@tabs.0/@sections.35" automaticContext="true" datacontexts="//@dataContexts.0/@elements.6">
+ <views elementMultiplicity="-1" name="Multiple Ratio" sections="//@tabs.0/@sections.34" automaticContext="true" datacontexts="//@dataContexts.0/@elements.6">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleRatio">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="Ratio"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple Anchor" sections="//@tabs.0/@sections.36" automaticContext="true" datacontexts="//@dataContexts.0/@elements.7">
+ <views elementMultiplicity="-1" name="Multiple Anchor" sections="//@tabs.0/@sections.35" automaticContext="true" datacontexts="//@dataContexts.0/@elements.7">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleAnchor">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="Anchor"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple Bendpoints" sections="//@tabs.0/@sections.37" automaticContext="true" datacontexts="//@dataContexts.0/@elements.8">
+ <views elementMultiplicity="-1" name="Multiple Bendpoints" sections="//@tabs.0/@sections.36" automaticContext="true" datacontexts="//@dataContexts.0/@elements.8">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleBendpoints">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="Bendpoints"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple IdentityAnchor" sections="//@tabs.0/@sections.38" automaticContext="true" datacontexts="//@dataContexts.0/@elements.9">
+ <views elementMultiplicity="-1" name="Multiple IdentityAnchor" sections="//@tabs.0/@sections.37" automaticContext="true" datacontexts="//@dataContexts.0/@elements.9">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleIdentityAnchor">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="IdentityAnchor"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple View" sections="//@tabs.0/@sections.39" automaticContext="true" datacontexts="//@dataContexts.0/@elements.10">
+ <views elementMultiplicity="-1" name="Multiple View" sections="//@tabs.0/@sections.38" automaticContext="true" datacontexts="//@dataContexts.0/@elements.10">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleView">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="View"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple RelativeBendpoints" sections="//@tabs.0/@sections.40" automaticContext="true" datacontexts="//@dataContexts.0/@elements.11">
+ <views elementMultiplicity="-1" name="Multiple RelativeBendpoints" sections="//@tabs.0/@sections.39" automaticContext="true" datacontexts="//@dataContexts.0/@elements.11">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleRelativeBendpoints">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="RelativeBendpoints"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple Diagram" sections="//@tabs.0/@sections.41" automaticContext="true" datacontexts="//@dataContexts.0/@elements.12">
+ <views elementMultiplicity="-1" name="Multiple Diagram" sections="//@tabs.0/@sections.40" automaticContext="true" datacontexts="//@dataContexts.0/@elements.12">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleDiagram">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="Diagram"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple Image" sections="//@tabs.0/@sections.42" automaticContext="true" datacontexts="//@dataContexts.0/@elements.13">
+ <views elementMultiplicity="-1" name="Multiple Image" sections="//@tabs.0/@sections.41" automaticContext="true" datacontexts="//@dataContexts.0/@elements.13">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleImage">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="Image"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple Guide" sections="//@tabs.0/@sections.43" automaticContext="true" datacontexts="//@dataContexts.0/@elements.14">
+ <views elementMultiplicity="-1" name="Multiple Guide" sections="//@tabs.0/@sections.42" automaticContext="true" datacontexts="//@dataContexts.0/@elements.14">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleGuide">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="Guide"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple NodeEntry" sections="//@tabs.0/@sections.44" automaticContext="true" datacontexts="//@dataContexts.0/@elements.15">
+ <views elementMultiplicity="-1" name="Multiple NodeEntry" sections="//@tabs.0/@sections.43" automaticContext="true" datacontexts="//@dataContexts.0/@elements.15">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleNodeEntry">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="NodeEntry"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple StringToPropertyValueMapEntry" sections="//@tabs.0/@sections.45" automaticContext="true" datacontexts="//@dataContexts.0/@elements.16">
+ <views elementMultiplicity="-1" name="Multiple StringToPropertyValueMapEntry" sections="//@tabs.0/@sections.44" automaticContext="true" datacontexts="//@dataContexts.0/@elements.16">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleStringToPropertyValueMapEntry">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="StringToPropertyValueMapEntry"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple PropertyValue" sections="//@tabs.0/@sections.46" automaticContext="true" datacontexts="//@dataContexts.0/@elements.17">
+ <views elementMultiplicity="-1" name="Multiple PropertyValue" sections="//@tabs.0/@sections.45" automaticContext="true" datacontexts="//@dataContexts.0/@elements.17">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultiplePropertyValue">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="PropertyValue"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple StringObjectConverter" sections="//@tabs.0/@sections.47" automaticContext="true" datacontexts="//@dataContexts.0/@elements.18">
+ <views elementMultiplicity="-1" name="Multiple StringObjectConverter" sections="//@tabs.0/@sections.46" automaticContext="true" datacontexts="//@dataContexts.0/@elements.18">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleStringObjectConverter">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="StringObjectConverter"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple Shape" sections="//@tabs.0/@sections.48" automaticContext="true" datacontexts="//@dataContexts.0/@elements.19">
+ <views elementMultiplicity="-1" name="Multiple Shape" sections="//@tabs.0/@sections.47" automaticContext="true" datacontexts="//@dataContexts.0/@elements.19">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleShape">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="Shape"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple Compartment" sections="//@tabs.0/@sections.49" automaticContext="true" datacontexts="//@dataContexts.0/@elements.20">
+ <views elementMultiplicity="-1" name="Multiple Compartment" sections="//@tabs.0/@sections.48" automaticContext="true" datacontexts="//@dataContexts.0/@elements.20">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleCompartment">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="Compartment"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple ListCompartment" sections="//@tabs.0/@sections.50" automaticContext="true" datacontexts="//@dataContexts.0/@elements.21">
+ <views elementMultiplicity="-1" name="Multiple ListCompartment" sections="//@tabs.0/@sections.49" automaticContext="true" datacontexts="//@dataContexts.0/@elements.21">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleListCompartment">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="ListCompartment"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple Connector" sections="//@tabs.0/@sections.51" automaticContext="true" datacontexts="//@dataContexts.0/@elements.22">
+ <views elementMultiplicity="-1" name="Multiple Connector" sections="//@tabs.0/@sections.50" automaticContext="true" datacontexts="//@dataContexts.0/@elements.22">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleConnector">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="Connector"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple StandardDiagram" sections="//@tabs.0/@sections.52" automaticContext="true" datacontexts="//@dataContexts.0/@elements.23">
+ <views elementMultiplicity="-1" name="Multiple StandardDiagram" sections="//@tabs.0/@sections.51" automaticContext="true" datacontexts="//@dataContexts.0/@elements.23">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleStandardDiagram">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="StandardDiagram"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple DecorationNode" sections="//@tabs.0/@sections.53" automaticContext="true" datacontexts="//@dataContexts.0/@elements.24">
+ <views elementMultiplicity="-1" name="Multiple DecorationNode" sections="//@tabs.0/@sections.52" automaticContext="true" datacontexts="//@dataContexts.0/@elements.24">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleDecorationNode">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="DecorationNode"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple BasicDecorationNode" sections="//@tabs.0/@sections.54" automaticContext="true" datacontexts="//@dataContexts.0/@elements.25">
+ <views elementMultiplicity="-1" name="Multiple BasicDecorationNode" sections="//@tabs.0/@sections.53" automaticContext="true" datacontexts="//@dataContexts.0/@elements.25">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleBasicDecorationNode">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="BasicDecorationNode"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple BasicCompartment" sections="//@tabs.0/@sections.55" automaticContext="true" datacontexts="//@dataContexts.0/@elements.26">
+ <views elementMultiplicity="-1" name="Multiple BasicCompartment" sections="//@tabs.0/@sections.54" automaticContext="true" datacontexts="//@dataContexts.0/@elements.26">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleBasicCompartment">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="BasicCompartment"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple BasicSemanticCompartment" sections="//@tabs.0/@sections.56" automaticContext="true" datacontexts="//@dataContexts.0/@elements.27">
+ <views elementMultiplicity="-1" name="Multiple BasicSemanticCompartment" sections="//@tabs.0/@sections.55" automaticContext="true" datacontexts="//@dataContexts.0/@elements.27">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleBasicSemanticCompartment">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="BasicSemanticCompartment"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
</constraints>
</views>
- <views elementMultiplicity="-1" name="Multiple SemanticListCompartment" sections="//@tabs.0/@sections.57" automaticContext="true" datacontexts="//@dataContexts.0/@elements.28">
+ <views elementMultiplicity="-1" name="Multiple SemanticListCompartment" sections="//@tabs.0/@sections.56" automaticContext="true" datacontexts="//@dataContexts.0/@elements.28">
<constraints xsi:type="constraints:SimpleConstraint" name="isMultipleSemanticListCompartment">
<constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.3"/>
<properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
<properties xsi:type="constraints:ValueProperty" name="className" value="SemanticListCompartment"/>
</constraints>
</views>
+ <views name="Single Decorable Element" sections="//@tabs.0/@sections.57" automaticContext="true" datacontexts="//@dataContexts.1/@elements.0">
+ <constraints xsi:type="constraints:SimpleConstraint" name="isDecorableElementConstraint">
+ <constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.4"/>
+ </constraints>
+ </views>
<dataContexts name="notation" label="notation">
<elements name="Edge" supertypes="//@dataContexts.0/@elements.10">
<properties name="source" type="Reference"/>
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/model/notation/ui/SingleDiagram.xwt b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/model/notation/ui/SingleDiagram.xwt
index 0e7eb2296f9..d08acaed9e0 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/model/notation/ui/SingleDiagram.xwt
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/model/notation/ui/SingleDiagram.xwt
@@ -11,6 +11,8 @@
<ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout>
</Composite.layout>
<ppe:StringEditor input="{Binding}" property="notation:Diagram:name"></ppe:StringEditor>
- <ppe:StringLabel input="{Binding}" property="notation:View:type"></ppe:StringLabel>
+ <ppe:ReferenceLabel input="{Binding}" property="notation:View:prototype" readOnly="true" customLabel="View Type"></ppe:ReferenceLabel>
+ <ppe:ReferenceDialog input="{Binding}" property="notation:View:owner" customLabel="Owner"></ppe:ReferenceDialog>
+ <ppe:ReferenceDialog input="{Binding}" property="notation:View:element" customLabel="Root element"></ppe:ReferenceDialog>
</Composite>
</Composite> \ No newline at end of file
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/GMFModelElement.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/GMFModelElement.java
index f85b81ae344..a85ef90af4c 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/GMFModelElement.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/GMFModelElement.java
@@ -19,17 +19,28 @@ import org.eclipse.emf.databinding.FeaturePath;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.Style;
import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.papyrus.infra.core.services.ServiceException;
import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForEObject;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
import org.eclipse.papyrus.infra.gmfdiag.properties.Activator;
import org.eclipse.papyrus.infra.gmfdiag.properties.databinding.GradientObservableValue;
+import org.eclipse.papyrus.infra.gmfdiag.properties.provider.ModelContentProvider;
+import org.eclipse.papyrus.infra.gmfdiag.properties.util.LegacyOwnerObservable;
import org.eclipse.papyrus.infra.services.labelprovider.service.LabelProviderService;
+import org.eclipse.papyrus.infra.viewpoints.policy.PolicyChecker;
+import org.eclipse.papyrus.infra.viewpoints.policy.ViewPrototype;
+import org.eclipse.papyrus.infra.viewpoints.style.StylePackage;
+import org.eclipse.papyrus.infra.widgets.providers.IStaticContentProvider;
import org.eclipse.papyrus.uml.tools.databinding.PapyrusObservableList;
import org.eclipse.papyrus.uml.tools.databinding.PapyrusObservableValue;
import org.eclipse.papyrus.views.properties.modelelement.EMFModelElement;
+import org.eclipse.swt.graphics.Image;
/**
* A ModelElement to represent an element of the GMF Notation metamodel
@@ -65,7 +76,29 @@ public class GMFModelElement extends EMFModelElement {
}
@Override
+ protected boolean isFeatureEditable(String propertyPath) {
+ if (propertyPath.endsWith("owner")) {
+ return true;
+ }
+ return super.isFeatureEditable(propertyPath);
+ }
+
+ @Override
protected IObservable doGetObservable(String propertyPath) {
+ if (propertyPath.endsWith("owner")) {
+ Diagram diagram = (Diagram)source;
+ Style style = diagram.getStyle(StylePackage.Literals.PAPYRUS_VIEW_STYLE);
+ if (style != null)
+ return new PapyrusObservableValue(style, StylePackage.Literals.PAPYRUS_VIEW_STYLE__OWNER, domain);
+ return new LegacyOwnerObservable(diagram, StylePackage.Literals.PAPYRUS_VIEW_STYLE__OWNER, domain);
+ } else if (propertyPath.endsWith("prototype")) {
+ Diagram diagram = (Diagram)source;
+ Style style = diagram.getStyle(StylePackage.Literals.PAPYRUS_VIEW_STYLE);
+ if (style != null)
+ return new PapyrusObservableValue(style, StylePackage.Literals.PAPYRUS_VIEW_STYLE__CONFIGURATION, domain);
+ return new LegacyOwnerObservable(diagram, StylePackage.Literals.PAPYRUS_VIEW_STYLE__CONFIGURATION, domain);
+ }
+
FeaturePath featurePath = getFeaturePath(propertyPath);
EStructuralFeature feature = getFeature(propertyPath);
@@ -88,6 +121,22 @@ public class GMFModelElement extends EMFModelElement {
@Override
public ILabelProvider getLabelProvider(String propertyPath) {
+ if (propertyPath.endsWith("prototype")) {
+ return new ILabelProvider() {
+ public void addListener(ILabelProviderListener listener) { }
+ public void removeListener(ILabelProviderListener listener) { }
+ public void dispose() { }
+ public boolean isLabelProperty(Object element, String property) { return false; }
+ public Image getImage(Object element) {
+ ViewPrototype proto = DiagramUtils.getPrototype((Diagram)source);
+ return proto.getIcon();
+ }
+ public String getText(Object element) {
+ ViewPrototype proto = DiagramUtils.getPrototype((Diagram)source);
+ return proto.getQualifiedName();
+ }
+ };
+ }
try {
return ServiceUtilsForEObject.getInstance().getService(LabelProviderService.class, source).getLabelProvider();
} catch (ServiceException ex) {
@@ -96,4 +145,43 @@ public class GMFModelElement extends EMFModelElement {
}
}
+ /**
+ * @see org.eclipse.papyrus.views.properties.modelelement.EMFModelElement#getContentProvider(java.lang.String)
+ */
+ @Override
+ public IStaticContentProvider getContentProvider(String propertyPath) {
+ if (propertyPath.endsWith("element")) {
+ Diagram diagram = (Diagram)source;
+ return new ModelContentProvider(diagram, getRoot(diagram.getElement())) {
+ @Override
+ protected boolean isValid(EObject selection, Diagram diagram, ViewPrototype prototype) {
+ return PolicyChecker.getCurrent().canHaveNewView(selection, DiagramUtils.getOwner(diagram), prototype);
+ }
+ };
+ } else if (propertyPath.endsWith("owner")) {
+ Diagram diagram = (Diagram) source;
+ return new ModelContentProvider(diagram, getRoot(diagram.getElement())) {
+ @Override
+ protected boolean isValid(EObject selection, Diagram diagram, ViewPrototype prototype) {
+ return PolicyChecker.getCurrent().canHaveNewView(diagram.getElement(), selection, prototype);
+ }
+ };
+ }
+ return super.getContentProvider(propertyPath);
+ }
+
+ /**
+ * Gets the root EObject from the given one
+ * @param obj An object
+ * @return The root object which is an ancestor of the given one
+ */
+ private EObject getRoot(EObject obj) {
+ EObject current = obj;
+ EObject parent = obj.eContainer();
+ while (parent != null) {
+ current = parent;
+ parent = parent.eContainer();
+ }
+ return current;
+ }
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/provider/ModelContentProvider.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/provider/ModelContentProvider.java
new file mode 100755
index 00000000000..78e29021201
--- /dev/null
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/provider/ModelContentProvider.java
@@ -0,0 +1,78 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.properties.provider;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
+import org.eclipse.papyrus.infra.viewpoints.configuration.ui.ECoreModelContentProvider;
+import org.eclipse.papyrus.infra.viewpoints.policy.ViewPrototype;
+import org.eclipse.papyrus.infra.widgets.providers.IHierarchicContentProvider;
+import org.eclipse.papyrus.infra.widgets.providers.IStaticContentProvider;
+
+/**
+ * Represents a simple ECore model content provider for the selection of a diagram's root model element
+ * @author Laurent Wouters
+ */
+public abstract class ModelContentProvider extends ECoreModelContentProvider implements IStaticContentProvider, IHierarchicContentProvider {
+
+ /**
+ * The diagram
+ */
+ private Diagram diagram;
+
+ /**
+ * Initializes the provider with the given root
+ * @param diagram The diagram for which a root model element is to be provided
+ * @param root The root object
+ */
+ public ModelContentProvider(Diagram diagram, EObject root) {
+ super(root);
+ this.diagram = diagram;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.papyrus.infra.widgets.providers.IStaticContentProvider#getElements()
+ */
+ public Object[] getElements() {
+ return getElements(null);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.papyrus.infra.widgets.providers.IHierarchicContentProvider#isValidValue(java.lang.Object)
+ */
+ public boolean isValidValue(Object element) {
+ if (element == null)
+ return false;
+ if (!(element instanceof EObject))
+ return false;
+ ViewPrototype prototype = DiagramUtils.getPrototype(diagram);
+ if (prototype == null)
+ return false;
+ return isValid((EObject) element, diagram, prototype);
+ }
+
+ /**
+ * Determines whether the selection is valid
+ *
+ * @param selection
+ * The selection
+ * @param diagram
+ * The diagram
+ * @param prototype
+ * The diagram's prototype
+ * @return <code>true</code> if the selection is valid
+ */
+ protected abstract boolean isValid(EObject selection, Diagram diagram, ViewPrototype prototype);
+}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/util/LegacyOwnerObservable.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/util/LegacyOwnerObservable.java
new file mode 100755
index 00000000000..8b941318fae
--- /dev/null
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/util/LegacyOwnerObservable.java
@@ -0,0 +1,158 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.properties.util;
+
+import org.eclipse.core.databinding.observable.ChangeEvent;
+import org.eclipse.core.databinding.observable.IChangeListener;
+import org.eclipse.core.databinding.observable.Realm;
+import org.eclipse.core.databinding.observable.value.AbstractObservableValue;
+import org.eclipse.core.databinding.observable.value.ValueDiff;
+import org.eclipse.emf.common.command.AbstractCommand;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.Style;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
+import org.eclipse.papyrus.infra.viewpoints.style.StylePackage;
+import org.eclipse.papyrus.uml.tools.databinding.PapyrusObservableValue;
+
+/**
+ * Represents the observable value of a diagram's owner in the case where the diagram does not yet have the viewpoints-compatible style for holding the value itself
+ * @author Laurent Wouters
+ */
+public class LegacyOwnerObservable extends AbstractObservableValue {
+
+ private EditingDomain domain;
+ private Diagram diagram;
+ private EReference reference;
+ private IChangeListener styleListener;
+ private IChangeListener valueListener;
+ private PapyrusObservableValue styleObservable;
+ private PapyrusObservableValue valueObservable;
+
+ /**
+ * Initializes the observables
+ * @param diagram The diagram to be observed
+ * @param domain The editing domain
+ */
+ public LegacyOwnerObservable(Diagram diagram, EReference feature, EditingDomain domain) {
+ super(Realm.getDefault());
+ this.domain = domain;
+ this.diagram = diagram;
+ this.reference = feature;
+ buildStyleListener();
+ this.styleObservable = new PapyrusObservableValue(diagram, NotationPackage.Literals.VIEW__STYLES, domain);
+ this.styleObservable.addChangeListener(styleListener);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.databinding.observable.value.AbstractObservableValue#isStale()
+ */
+ public boolean isStale() {
+ return (valueListener != null);
+ }
+
+ /**
+ * Builds the listener for the styles property of the diagram
+ */
+ private void buildStyleListener() {
+ this.styleListener = new IChangeListener() {
+ public void handleChange(ChangeEvent event) {
+ if (valueListener != null)
+ return;
+ Style style = LegacyOwnerObservable.this.diagram.getStyle(StylePackage.Literals.PAPYRUS_VIEW_STYLE);
+ if (style != null)
+ buildValueListener(style);
+ }
+ };
+ }
+
+ /**
+ * Builds the listener for the EObjectValue property of the style
+ * @param style The style to be observed
+ */
+ private void buildValueListener(Style style) {
+ this.valueListener = new IChangeListener() {
+ public void handleChange(ChangeEvent event) {
+ fireValueChange(new ValueDiff() {
+ public Object getOldValue() { return null; }
+ public Object getNewValue() { return DiagramUtils.getOwner(diagram); }
+ });
+ }
+ };
+ valueObservable = new PapyrusObservableValue(style, reference, domain);
+ valueObservable.addChangeListener(valueListener);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.databinding.observable.value.IObservableValue#getValueType()
+ */
+ public Object getValueType() {
+ return EcorePackage.Literals.EOBJECT;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.databinding.observable.value.AbstractObservableValue#doGetValue()
+ */
+ protected Object doGetValue() {
+ return DiagramUtils.getOwner(diagram);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.databinding.observable.value.AbstractObservableValue#doSetValue(java.lang.Object)
+ */
+ protected void doSetValue(Object value) {
+ Command emfCommand = getCommand((EObject) value);
+ domain.getCommandStack().execute(emfCommand);
+ }
+
+ private Command getCommand(final EObject newValue) {
+ final EObject oldValue = DiagramUtils.getOwner(diagram);
+
+ return new AbstractCommand("Change diagram's owner") {
+ private boolean createStyle = true;
+
+ public void execute() {
+ Style style = diagram.getStyle(StylePackage.Literals.PAPYRUS_VIEW_STYLE);
+ createStyle = (style == null);
+ DiagramUtils.setOwner(diagram, newValue);
+ }
+
+ public void redo() {
+ DiagramUtils.setOwner(diagram, newValue);
+ }
+
+ @Override
+ public void undo() {
+ if (createStyle) {
+ Style style = diagram.getStyle(StylePackage.Literals.PAPYRUS_VIEW_STYLE);
+ diagram.getStyles().remove(style);
+ } else {
+ DiagramUtils.setOwner(diagram, oldValue);
+ }
+ }
+
+ @Override
+ public boolean prepare() {
+ return true;
+ }
+ };
+ }
+}

Back to the top