Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCedric Dumoulin2013-12-23 22:24:09 +0000
committerCedric Dumoulin2014-01-27 13:57:15 +0000
commita1bde794fe892116019876b33570985c35062eb4 (patch)
treedfe7844fbd77cc4baeb8b826d4b9ae0b351b5486 /extraplugins/layers/org.eclipse.papyrus.layers.stackmodel
parent78aeed90433cc283fb521a3b4f6c4d51b86c9de3 (diff)
downloadorg.eclipse.papyrus-a1bde794fe892116019876b33570985c35062eb4.tar.gz
org.eclipse.papyrus-a1bde794fe892116019876b33570985c35062eb4.tar.xz
org.eclipse.papyrus-a1bde794fe892116019876b33570985c35062eb4.zip
Bug 330199 - Add AllViewsDerivedLayer
Diffstat (limited to 'extraplugins/layers/org.eclipse.papyrus.layers.stackmodel')
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/model/layers.ecore1
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/model/layers.genmodel1
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/model/layers.notation44
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/model/layers.uml3
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/AllViewsDerivedLayer.java17
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/LayersFactory.java9
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/LayersPackage.java259
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/AbstractLayerImpl.java7
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/AllViewsDerivedLayerImpl.java66
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/LayerOperatorImpl.java3
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/LayersFactoryImpl.java11
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/LayersPackageImpl.java22
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/LayersStackImpl.java2
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/util/LayersAdapterFactory.java18
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/util/LayersSwitch.java24
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/notifier/DiagramViewChangedEventNotifier.java1
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/notifier/LayersTreeEventNotifier.java3
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/util/DiagramViewToListSynchronizer.java121
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/util/LayerDiagramViewPredicate.java64
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/test/org/eclipse/papyrus/layers/stackmodel/util/DiagramViewToListSynchronizerTest.java173
20 files changed, 825 insertions, 24 deletions
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/model/layers.ecore b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/model/layers.ecore
index ab6ed143d62..b11af1d433b 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/model/layers.ecore
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/model/layers.ecore
@@ -509,4 +509,5 @@
<eClassifiers xsi:type="ecore:EClass" name="AndStackedLayerOperatorDescriptor" eSuperTypes="#//StackedLayerOperatorDescriptor"/>
<eClassifiers xsi:type="ecore:EClass" name="OrStackedLayerOperatorDescriptor" eSuperTypes="#//StackedLayerOperatorDescriptor"/>
<eClassifiers xsi:type="ecore:EClass" name="IsAbstractUmlSetter" eSuperTypes="#//PropertySetter"/>
+ <eClassifiers xsi:type="ecore:EClass" name="AllViewsDerivedLayer" eSuperTypes="#//AbstractLayer"/>
</ecore:EPackage>
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/model/layers.genmodel b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/model/layers.genmodel
index 1d146539256..5b0b8a988b0 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/model/layers.genmodel
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/model/layers.genmodel
@@ -436,5 +436,6 @@
<genClasses xsi:type="genmodel:GenClass" ecoreClass="layers.ecore#//AndStackedLayerOperatorDescriptor"/>
<genClasses xsi:type="genmodel:GenClass" ecoreClass="layers.ecore#//OrStackedLayerOperatorDescriptor"/>
<genClasses xsi:type="genmodel:GenClass" ecoreClass="layers.ecore#//IsAbstractUmlSetter"/>
+ <genClasses xsi:type="genmodel:GenClass" ecoreClass="layers.ecore#//AllViewsDerivedLayer"/>
</genPackages>
</genmodel:GenModel>
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/model/layers.notation b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/model/layers.notation
index e69e0aed413..313bed87174 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/model/layers.notation
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/model/layers.notation
@@ -1374,7 +1374,7 @@
<layoutConstraint xmi:type="notation:Bounds" xmi:id="__1eoN-HTEeKCZbxNW-U3VQ"/>
</children>
<element xmi:type="uml:Class" href="layers.uml#__1GNoOHTEeKCZbxNW-U3VQ"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="__1eoIeHTEeKCZbxNW-U3VQ" x="534" y="666"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="__1eoIeHTEeKCZbxNW-U3VQ" x="516" y="666"/>
</children>
<children xmi:type="notation:Shape" xmi:id="_7c7RQFVHEeOah7Z-UYdQAA" type="2006" fontName="Segoe UI" lineColor="0">
<eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_7c7RQlVHEeOah7Z-UYdQAA" source="ShadowFigure">
@@ -1404,6 +1404,38 @@
<element xmi:type="uml:Enumeration" href="layers.uml#_7cWpgFVHEeOah7Z-UYdQAA"/>
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_7c7RQVVHEeOah7Z-UYdQAA" x="280" y="790"/>
</children>
+ <children xmi:type="notation:Shape" xmi:id="_ft-hUWtpEeOlpfB_tZS-QA" type="2008" fontName="Segoe UI" lineColor="0">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_ft-hU2tpEeOlpfB_tZS-QA" source="ShadowFigure">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_ft-hVGtpEeOlpfB_tZS-QA" key="ShadowFigure_Value" value="false"/>
+ </eAnnotations>
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_fuEn8GtpEeOlpfB_tZS-QA" source="displayNameLabelIcon">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_fuEn8WtpEeOlpfB_tZS-QA" key="displayNameLabelIcon_value" value="false"/>
+ </eAnnotations>
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_fuEn8mtpEeOlpfB_tZS-QA" source="QualifiedName">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_fuEn82tpEeOlpfB_tZS-QA" key="QualifiedNameDepth" value="1000"/>
+ </eAnnotations>
+ <children xmi:type="notation:DecorationNode" xmi:id="_fuEn9GtpEeOlpfB_tZS-QA" type="5029"/>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_fuEn9WtpEeOlpfB_tZS-QA" type="7017">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_fuEn9mtpEeOlpfB_tZS-QA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_fuEn92tpEeOlpfB_tZS-QA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_fuEn-GtpEeOlpfB_tZS-QA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_fuEn-WtpEeOlpfB_tZS-QA"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_fuEn-mtpEeOlpfB_tZS-QA" type="7018">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_fuEn-2tpEeOlpfB_tZS-QA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_fuEn_GtpEeOlpfB_tZS-QA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_fuEn_WtpEeOlpfB_tZS-QA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_fuEn_mtpEeOlpfB_tZS-QA"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_fuEn_2tpEeOlpfB_tZS-QA" type="7019">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_fuEoAGtpEeOlpfB_tZS-QA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_fuEoAWtpEeOlpfB_tZS-QA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_fuEoAmtpEeOlpfB_tZS-QA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_fuEoA2tpEeOlpfB_tZS-QA"/>
+ </children>
+ <element xmi:type="uml:Class" href="layers.uml#_ft-hUGtpEeOlpfB_tZS-QA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_ft-hUmtpEeOlpfB_tZS-QA" x="516" y="792"/>
+ </children>
<styles xmi:type="notation:DiagramStyle" xmi:id="_y-BQAda7EeKPiuTfpuvqHA"/>
<element xmi:type="uml:Model" href="layers.uml#_gAOFQLcqEeK8_t7Rpq6ZJA"/>
<edges xmi:type="notation:Connector" xmi:id="_5ZBIENa8EeKPiuTfpuvqHA" type="4001" source="_52F7ENa7EeKPiuTfpuvqHA" target="_AjwF4Na8EeKPiuTfpuvqHA" lineColor="0">
@@ -1646,6 +1678,16 @@
<sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_P0WoUGQ5EeOlpfB_tZS-QA" id="(0.004210526315789474,0.5560747663551402)"/>
<targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_P0WoUWQ5EeOlpfB_tZS-QA" id="(0.9705882352941176,0.8646616541353384)"/>
</edges>
+ <edges xmi:type="notation:Connector" xmi:id="_p-pf4GtpEeOlpfB_tZS-QA" type="4002" source="_ft-hUWtpEeOlpfB_tZS-QA" target="_52F7ENa7EeKPiuTfpuvqHA" lineColor="0">
+ <children xmi:type="notation:DecorationNode" xmi:id="_p-pf42tpEeOlpfB_tZS-QA" type="6007">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_p-pf5GtpEeOlpfB_tZS-QA" y="40"/>
+ </children>
+ <styles xmi:type="notation:FontStyle" xmi:id="_p-pf4WtpEeOlpfB_tZS-QA" fontName="Segoe UI"/>
+ <element xmi:type="uml:Generalization" href="layers.uml#_p-dSoGtpEeOlpfB_tZS-QA"/>
+ <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_p-pf4mtpEeOlpfB_tZS-QA" points="[-2, -16, 32, 261]$[-33, -267, 1, 10]"/>
+ <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_p-vmgGtpEeOlpfB_tZS-QA" id="(0.4930555555555556,0.16)"/>
+ <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_p-vmgWtpEeOlpfB_tZS-QA" id="(0.6347826086956522,0.9481865284974094)"/>
+ </edges>
</notation:Diagram>
<notation:Diagram xmi:id="_C_qusNa8EeKPiuTfpuvqHA" type="PapyrusUMLClassDiagram" name="property values" measurementUnit="Pixel">
<children xmi:type="notation:Shape" xmi:id="_EH9zgNa8EeKPiuTfpuvqHA" type="2008" fontName="Segoe UI" lineColor="0">
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/model/layers.uml b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/model/layers.uml
index 1aa62fe98bc..a73e8958beb 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/model/layers.uml
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/model/layers.uml
@@ -1403,6 +1403,9 @@ layerStackChanged().</body>
<upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_PznBdmQ5EeOlpfB_tZS-QA" value="1"/>
</ownedEnd>
</packagedElement>
+ <packagedElement xmi:type="uml:Class" xmi:id="_ft-hUGtpEeOlpfB_tZS-QA" name="AllViewsDerivedLayer">
+ <generalization xmi:type="uml:Generalization" xmi:id="_p-dSoGtpEeOlpfB_tZS-QA" general="_51zAINa7EeKPiuTfpuvqHA"/>
+ </packagedElement>
<profileApplication xmi:type="uml:ProfileApplication" xmi:id="_X07z8LcsEeK8_t7Rpq6ZJA">
<eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_X2lZwLcsEeK8_t7Rpq6ZJA" source="http://www.eclipse.org/uml2/2.0.0/UML">
<references xmi:type="ecore:EPackage" href="pathmap://UML_PROFILES/Ecore.profile.uml#_z1OFcHjqEdy8S4Cr8Rc_NA"/>
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/AllViewsDerivedLayer.java b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/AllViewsDerivedLayer.java
new file mode 100644
index 00000000000..5e6f20c115e
--- /dev/null
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/AllViewsDerivedLayer.java
@@ -0,0 +1,17 @@
+/**
+ */
+package org.eclipse.papyrus.layers.stackmodel.layers;
+
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>All Views Derived Layer</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ *
+ * @see org.eclipse.papyrus.layers.stackmodel.layers.LayersPackage#getAllViewsDerivedLayer()
+ * @model
+ * @generated
+ */
+public interface AllViewsDerivedLayer extends AbstractLayer {
+} // AllViewsDerivedLayer
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/LayersFactory.java b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/LayersFactory.java
index a8fff3d2b5e..38c7748c4fe 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/LayersFactory.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/LayersFactory.java
@@ -248,6 +248,15 @@ public interface LayersFactory extends EFactory {
IsAbstractUmlSetter createIsAbstractUmlSetter();
/**
+ * Returns a new object of class '<em>All Views Derived Layer</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>All Views Derived Layer</em>'.
+ * @generated
+ */
+ AllViewsDerivedLayer createAllViewsDerivedLayer();
+
+ /**
* Returns a new object of class '<em>Layer Descriptor</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/LayersPackage.java b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/LayersPackage.java
index 3d2e11fc560..116205a39d7 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/LayersPackage.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/LayersPackage.java
@@ -5395,6 +5395,223 @@ public interface LayersPackage extends EPackage {
int IS_ABSTRACT_UML_SETTER_OPERATION_COUNT = PROPERTY_SETTER_OPERATION_COUNT + 0;
/**
+ * The meta object id for the '{@link org.eclipse.papyrus.layers.stackmodel.layers.impl.AllViewsDerivedLayerImpl <em>All Views Derived Layer</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.papyrus.layers.stackmodel.layers.impl.AllViewsDerivedLayerImpl
+ * @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getAllViewsDerivedLayer()
+ * @generated
+ */
+ int ALL_VIEWS_DERIVED_LAYER = 67;
+
+ /**
+ * The feature id for the '<em><b>Application</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ALL_VIEWS_DERIVED_LAYER__APPLICATION = ABSTRACT_LAYER__APPLICATION;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ALL_VIEWS_DERIVED_LAYER__NAME = ABSTRACT_LAYER__NAME;
+
+ /**
+ * The feature id for the '<em><b>Description</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ALL_VIEWS_DERIVED_LAYER__DESCRIPTION = ABSTRACT_LAYER__DESCRIPTION;
+
+ /**
+ * The feature id for the '<em><b>Is Layer Enabled Internal</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ALL_VIEWS_DERIVED_LAYER__IS_LAYER_ENABLED_INTERNAL = ABSTRACT_LAYER__IS_LAYER_ENABLED_INTERNAL;
+
+ /**
+ * The feature id for the '<em><b>Is Layer Enabled</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ALL_VIEWS_DERIVED_LAYER__IS_LAYER_ENABLED = ABSTRACT_LAYER__IS_LAYER_ENABLED;
+
+ /**
+ * The feature id for the '<em><b>Is Branch Enabled</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ALL_VIEWS_DERIVED_LAYER__IS_BRANCH_ENABLED = ABSTRACT_LAYER__IS_BRANCH_ENABLED;
+
+ /**
+ * The feature id for the '<em><b>Owning Layers Stack</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ALL_VIEWS_DERIVED_LAYER__OWNING_LAYERS_STACK = ABSTRACT_LAYER__OWNING_LAYERS_STACK;
+
+ /**
+ * The feature id for the '<em><b>Property Values</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ALL_VIEWS_DERIVED_LAYER__PROPERTY_VALUES = ABSTRACT_LAYER__PROPERTY_VALUES;
+
+ /**
+ * The feature id for the '<em><b>Property Value Map</b></em>' map.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ALL_VIEWS_DERIVED_LAYER__PROPERTY_VALUE_MAP = ABSTRACT_LAYER__PROPERTY_VALUE_MAP;
+
+ /**
+ * The feature id for the '<em><b>Layer Descriptor</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ALL_VIEWS_DERIVED_LAYER__LAYER_DESCRIPTOR = ABSTRACT_LAYER__LAYER_DESCRIPTOR;
+
+ /**
+ * The feature id for the '<em><b>Views</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ALL_VIEWS_DERIVED_LAYER__VIEWS = ABSTRACT_LAYER__VIEWS;
+
+ /**
+ * The feature id for the '<em><b>Attached Properties</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ALL_VIEWS_DERIVED_LAYER__ATTACHED_PROPERTIES = ABSTRACT_LAYER__ATTACHED_PROPERTIES;
+
+ /**
+ * The number of structural features of the '<em>All Views Derived Layer</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ALL_VIEWS_DERIVED_LAYER_FEATURE_COUNT = ABSTRACT_LAYER_FEATURE_COUNT + 0;
+
+ /**
+ * The operation id for the '<em>Get Compute Property Value Command</em>' operation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ALL_VIEWS_DERIVED_LAYER___GET_COMPUTE_PROPERTY_VALUE_COMMAND__VIEW_PROPERTY = ABSTRACT_LAYER___GET_COMPUTE_PROPERTY_VALUE_COMMAND__VIEW_PROPERTY;
+
+ /**
+ * The operation id for the '<em>Get Views Compute Property Value Command</em>' operation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ALL_VIEWS_DERIVED_LAYER___GET_VIEWS_COMPUTE_PROPERTY_VALUE_COMMAND__ELIST_PROPERTY = ABSTRACT_LAYER___GET_VIEWS_COMPUTE_PROPERTY_VALUE_COMMAND__ELIST_PROPERTY;
+
+ /**
+ * The operation id for the '<em>Get Properties Compute Property Value Command</em>' operation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ALL_VIEWS_DERIVED_LAYER___GET_PROPERTIES_COMPUTE_PROPERTY_VALUE_COMMAND__VIEW_ELIST = ABSTRACT_LAYER___GET_PROPERTIES_COMPUTE_PROPERTY_VALUE_COMMAND__VIEW_ELIST;
+
+ /**
+ * The operation id for the '<em>Init Layer</em>' operation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ALL_VIEWS_DERIVED_LAYER___INIT_LAYER__LAYERSSTACK = ABSTRACT_LAYER___INIT_LAYER__LAYERSSTACK;
+
+ /**
+ * The operation id for the '<em>Get Layers Stack</em>' operation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ALL_VIEWS_DERIVED_LAYER___GET_LAYERS_STACK = ABSTRACT_LAYER___GET_LAYERS_STACK;
+
+ /**
+ * The operation id for the '<em>Add Property Instance</em>' operation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ALL_VIEWS_DERIVED_LAYER___ADD_PROPERTY_INSTANCE__PROPERTY = ABSTRACT_LAYER___ADD_PROPERTY_INSTANCE__PROPERTY;
+
+ /**
+ * The operation id for the '<em>Remove Property Instance</em>' operation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ALL_VIEWS_DERIVED_LAYER___REMOVE_PROPERTY_INSTANCE__PROPERTY = ABSTRACT_LAYER___REMOVE_PROPERTY_INSTANCE__PROPERTY;
+
+ /**
+ * The operation id for the '<em>Get Property Instance</em>' operation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ALL_VIEWS_DERIVED_LAYER___GET_PROPERTY_INSTANCE__PROPERTY = ABSTRACT_LAYER___GET_PROPERTY_INSTANCE__PROPERTY;
+
+ /**
+ * The operation id for the '<em>Get Property Instance</em>' operation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ALL_VIEWS_DERIVED_LAYER___GET_PROPERTY_INSTANCE__STRING = ABSTRACT_LAYER___GET_PROPERTY_INSTANCE__STRING;
+
+ /**
+ * The number of operations of the '<em>All Views Derived Layer</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ALL_VIEWS_DERIVED_LAYER_OPERATION_COUNT = ABSTRACT_LAYER_OPERATION_COUNT + 0;
+
+ /**
* The meta object id for the '{@link org.eclipse.papyrus.layers.stackmodel.layers.EventLevel <em>Event Level</em>}' enum.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -5402,7 +5619,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getEventLevel()
* @generated
*/
- int EVENT_LEVEL = 67;
+ int EVENT_LEVEL = 68;
/**
* The meta object id for the '<em>String</em>' data type.
@@ -5412,7 +5629,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getString()
* @generated
*/
- int STRING = 68;
+ int STRING = 69;
/**
* The meta object id for the '<em>boolean</em>' data type.
@@ -5421,7 +5638,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getboolean()
* @generated
*/
- int BOOLEAN = 69;
+ int BOOLEAN = 70;
/**
* The meta object id for the '<em>EPackage</em>' data type.
@@ -5431,7 +5648,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getEPackage()
* @generated
*/
- int EPACKAGE = 70;
+ int EPACKAGE = 71;
/**
* The meta object id for the '<em>Not Found Exception</em>' data type.
@@ -5441,7 +5658,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getNotFoundException()
* @generated
*/
- int NOT_FOUND_EXCEPTION = 74;
+ int NOT_FOUND_EXCEPTION = 75;
/**
* The meta object id for the '<em>Compute Property Value Command</em>' data type.
@@ -5451,7 +5668,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getComputePropertyValueCommand()
* @generated
*/
- int COMPUTE_PROPERTY_VALUE_COMMAND = 75;
+ int COMPUTE_PROPERTY_VALUE_COMMAND = 76;
/**
* The meta object id for the '<em>Exception</em>' data type.
@@ -5461,7 +5678,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getLayersException()
* @generated
*/
- int LAYERS_EXCEPTION = 71;
+ int LAYERS_EXCEPTION = 72;
/**
* The meta object id for the '<em>int</em>' data type.
@@ -5470,7 +5687,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getint()
* @generated
*/
- int INT = 72;
+ int INT = 73;
/**
@@ -5481,7 +5698,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getObject()
* @generated
*/
- int OBJECT = 76;
+ int OBJECT = 77;
/**
@@ -5492,7 +5709,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getCustomPropertyOpertorInstance()
* @generated
*/
- int CUSTOM_PROPERTY_OPERTOR_INSTANCE = 77;
+ int CUSTOM_PROPERTY_OPERTOR_INSTANCE = 78;
/**
* The meta object id for the '<em>Bad State Exception</em>' data type.
@@ -5502,7 +5719,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getBadStateException()
* @generated
*/
- int BAD_STATE_EXCEPTION = 73;
+ int BAD_STATE_EXCEPTION = 74;
/**
@@ -6077,6 +6294,16 @@ public interface LayersPackage extends EPackage {
EClass getIsAbstractUmlSetter();
/**
+ * Returns the meta object for class '{@link org.eclipse.papyrus.layers.stackmodel.layers.AllViewsDerivedLayer <em>All Views Derived Layer</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>All Views Derived Layer</em>'.
+ * @see org.eclipse.papyrus.layers.stackmodel.layers.AllViewsDerivedLayer
+ * @generated
+ */
+ EClass getAllViewsDerivedLayer();
+
+ /**
* Returns the meta object for enum '{@link org.eclipse.papyrus.layers.stackmodel.layers.EventLevel <em>Event Level</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -8383,6 +8610,16 @@ public interface LayersPackage extends EPackage {
EClass IS_ABSTRACT_UML_SETTER = eINSTANCE.getIsAbstractUmlSetter();
/**
+ * The meta object literal for the '{@link org.eclipse.papyrus.layers.stackmodel.layers.impl.AllViewsDerivedLayerImpl <em>All Views Derived Layer</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.papyrus.layers.stackmodel.layers.impl.AllViewsDerivedLayerImpl
+ * @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getAllViewsDerivedLayer()
+ * @generated
+ */
+ EClass ALL_VIEWS_DERIVED_LAYER = eINSTANCE.getAllViewsDerivedLayer();
+
+ /**
* The meta object literal for the '{@link org.eclipse.papyrus.layers.stackmodel.layers.EventLevel <em>Event Level</em>}' enum.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/AbstractLayerImpl.java b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/AbstractLayerImpl.java
index 8d0aeabe6ab..143361eddcd 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/AbstractLayerImpl.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/AbstractLayerImpl.java
@@ -16,7 +16,6 @@ import java.lang.reflect.InvocationTargetException;
import java.util.Collection;
import java.util.List;
import java.util.Map.Entry;
-
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
@@ -26,7 +25,6 @@ import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.EMap;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.EcorePackage;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.util.EObjectResolvingEList;
@@ -39,16 +37,11 @@ import org.eclipse.papyrus.layers.stackmodel.NotFoundException;
import org.eclipse.papyrus.layers.stackmodel.command.ComputePropertyValueCommand;
import org.eclipse.papyrus.layers.stackmodel.layers.AbstractLayer;
import org.eclipse.papyrus.layers.stackmodel.layers.LayerDescriptor;
-import org.eclipse.papyrus.layers.stackmodel.layers.LayerExpression;
-import org.eclipse.papyrus.layers.stackmodel.layers.LayerOperator;
import org.eclipse.papyrus.layers.stackmodel.layers.LayersPackage;
-import org.eclipse.papyrus.layers.stackmodel.layers.LayersStack;
import org.eclipse.papyrus.layers.stackmodel.layers.LayersStackApplication;
import org.eclipse.papyrus.layers.stackmodel.layers.NullInstance;
import org.eclipse.papyrus.layers.stackmodel.layers.Property;
-import org.eclipse.papyrus.layers.stackmodel.layers.RegExpLayer;
import org.eclipse.papyrus.layers.stackmodel.layers.TypeInstance;
-import org.eclipse.papyrus.layers.stackmodel.layers.util.ECoreUtils;
/**
* <!-- begin-user-doc -->
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/AllViewsDerivedLayerImpl.java b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/AllViewsDerivedLayerImpl.java
new file mode 100644
index 00000000000..906d9ee477d
--- /dev/null
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/AllViewsDerivedLayerImpl.java
@@ -0,0 +1,66 @@
+/**
+ */
+package org.eclipse.papyrus.layers.stackmodel.layers.impl;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.papyrus.layers.stackmodel.layers.AllViewsDerivedLayer;
+import org.eclipse.papyrus.layers.stackmodel.layers.LayersPackage;
+import org.eclipse.papyrus.layers.stackmodel.layers.LayersStack;
+import org.eclipse.papyrus.layers.stackmodel.util.DiagramViewToListSynchronizer;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>All Views Derived Layer</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * </p>
+ *
+ * @generated
+ */
+public class AllViewsDerivedLayerImpl extends AbstractLayerImpl implements AllViewsDerivedLayer {
+
+ /**
+ * Object used to synchronize a list with the diagram's views.
+ *
+ */
+ protected DiagramViewToListSynchronizer viewsListSynchronizer;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ protected AllViewsDerivedLayerImpl() {
+ super();
+ // init the synchronizer
+ viewsListSynchronizer = new DiagramViewToListSynchronizer(getViews());
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return LayersPackage.Literals.ALL_VIEWS_DERIVED_LAYER;
+ }
+
+ /**
+ * This layer has just been added to a LayerStack.
+ * Set the root of the expression.
+ * Set the views to match the result of the expression.
+ *
+ * @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayerExpressionImpl#initLayer(org.eclipse.papyrus.layers.stackmodel.layers.LayersStack)
+ *
+ * @param owningLayersStack
+ */
+ @Override
+ public void initLayer(LayersStack owningLayersStack) {
+ super.initLayer(owningLayersStack);
+
+ System.err.println(this.getClass().getSimpleName() + ".initLayer(" + owningLayersStack + ")");
+ // Set the diagram associated to this tree of layers
+ viewsListSynchronizer.setDiagram(owningLayersStack.getDiagram());
+ }
+} //AllViewsDerivedLayerImpl
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/LayerOperatorImpl.java b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/LayerOperatorImpl.java
index 93ae2abac7a..2d3843469a7 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/LayerOperatorImpl.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/LayerOperatorImpl.java
@@ -13,19 +13,16 @@
package org.eclipse.papyrus.layers.stackmodel.layers.impl;
import java.util.Collection;
-
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.papyrus.layers.stackmodel.NotFoundException;
import org.eclipse.papyrus.layers.stackmodel.layers.LayerExpression;
import org.eclipse.papyrus.layers.stackmodel.layers.LayerOperator;
import org.eclipse.papyrus.layers.stackmodel.layers.LayersPackage;
import org.eclipse.papyrus.layers.stackmodel.layers.LayersStack;
-import org.eclipse.papyrus.layers.stackmodel.layers.util.ECoreUtils;
/**
* <!-- begin-user-doc -->
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/LayersFactoryImpl.java b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/LayersFactoryImpl.java
index f65d7ba5f91..a29bd77c671 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/LayersFactoryImpl.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/LayersFactoryImpl.java
@@ -132,6 +132,7 @@ public class LayersFactoryImpl extends EFactoryImpl implements LayersFactory {
case LayersPackage.AND_STACKED_LAYER_OPERATOR_DESCRIPTOR: return createAndStackedLayerOperatorDescriptor();
case LayersPackage.OR_STACKED_LAYER_OPERATOR_DESCRIPTOR: return createOrStackedLayerOperatorDescriptor();
case LayersPackage.IS_ABSTRACT_UML_SETTER: return createIsAbstractUmlSetter();
+ case LayersPackage.ALL_VIEWS_DERIVED_LAYER: return createAllViewsDerivedLayer();
default:
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
}
@@ -782,6 +783,16 @@ public class LayersFactoryImpl extends EFactoryImpl implements LayersFactory {
* <!-- end-user-doc -->
* @generated
*/
+ public AllViewsDerivedLayer createAllViewsDerivedLayer() {
+ AllViewsDerivedLayerImpl allViewsDerivedLayer = new AllViewsDerivedLayerImpl();
+ return allViewsDerivedLayer;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public EventLevel createEventLevelFromString(EDataType eDataType, String initialValue) {
EventLevel result = EventLevel.get(initialValue);
if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/LayersPackageImpl.java b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/LayersPackageImpl.java
index 31d132a399a..6236b206fa3 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/LayersPackageImpl.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/LayersPackageImpl.java
@@ -28,6 +28,7 @@ import org.eclipse.papyrus.layers.stackmodel.NotFoundException;
import org.eclipse.papyrus.layers.stackmodel.command.ComputePropertyValueCommand;
import org.eclipse.papyrus.layers.stackmodel.layers.AbstractLayer;
import org.eclipse.papyrus.layers.stackmodel.layers.AbstractLayerOperator;
+import org.eclipse.papyrus.layers.stackmodel.layers.AllViewsDerivedLayer;
import org.eclipse.papyrus.layers.stackmodel.layers.AndStackedLayerOperatorDescriptor;
import org.eclipse.papyrus.layers.stackmodel.layers.ApplicationDependantElement;
import org.eclipse.papyrus.layers.stackmodel.layers.BooleanInstance;
@@ -574,6 +575,13 @@ public class LayersPackageImpl extends EPackageImpl implements LayersPackage {
* <!-- end-user-doc -->
* @generated
*/
+ private EClass allViewsDerivedLayerEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
private EEnum eventLevelEEnum = null;
/**
@@ -2641,6 +2649,15 @@ public class LayersPackageImpl extends EPackageImpl implements LayersPackage {
* <!-- end-user-doc -->
* @generated
*/
+ public EClass getAllViewsDerivedLayer() {
+ return allViewsDerivedLayerEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public EEnum getEventLevel() {
return eventLevelEEnum;
}
@@ -3044,6 +3061,8 @@ public class LayersPackageImpl extends EPackageImpl implements LayersPackage {
isAbstractUmlSetterEClass = createEClass(IS_ABSTRACT_UML_SETTER);
+ allViewsDerivedLayerEClass = createEClass(ALL_VIEWS_DERIVED_LAYER);
+
// Create enums
eventLevelEEnum = createEEnum(EVENT_LEVEL);
@@ -3138,6 +3157,7 @@ public class LayersPackageImpl extends EPackageImpl implements LayersPackage {
andStackedLayerOperatorDescriptorEClass.getESuperTypes().add(this.getStackedLayerOperatorDescriptor());
orStackedLayerOperatorDescriptorEClass.getESuperTypes().add(this.getStackedLayerOperatorDescriptor());
isAbstractUmlSetterEClass.getESuperTypes().add(this.getPropertySetter());
+ allViewsDerivedLayerEClass.getESuperTypes().add(this.getAbstractLayer());
// Initialize classes, features, and operations; add parameters
initEClass(layerNamedStyleEClass, LayerNamedStyle.class, "LayerNamedStyle", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
@@ -3554,6 +3574,8 @@ public class LayersPackageImpl extends EPackageImpl implements LayersPackage {
initEClass(isAbstractUmlSetterEClass, IsAbstractUmlSetter.class, "IsAbstractUmlSetter", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEClass(allViewsDerivedLayerEClass, AllViewsDerivedLayer.class, "AllViewsDerivedLayer", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+
// Initialize enums and add enum literals
initEEnum(eventLevelEEnum, EventLevel.class, "EventLevel");
addEEnumLiteral(eventLevelEEnum, EventLevel.LEVEL1);
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/LayersStackImpl.java b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/LayersStackImpl.java
index e5dcf98361c..36708046e88 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/LayersStackImpl.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/LayersStackImpl.java
@@ -144,7 +144,7 @@ MinimalEObjectImpl.Container implements LayersStack {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @generated
+ * @generated NOT
*/
protected LayersStackImpl() {
super();
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/util/LayersAdapterFactory.java b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/util/LayersAdapterFactory.java
index adb03695af3..6b45e9d7014 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/util/LayersAdapterFactory.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/util/LayersAdapterFactory.java
@@ -351,6 +351,10 @@ public class LayersAdapterFactory extends AdapterFactoryImpl {
return createIsAbstractUmlSetterAdapter();
}
@Override
+ public Adapter caseAllViewsDerivedLayer(AllViewsDerivedLayer object) {
+ return createAllViewsDerivedLayerAdapter();
+ }
+ @Override
public Adapter caseStyle(Style object) {
return createStyleAdapter();
}
@@ -715,6 +719,20 @@ public class LayersAdapterFactory extends AdapterFactoryImpl {
}
/**
+ * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.layers.stackmodel.layers.AllViewsDerivedLayer <em>All Views Derived Layer</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.papyrus.layers.stackmodel.layers.AllViewsDerivedLayer
+ * @generated
+ */
+ public Adapter createAllViewsDerivedLayerAdapter() {
+ return null;
+ }
+
+ /**
* Creates a new adapter for an object of class '{@link org.eclipse.papyrus.layers.stackmodel.layers.TypeInstance <em>Type Instance</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/util/LayersSwitch.java b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/util/LayersSwitch.java
index 5fa87750bd9..86aeafe7a77 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/util/LayersSwitch.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/util/LayersSwitch.java
@@ -565,6 +565,15 @@ public class LayersSwitch<T> extends Switch<T> {
if (result == null) result = defaultCase(theEObject);
return result;
}
+ case LayersPackage.ALL_VIEWS_DERIVED_LAYER: {
+ AllViewsDerivedLayer allViewsDerivedLayer = (AllViewsDerivedLayer)theEObject;
+ T result = caseAllViewsDerivedLayer(allViewsDerivedLayer);
+ if (result == null) result = caseAbstractLayer(allViewsDerivedLayer);
+ if (result == null) result = caseLayerExpression(allViewsDerivedLayer);
+ if (result == null) result = caseApplicationDependantElement(allViewsDerivedLayer);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
default: return defaultCase(theEObject);
}
}
@@ -930,6 +939,21 @@ public class LayersSwitch<T> extends Switch<T> {
}
/**
+ * Returns the result of interpreting the object as an instance of '<em>All Views Derived Layer</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>All Views Derived Layer</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseAllViewsDerivedLayer(AllViewsDerivedLayer object) {
+ return null;
+ }
+
+ /**
* Returns the result of interpreting the object as an instance of '<em>Type Instance</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/notifier/DiagramViewChangedEventNotifier.java b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/notifier/DiagramViewChangedEventNotifier.java
index 2cce3ba7105..54c0d11456c 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/notifier/DiagramViewChangedEventNotifier.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/notifier/DiagramViewChangedEventNotifier.java
@@ -56,6 +56,7 @@ public class DiagramViewChangedEventNotifier extends EContentAdapter {
super.notifyChanged(notification);
// We are only interested in views (from newValue if set, or oldValue if removed)
+ // TODO Use an appropriate filter / Predicate to filter views.
Object newValue = notification.getNewValue();
if( ! (newValue instanceof View || notification.getOldValue() instanceof View ) ) {
return;
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/notifier/LayersTreeEventNotifier.java b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/notifier/LayersTreeEventNotifier.java
index 023fc0ae1a4..44356efa3de 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/notifier/LayersTreeEventNotifier.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/notifier/LayersTreeEventNotifier.java
@@ -70,7 +70,8 @@ public class LayersTreeEventNotifier extends EContentAdapter {
*/
@Override
public void notifyChanged(Notification notification) {
- System.err.println( this.getClass().getSimpleName() + ".event received " + notification.getFeature());
+ System.err.println( this.getClass().getSimpleName() + ".notifyChanged( "
+ + notification.getFeature() + ")");
// Self atttach
super.notifyChanged(notification);
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/util/DiagramViewToListSynchronizer.java b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/util/DiagramViewToListSynchronizer.java
new file mode 100644
index 00000000000..52280d6b38b
--- /dev/null
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/util/DiagramViewToListSynchronizer.java
@@ -0,0 +1,121 @@
+/*****************************************************************************
+ * Copyright (c) 2013 Cedric Dumoulin.
+ *
+ *
+ * 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:
+ * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.layers.stackmodel.util;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.layers.stackmodel.notifier.DiagramViewChangedEventNotifier;
+import org.eclipse.papyrus.layers.stackmodel.notifier.DiagramViewChangedEventNotifierFactory;
+import org.eclipse.papyrus.layers.stackmodel.notifier.IDiagramViewEventListener;
+
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
+
+/**
+ * This class allows to synchronize a specfied list with {@link View} elements from the specified
+ * {@link Diagram}.
+ *
+ * @author cedric dumoulin
+ *
+ */
+public class DiagramViewToListSynchronizer {
+
+ protected Diagram diagram;
+
+ protected Collection<View> synchronizedList;
+
+ /**
+ * Listener on Diagram's View event.
+ * Synchronize the associated list according to the event.
+ */
+ private IDiagramViewEventListener viewEventListener = new IDiagramViewEventListener() {
+
+ @Override
+ public void diagramViewRemoved(Notification msg) {
+ // Add the removed view from the list
+ synchronizedList.remove((View)msg.getOldValue());
+
+ }
+
+ @Override
+ public void diagramViewAdded(Notification msg) {
+
+ View view = (View)msg.getNewValue();
+ if( synchronizedList.contains(view)) {
+ return;
+ }
+ // add element
+ synchronizedList.add(view);
+ }
+ };
+
+ /**
+ * Constructor.
+ *
+ * @param diagram
+ * @param synchronizedList
+ */
+ public DiagramViewToListSynchronizer(Diagram diagram, Collection<View> synchronizedList) {
+ this.synchronizedList = synchronizedList;
+
+ // Listen to diagram's view event
+ setDiagram(diagram);
+ }
+
+ /**
+ * The diagram should be set later.
+ * Constructor.
+ *
+ * @param synchronizedList
+ */
+ public DiagramViewToListSynchronizer(Collection<View> synchronizedList) {
+ this.synchronizedList = synchronizedList;
+ }
+
+ /**
+ * Set the diagram synchronized to the list.
+ * @param diagram
+ */
+ public void setDiagram(Diagram diagram) {
+
+ DiagramViewChangedEventNotifier notifier;
+ // stop listening on old diagram if any
+ Diagram oldDiagram = this.diagram;
+ if( oldDiagram != null) {
+ notifier = DiagramViewChangedEventNotifierFactory.instance.adapt(oldDiagram);
+ notifier.removeEventListener(viewEventListener);
+ }
+ // Reset the list and add view responding to the predicate
+ synchronizedList.clear();
+
+ Iterable<View> filteredList = Iterables.filter(diagram.getChildren(), LayerDiagramViewPredicate.instance);
+ for( View view : filteredList ) {
+ synchronizedList.add(view);
+ }
+
+ // attach to new diagram
+ this.diagram = diagram;
+ if( diagram != null) {
+ notifier = DiagramViewChangedEventNotifierFactory.instance.adapt(diagram);
+ notifier.addEventListener(viewEventListener);
+ }
+
+ }
+}
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/util/LayerDiagramViewPredicate.java b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/util/LayerDiagramViewPredicate.java
new file mode 100644
index 00000000000..acc94b4160d
--- /dev/null
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/util/LayerDiagramViewPredicate.java
@@ -0,0 +1,64 @@
+/*****************************************************************************
+ * Copyright (c) 2013 Cedric Dumoulin.
+ *
+ *
+ * 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:
+ * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.layers.stackmodel.util;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.Shape;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.layers.stackmodel.layers.Layer;
+import org.eclipse.uml2.uml.NamedElement;
+
+import com.google.common.base.Predicate;
+
+/**
+ * A Predicate used to filter {@link View} allowed by {@link Layer}.
+ *
+ * @author cedric dumoulin
+ *
+ */
+public class LayerDiagramViewPredicate implements Predicate<View> {
+
+ /**
+ * Singleton instnace.
+ */
+ public static final LayerDiagramViewPredicate instance = new LayerDiagramViewPredicate();
+
+ /**
+ * Return true if the view is allowed by Layers.
+ *
+ * @see com.google.common.base.Predicate#apply(java.lang.Object)
+ *
+ * @param view
+ * @return
+ */
+ @Override
+ public boolean apply(View view) {
+
+ // View should be Shape or Edge
+ if( ! (view instanceof Shape || view instanceof Edge ) ) {
+ return false;
+ }
+
+ // Domain element should be set and should be NamedElement
+ EObject ele = view.getElement();
+ if( ele == null || !(ele instanceof NamedElement) ) {
+ return false;
+ }
+ // ok
+ return true;
+ }
+
+}
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/test/org/eclipse/papyrus/layers/stackmodel/util/DiagramViewToListSynchronizerTest.java b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/test/org/eclipse/papyrus/layers/stackmodel/util/DiagramViewToListSynchronizerTest.java
new file mode 100644
index 00000000000..27e473cd936
--- /dev/null
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/test/org/eclipse/papyrus/layers/stackmodel/util/DiagramViewToListSynchronizerTest.java
@@ -0,0 +1,173 @@
+/*****************************************************************************
+ * Copyright (c) 2013 Cedric Dumoulin.
+ *
+ *
+ * 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:
+ * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.layers.stackmodel.util;
+
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.Shape;
+import org.eclipse.gmf.runtime.notation.View;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.eclipse.uml2.uml.Class;
+
+import com.google.common.collect.Lists;
+
+/**
+ *
+ *
+ * @author cedric dumoulin
+ *
+ */
+public class DiagramViewToListSynchronizerTest {
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @Before
+ public void setUp() throws Exception {
+ }
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @After
+ public void tearDown() throws Exception {
+ }
+
+ /**
+ * Test method for {@link org.eclipse.papyrus.layers.stackmodel.util.DiagramViewToListSynchronizer#DiagramViewToListSynchronizer(org.eclipse.gmf.runtime.notation.Diagram, java.util.Collection)}.
+ */
+ @Test
+ public void testDiagramViewToListSynchronizer() {
+
+ // Create variables
+ NotationAndUmlModelsFactory factory = new NotationAndUmlModelsFactory();
+ Diagram diagram1 =factory.newDiagram();
+
+ List<View> list = new ArrayList<View>();
+
+ //
+ DiagramViewToListSynchronizer listSynchronizer = new DiagramViewToListSynchronizer(diagram1, list);
+
+ // assert
+ assertNotNull("object created", listSynchronizer);
+ }
+
+ /**
+ * Test method for {@link org.eclipse.papyrus.layers.stackmodel.util.DiagramViewToListSynchronizer#setDiagram(org.eclipse.gmf.runtime.notation.Diagram)}.
+ */
+ @Test
+ public void testSetDiagram() {
+ // Create variables
+ NotationAndUmlModelsFactory factory = new NotationAndUmlModelsFactory();
+ Diagram diagram1 =factory.newDiagram();
+ Class C1 = factory.newClass(diagram1, "C1");
+ View shape1 = factory.lookupViewFor(diagram1, C1);
+ Class C2 = factory.newClass(diagram1, "C2");
+ View shape2 = factory.lookupViewFor(diagram1, C2);
+ Class C3 = factory.newClass(diagram1, "C3");
+ View shape3 = factory.lookupViewFor(diagram1, C3);
+
+ List<View> expectedViews1 = Lists.newArrayList(shape1, shape2, shape3);
+
+ // Check if the list is set on init
+ List<View> list = new ArrayList<View>();
+ DiagramViewToListSynchronizer listSynchronizer = new DiagramViewToListSynchronizer(diagram1, list);
+ int expectedSize = 3;
+ // Assert
+ assertEquals("list size", expectedSize, list.size());
+ assertTrue("list correctly set", list.containsAll(expectedViews1) );
+
+
+ // Now, change the diagram
+ Diagram diagram2 =factory.newDiagram();
+ Class C21 = factory.newClass(diagram2, "C1");
+ View shape21 = factory.lookupViewFor(diagram2, C21);
+ Class C22 = factory.newClass(diagram2, "C2");
+ View shape22 = factory.lookupViewFor(diagram2, C22);
+ Class C23 = factory.newClass(diagram2, "C3");
+ View shape23 = factory.lookupViewFor(diagram2, C23);
+ List<View> expectedViews2 = Lists.newArrayList(shape21, shape22, shape23);
+ int expectedSize2 = 3;
+
+
+ // Action
+ listSynchronizer.setDiagram(diagram2);
+ // Assert
+ assertEquals("list size", expectedSize2, list.size());
+ assertTrue("list correctly set", list.containsAll(expectedViews2) );
+ }
+
+ /**
+ * Test list sync
+ */
+ @Test
+ public void testSyncWhenViewIsAdded() {
+
+ // Create variables
+ NotationAndUmlModelsFactory factory = new NotationAndUmlModelsFactory();
+ Diagram diagram1 =factory.newDiagram();
+
+ int expectedSize = 1;
+ List<View> list = new ArrayList<View>();
+ DiagramViewToListSynchronizer listSynchronizer = new DiagramViewToListSynchronizer(diagram1, list);
+ // Action
+ Class C1 = factory.newClass(diagram1, "C1");
+ View shape1 = factory.lookupViewFor(diagram1, C1);
+
+ // assert
+ assertEquals("listSize", expectedSize, list.size());
+ assertTrue("list contain expected view", list.contains(shape1));
+ }
+
+ /**
+ * Test list sync
+ */
+ @Test
+ public void testSyncWhenViewIsRemoved() {
+
+ // Create variables
+ NotationAndUmlModelsFactory factory = new NotationAndUmlModelsFactory();
+ Diagram diagram1 =factory.newDiagram();
+
+ int expectedSize = 3;
+ List<View> list = new ArrayList<View>();
+ DiagramViewToListSynchronizer listSynchronizer = new DiagramViewToListSynchronizer(diagram1, list);
+
+ Class C1 = factory.newClass(diagram1, "C1");
+ View shape1 = factory.lookupViewFor(diagram1, C1);
+ Class C2 = factory.newClass(diagram1, "C2");
+ View shape2 = factory.lookupViewFor(diagram1, C2);
+ Class C3 = factory.newClass(diagram1, "C3");
+ View shape3 = factory.lookupViewFor(diagram1, C3);
+
+ // assert before
+ assertEquals("listSize", expectedSize, list.size());
+ assertTrue("list contain expected view", list.contains(shape2));
+
+ // Action
+ factory.remove(diagram1, C2);
+ // assert
+ assertEquals("listSize", expectedSize-1, list.size());
+ assertFalse("list contain expected view", list.contains(shape2));
+ }
+
+
+}

Back to the top