Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCedric Dumoulin2014-01-14 15:51:04 +0000
committerCedric Dumoulin2014-01-27 13:57:30 +0000
commita9914446441791781af4df7efc379ba4f6093b01 (patch)
treebaaf0b7215d493f1fae522c580eb09c4ada72cae /extraplugins/layers/org.eclipse.papyrus.layers.stackmodel
parentcc1c7778e1d15ff8f88b74d0e1e3a0d17c042596 (diff)
downloadorg.eclipse.papyrus-a9914446441791781af4df7efc379ba4f6093b01.tar.gz
org.eclipse.papyrus-a9914446441791781af4df7efc379ba4f6093b01.tar.xz
org.eclipse.papyrus-a9914446441791781af4df7efc379ba4f6093b01.zip
BUG 330199 - Add LayersFactoryForStack
Diffstat (limited to 'extraplugins/layers/org.eclipse.papyrus.layers.stackmodel')
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/model/layers.ecore12
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/model/layers.genmodel5
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/model/layers.notation65
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/model/layers.uml15
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/LayerOperator.java2
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/LayersContainer.java31
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/LayersFactoryForStack.java109
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/LayersPackage.java271
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/LayersStack.java4
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/LayerOperatorImpl.java42
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/LayersFactoryForStackImpl.java205
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/LayersPackageImpl.java38
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/LayersStackImpl.java16
-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.java27
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/test/org/eclipse/papyrus/layers/stackmodel/integration/LayersStateAfterReloadTest.java387
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/test/org/eclipse/papyrus/layers/stackmodel/layers/impl/LayerExpressionInitWithApplicationImplTest.java8
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/test/org/eclipse/papyrus/layers/stackmodel/layers/impl/LayersFactoryForStackImplWithApplicationTest.java384
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/test/org/eclipse/papyrus/layers/stackmodel/layers/util/LayersFactoryForStackTestUtils.java173
19 files changed, 1727 insertions, 85 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 e6f5952988a..c68bcef0ddf 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/model/layers.ecore
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/model/layers.ecore
@@ -8,7 +8,7 @@
<eStructuralFeatures xsi:type="ecore:EReference" name="layersStack" ordered="false"
upperBound="-1" eType="#//LayersStack" containment="true"/>
</eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="LayersStack">
+ <eClassifiers xsi:type="ecore:EClass" name="LayersStack" eSuperTypes="#//LayersContainer">
<eOperations name="getComputePropertyValueCommand" ordered="false" lowerBound="1"
eType="#//ComputePropertyValueCommand" eExceptions="#//LayersException">
<eParameters name="view" ordered="false" lowerBound="1" eType="ecore:EClass ../../org.eclipse.gmf.runtime.notation/model/notation.ecore#//View"/>
@@ -385,10 +385,18 @@
<eStructuralFeatures xsi:type="ecore:EAttribute" name="layerOperatorDescriptorName"
ordered="false" lowerBound="1" eType="#//String"/>
</eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="LayerOperator" abstract="true" eSuperTypes="#//LayerExpression">
+ <eClassifiers xsi:type="ecore:EClass" name="LayerOperator" abstract="true" eSuperTypes="#//LayerExpression #//LayersContainer">
<eStructuralFeatures xsi:type="ecore:EReference" name="layers" upperBound="-1"
eType="#//LayerExpression" containment="true"/>
</eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="LayersContainer" abstract="true" interface="true">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="Layers implementing this interface can contains others layers.&#xD;&#xA;The interface provide one method allowing to add a LayerExpression to the container."/>
+ </eAnnotations>
+ <eOperations name="addLayer" ordered="false" lowerBound="1">
+ <eParameters name="layer" ordered="false" lowerBound="1" eType="#//LayerExpression"/>
+ </eOperations>
+ </eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="DefaultPropertyOperator" eSuperTypes="#//PropertyOperator"/>
<eClassifiers xsi:type="ecore:EEnum" name="LayerState">
<eLiterals name="detached"/>
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 1fcbb2aaabb..7e4485a10d6 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/model/layers.genmodel
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/model/layers.genmodel
@@ -315,6 +315,11 @@
<genFeatures xsi:type="genmodel:GenFeature" property="None" children="true"
createChild="true" ecoreFeature="ecore:EReference layers.ecore#//LayerOperator/layers"/>
</genClasses>
+ <genClasses xsi:type="genmodel:GenClass" image="false" ecoreClass="layers.ecore#//LayersContainer">
+ <genOperations xsi:type="genmodel:GenOperation" ecoreOperation="layers.ecore#//LayersContainer/addLayer">
+ <genParameters xsi:type="genmodel:GenParameter" ecoreParameter="layers.ecore#//LayersContainer/addLayer/layer"/>
+ </genOperations>
+ </genClasses>
<genClasses xsi:type="genmodel:GenClass" ecoreClass="layers.ecore#//DefaultPropertyOperator"/>
<genClasses xsi:type="genmodel:GenClass" image="false" ecoreClass="layers.ecore#//AbstractLayer">
<genFeatures xsi:type="genmodel:GenFeature" notify="false" createChild="false"
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 6a5038b50e4..6fd99c95c60 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/model/layers.notation
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/model/layers.notation
@@ -1444,6 +1444,45 @@
<element xmi:type="uml:Class" href="layers.uml#_ft-hUGtpEeOlpfB_tZS-QA"/>
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_ft-hUmtpEeOlpfB_tZS-QA" x="732" y="822"/>
</children>
+ <children xmi:type="notation:Shape" xmi:id="_RopgYXpGEeOlpfB_tZS-QA" type="2004" fontName="Segoe UI" lineColor="0">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_RopgY3pGEeOlpfB_tZS-QA" source="ShadowFigure">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_RopgZHpGEeOlpfB_tZS-QA" key="ShadowFigure_Value" value="false"/>
+ </eAnnotations>
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_RopgZXpGEeOlpfB_tZS-QA" source="displayNameLabelIcon">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_RopgZnpGEeOlpfB_tZS-QA" key="displayNameLabelIcon_value" value="false"/>
+ </eAnnotations>
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_RopgZ3pGEeOlpfB_tZS-QA" source="QualifiedName">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_RopgaHpGEeOlpfB_tZS-QA" key="QualifiedNameDepth" value="1000"/>
+ </eAnnotations>
+ <children xmi:type="notation:DecorationNode" xmi:id="_RopgaXpGEeOlpfB_tZS-QA" type="5011"/>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_RopganpGEeOlpfB_tZS-QA" type="7006">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_Ropga3pGEeOlpfB_tZS-QA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_RopgbHpGEeOlpfB_tZS-QA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_RopgbXpGEeOlpfB_tZS-QA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_RopgbnpGEeOlpfB_tZS-QA"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_Ropgb3pGEeOlpfB_tZS-QA" type="7007">
+ <children xmi:type="notation:Shape" xmi:id="_jHtYQXpGEeOlpfB_tZS-QA" type="3007" fontName="Segoe UI" lineColor="0">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_u3kRoHpGEeOlpfB_tZS-QA" source="CustomAppearance_Annotation">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_vhh0oHpGEeOlpfB_tZS-QA" key="CustomAppearance_MaskValue" value="4872"/>
+ </eAnnotations>
+ <element xmi:type="uml:Operation" href="layers.uml#_jHtYQHpGEeOlpfB_tZS-QA"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_jHtYQnpGEeOlpfB_tZS-QA"/>
+ </children>
+ <styles xmi:type="notation:TitleStyle" xmi:id="_RopgcHpGEeOlpfB_tZS-QA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_RopgcXpGEeOlpfB_tZS-QA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_RopgcnpGEeOlpfB_tZS-QA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Ropgc3pGEeOlpfB_tZS-QA"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_RopgdHpGEeOlpfB_tZS-QA" type="7008">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_RopgdXpGEeOlpfB_tZS-QA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_RopgdnpGEeOlpfB_tZS-QA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_Ropgd3pGEeOlpfB_tZS-QA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_RopgeHpGEeOlpfB_tZS-QA"/>
+ </children>
+ <element xmi:type="uml:Interface" href="layers.uml#_RopgYHpGEeOlpfB_tZS-QA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_RopgYnpGEeOlpfB_tZS-QA" x="78" y="342" width="175" height="109"/>
+ </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">
@@ -1696,6 +1735,32 @@
<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>
+ <edges xmi:type="notation:Connector" xmi:id="_0R3XIHpGEeOlpfB_tZS-QA" type="4003" source="_Hoi98NjjEeKQqZMBCFd2Uw" target="_RopgYXpGEeOlpfB_tZS-QA" lineColor="0">
+ <children xmi:type="notation:DecorationNode" xmi:id="_0R3XI3pGEeOlpfB_tZS-QA" type="6008">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_0R3XJHpGEeOlpfB_tZS-QA" y="40"/>
+ </children>
+ <children xmi:type="notation:DecorationNode" xmi:id="_0R3XJXpGEeOlpfB_tZS-QA" type="6009">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_0R3XJnpGEeOlpfB_tZS-QA" y="60"/>
+ </children>
+ <styles xmi:type="notation:FontStyle" xmi:id="_0R3XIXpGEeOlpfB_tZS-QA" fontName="Segoe UI"/>
+ <element xmi:type="uml:InterfaceRealization" href="layers.uml#_0RxQgHpGEeOlpfB_tZS-QA"/>
+ <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_0R3XInpGEeOlpfB_tZS-QA" points="[-14, -9, 116, 0]$[-121, -10, 9, -1]"/>
+ <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_0SDkYHpGEeOlpfB_tZS-QA" id="(0.12173913043478261,0.4)"/>
+ <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_0SDkYXpGEeOlpfB_tZS-QA" id="(0.9485714285714286,0.44954128440366975)"/>
+ </edges>
+ <edges xmi:type="notation:Connector" xmi:id="_2bq8QHpGEeOlpfB_tZS-QA" type="4003" source="_zpKewNa7EeKPiuTfpuvqHA" target="_RopgYXpGEeOlpfB_tZS-QA" lineColor="0">
+ <children xmi:type="notation:DecorationNode" xmi:id="_2bq8Q3pGEeOlpfB_tZS-QA" type="6008">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_2bq8RHpGEeOlpfB_tZS-QA" y="40"/>
+ </children>
+ <children xmi:type="notation:DecorationNode" xmi:id="_2bq8RXpGEeOlpfB_tZS-QA" type="6009">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_2bq8RnpGEeOlpfB_tZS-QA" y="60"/>
+ </children>
+ <styles xmi:type="notation:FontStyle" xmi:id="_2bq8QXpGEeOlpfB_tZS-QA" fontName="Segoe UI"/>
+ <element xmi:type="uml:InterfaceRealization" href="layers.uml#_2bk1oHpGEeOlpfB_tZS-QA"/>
+ <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_2bq8QnpGEeOlpfB_tZS-QA" points="[-1, 3, 0, -103]$[-1, 104, 0, -2]"/>
+ <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_2bxC4HpGEeOlpfB_tZS-QA" id="(0.2603305785123967,0.9774436090225563)"/>
+ <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_2bxC4XpGEeOlpfB_tZS-QA" id="(0.5942857142857143,0.01834862385321101)"/>
+ </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 97a0944861e..a9e55846162 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/model/layers.uml
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/model/layers.uml
@@ -26,7 +26,7 @@ the initialisation can differ if the LayersStack is created by the user or by EM
<upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_iiUlMtqCEeKQqZMBCFd2Uw" value="1"/>
</ownedAttribute>
</packagedElement>
- <packagedElement xmi:type="uml:Class" xmi:id="_gT0asNa7EeKPiuTfpuvqHA" name="LayersStack">
+ <packagedElement xmi:type="uml:Class" xmi:id="_gT0asNa7EeKPiuTfpuvqHA" clientDependency="_2bk1oHpGEeOlpfB_tZS-QA" name="LayersStack">
<ownedAttribute xmi:type="uml:Property" xmi:id="_cHaqsNbGEeKPiuTfpuvqHA" name="layers" type="_9IaAANjiEeKQqZMBCFd2Uw" aggregation="composite" association="_cHkbsNbGEeKPiuTfpuvqHA">
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_cHaqsdbGEeKPiuTfpuvqHA"/>
<upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_cHaqstbGEeKPiuTfpuvqHA" value="1"/>
@@ -55,6 +55,7 @@ the initialisation can differ if the LayersStack is created by the user or by EM
<upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_c5OEgnl8EeOlpfB_tZS-QA" value="1"/>
<defaultValue xmi:type="uml:LiteralString" xmi:id="_c5OEg3l8EeOlpfB_tZS-QA" name="detached" value="detached"/>
</ownedAttribute>
+ <interfaceRealization xmi:type="uml:InterfaceRealization" xmi:id="_2bk1oHpGEeOlpfB_tZS-QA" name="InterfaceRealization1" client="_gT0asNa7EeKPiuTfpuvqHA" supplier="_RopgYHpGEeOlpfB_tZS-QA" contract="_RopgYHpGEeOlpfB_tZS-QA"/>
<ownedOperation xmi:type="uml:Operation" xmi:id="_8H1xgO70EeK0p4PkXjd-_Q" name="getComputePropertyValueCommand" raisedException="_iYKFMNxGEeKwptaAAanMDg">
<ownedComment xmi:type="uml:Comment" xmi:id="_8H1xge70EeK0p4PkXjd-_Q">
<body>Get the ComputePropertyValueCommands for the specified views and Property.&#xD;
@@ -698,12 +699,13 @@ Associated behavior are stopped.</body>
</ownedComment>
</ownedOperation>
</packagedElement>
- <packagedElement xmi:type="uml:Class" xmi:id="_HoKjcNjjEeKQqZMBCFd2Uw" name="LayerOperator" isAbstract="true">
+ <packagedElement xmi:type="uml:Class" xmi:id="_HoKjcNjjEeKQqZMBCFd2Uw" clientDependency="_0RxQgHpGEeOlpfB_tZS-QA" name="LayerOperator" isAbstract="true">
<generalization xmi:type="uml:Generalization" xmi:id="_OJCPcNjjEeKQqZMBCFd2Uw" general="_9IaAANjiEeKQqZMBCFd2Uw"/>
<ownedAttribute xmi:type="uml:Property" xmi:id="_emyegNjnEeKQqZMBCFd2Uw" name="layers" type="_9IaAANjiEeKQqZMBCFd2Uw" isOrdered="true" aggregation="composite" association="_em-rwNjnEeKQqZMBCFd2Uw">
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_emyegdjnEeKQqZMBCFd2Uw"/>
<upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_emyegtjnEeKQqZMBCFd2Uw" value="*"/>
</ownedAttribute>
+ <interfaceRealization xmi:type="uml:InterfaceRealization" xmi:id="_0RxQgHpGEeOlpfB_tZS-QA" name="InterfaceRealization1" client="_HoKjcNjjEeKQqZMBCFd2Uw" supplier="_RopgYHpGEeOlpfB_tZS-QA" contract="_RopgYHpGEeOlpfB_tZS-QA"/>
</packagedElement>
<packagedElement xmi:type="uml:Class" xmi:id="_WuVRUNjjEeKQqZMBCFd2Uw" name="AbstractLayerOperator" isAbstract="true">
<generalization xmi:type="uml:Generalization" xmi:id="_0lwNANjjEeKQqZMBCFd2Uw" general="_HoKjcNjjEeKQqZMBCFd2Uw"/>
@@ -1498,6 +1500,15 @@ layerStackChanged().</body>
<ownedLiteral xmi:type="uml:EnumerationLiteral" xmi:id="_AKMcoHluEeOlpfB_tZS-QA" name="detached"/>
<ownedLiteral xmi:type="uml:EnumerationLiteral" xmi:id="_BUS4QHluEeOlpfB_tZS-QA" name="attached"/>
</packagedElement>
+ <packagedElement xmi:type="uml:Interface" xmi:id="_RopgYHpGEeOlpfB_tZS-QA" name="LayersContainer">
+ <ownedComment xmi:type="uml:Comment" xmi:id="_igIa4HpGEeOlpfB_tZS-QA" annotatedElement="_RopgYHpGEeOlpfB_tZS-QA">
+ <body>Layers implementing this interface can contains others layers.&#xD;
+The interface provide one method allowing to add a LayerExpression to the container.</body>
+ </ownedComment>
+ <ownedOperation xmi:type="uml:Operation" xmi:id="_jHtYQHpGEeOlpfB_tZS-QA" name="addLayer">
+ <ownedParameter xmi:type="uml:Parameter" xmi:id="_qpEQ4HpGEeOlpfB_tZS-QA" name="layer" type="_9IaAANjiEeKQqZMBCFd2Uw"/>
+ </ownedOperation>
+ </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/LayerOperator.java b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/LayerOperator.java
index 1c9c867af19..6595bbe8c6a 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/LayerOperator.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/LayerOperator.java
@@ -31,7 +31,7 @@ import org.eclipse.emf.common.util.EList;
* @model abstract="true"
* @generated
*/
-public interface LayerOperator extends LayerExpression {
+public interface LayerOperator extends LayerExpression, LayersContainer {
/**
* Returns the value of the '<em><b>Layers</b></em>' containment reference list.
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/LayersContainer.java b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/LayersContainer.java
new file mode 100644
index 00000000000..53166a533e5
--- /dev/null
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/LayersContainer.java
@@ -0,0 +1,31 @@
+/**
+ */
+package org.eclipse.papyrus.layers.stackmodel.layers;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Container</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <!-- begin-model-doc -->
+ * Layers implementing this interface can contains others layers.
+ * The interface provide one method allowing to add a LayerExpression to the container.
+ * <!-- end-model-doc -->
+ *
+ *
+ * @see org.eclipse.papyrus.layers.stackmodel.layers.LayersPackage#getLayersContainer()
+ * @model interface="true" abstract="true"
+ * @generated
+ */
+public interface LayersContainer extends EObject {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @model layerRequired="true" layerOrdered="false"
+ * @generated
+ */
+ void addLayer(LayerExpression layer);
+
+} // LayersContainer
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/LayersFactoryForStack.java b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/LayersFactoryForStack.java
new file mode 100644
index 00000000000..c80b1e3eed2
--- /dev/null
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/LayersFactoryForStack.java
@@ -0,0 +1,109 @@
+/*******************************************************************************
+ * 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:
+ * Cedric Dumoulin - cedric.dumoulin@lifl.fr
+ ******************************************************************************/
+/**
+ */
+package org.eclipse.papyrus.layers.stackmodel.layers;
+
+import org.eclipse.emf.ecore.EFactory;
+import org.eclipse.papyrus.layers.stackmodel.LayersException;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Factory</b> for the model.
+ * It provides a create method for each non-abstract class of the model.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.papyrus.layers.stackmodel.layers.LayersPackage
+ * @generated
+ */
+public interface LayersFactoryForStack {
+ /**
+ * The singleton instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ LayersFactoryForStack eINSTANCE = org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersFactoryForStackImpl.init();
+
+ /**
+ * Returns a new object of class '<em>Stack</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Stack</em>'.
+ * @generated
+ */
+ LayersStack createLayersStack();
+
+ /**
+ * Returns a new object of class '<em>Layer</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Layer</em>'.
+ * @generated NOT
+ */
+ public Layer createLayer(LayersContainer parent, LayersStack owningStack, LayersStackApplication application)
+ throws LayersException;
+
+
+ /**
+ * Returns a new object of class '<em>Reg Exp Layer</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Reg Exp Layer</em>'.
+ * @throws LayersException
+ * @generated
+ */
+ public RegExpLayer createRegExpLayer(LayersContainer parent, LayersStack owningStack, LayersStackApplication application) throws LayersException;
+
+ /**
+ * Returns a new object of class '<em>Top Layer Operator</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Top Layer Operator</em>'.
+ * @generated
+ */
+ public TopLayerOperator createTopLayerOperator(LayersContainer parent, LayersStack owningStack, LayersStackApplication application) throws LayersException;
+
+ /**
+ * Returns a new object of class '<em>Stacked Layer Operator</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Stacked Layer Operator</em>'.
+ * @generated
+ */
+ public StackedLayerOperator createStackedLayerOperator(LayersContainer parent, LayersStack owningStack, LayersStackApplication application) throws LayersException;
+
+ /**
+ * Standard initialization of a newly created layer.
+ *
+ * @param layer
+ * @param parentLayer
+ * @param owningStack
+ * @param application
+ * @return
+ * @throws LayersException
+ */
+ public LayerExpression initLayer(LayerExpression layer, LayersContainer parentLayer, LayersStack owningStack, LayersStackApplication application) throws LayersException;
+
+ /**
+ * Create a LayerOperator by its ID.
+ * IDs are those used when the LayerOperator is registered in application'registry.
+ *
+ * @param layerOperatorID
+ * @param parent
+ * @param owningStack
+ * @param application
+ * @return
+ * @throws LayersException
+ */
+ public AbstractLayerOperator createLayerOperator(String layerOperatorID, LayersContainer parent, LayersStack owningStack, LayersStackApplication application) throws LayersException;
+
+
+} //LayersFactory
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 a36aa51364c..30578b62bb2 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
@@ -124,6 +124,43 @@ public interface LayersPackage extends EPackage {
int LAYER_NAMED_STYLE_OPERATION_COUNT = /*NotationPackage.NAMED_STYLE_OPERATION_COUNT +*/ 0;
/**
+ * The meta object id for the '{@link org.eclipse.papyrus.layers.stackmodel.layers.LayersContainer <em>Container</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.papyrus.layers.stackmodel.layers.LayersContainer
+ * @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getLayersContainer()
+ * @generated
+ */
+ int LAYERS_CONTAINER = 26;
+
+ /**
+ * The number of structural features of the '<em>Container</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int LAYERS_CONTAINER_FEATURE_COUNT = 0;
+
+ /**
+ * The operation id for the '<em>Add Layer</em>' operation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int LAYERS_CONTAINER___ADD_LAYER__LAYEREXPRESSION = 0;
+
+ /**
+ * The number of operations of the '<em>Container</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int LAYERS_CONTAINER_OPERATION_COUNT = 1;
+
+ /**
* The meta object id for the '{@link org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersStackImpl <em>Stack</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -151,7 +188,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getLayer()
* @generated
*/
- int LAYER = 46;
+ int LAYER = 47;
/**
* The meta object id for the '{@link org.eclipse.papyrus.layers.stackmodel.layers.impl.TypeInstanceImpl <em>Type Instance</em>}' class.
@@ -171,7 +208,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getStringToTypeInstanceMap()
* @generated
*/
- int STRING_TO_TYPE_INSTANCE_MAP = 28;
+ int STRING_TO_TYPE_INSTANCE_MAP = 29;
/**
* The meta object id for the '{@link org.eclipse.papyrus.layers.stackmodel.layers.impl.LayerDescriptorImpl <em>Layer Descriptor</em>}' class.
@@ -200,7 +237,7 @@ public interface LayersPackage extends EPackage {
* @generated
* @ordered
*/
- int LAYERS_STACK__LAYERS = 0;
+ int LAYERS_STACK__LAYERS = LAYERS_CONTAINER_FEATURE_COUNT + 0;
/**
* The feature id for the '<em><b>Name</b></em>' attribute.
@@ -209,7 +246,7 @@ public interface LayersPackage extends EPackage {
* @generated
* @ordered
*/
- int LAYERS_STACK__NAME = 1;
+ int LAYERS_STACK__NAME = LAYERS_CONTAINER_FEATURE_COUNT + 1;
/**
* The feature id for the '<em><b>Description</b></em>' attribute.
@@ -218,7 +255,7 @@ public interface LayersPackage extends EPackage {
* @generated
* @ordered
*/
- int LAYERS_STACK__DESCRIPTION = 2;
+ int LAYERS_STACK__DESCRIPTION = LAYERS_CONTAINER_FEATURE_COUNT + 2;
/**
* The feature id for the '<em><b>Diagram</b></em>' reference.
@@ -227,7 +264,7 @@ public interface LayersPackage extends EPackage {
* @generated
* @ordered
*/
- int LAYERS_STACK__DIAGRAM = 3;
+ int LAYERS_STACK__DIAGRAM = LAYERS_CONTAINER_FEATURE_COUNT + 3;
/**
* The feature id for the '<em><b>State</b></em>' attribute.
@@ -236,7 +273,7 @@ public interface LayersPackage extends EPackage {
* @generated
* @ordered
*/
- int LAYERS_STACK__STATE = 4;
+ int LAYERS_STACK__STATE = LAYERS_CONTAINER_FEATURE_COUNT + 4;
/**
* The number of structural features of the '<em>Stack</em>' class.
@@ -245,7 +282,16 @@ public interface LayersPackage extends EPackage {
* @generated
* @ordered
*/
- int LAYERS_STACK_FEATURE_COUNT = 5;
+ int LAYERS_STACK_FEATURE_COUNT = LAYERS_CONTAINER_FEATURE_COUNT + 5;
+
+ /**
+ * The operation id for the '<em>Add Layer</em>' operation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int LAYERS_STACK___ADD_LAYER__LAYEREXPRESSION = LAYERS_CONTAINER___ADD_LAYER__LAYEREXPRESSION;
/**
* The operation id for the '<em>Get Compute Property Value Command</em>' operation.
@@ -254,7 +300,7 @@ public interface LayersPackage extends EPackage {
* @generated
* @ordered
*/
- int LAYERS_STACK___GET_COMPUTE_PROPERTY_VALUE_COMMAND__VIEW_PROPERTY = 0;
+ int LAYERS_STACK___GET_COMPUTE_PROPERTY_VALUE_COMMAND__VIEW_PROPERTY = LAYERS_CONTAINER_OPERATION_COUNT + 0;
/**
* The operation id for the '<em>Get Properties Compute Property Value Command</em>' operation.
@@ -263,7 +309,7 @@ public interface LayersPackage extends EPackage {
* @generated
* @ordered
*/
- int LAYERS_STACK___GET_PROPERTIES_COMPUTE_PROPERTY_VALUE_COMMAND__VIEW_ELIST = 1;
+ int LAYERS_STACK___GET_PROPERTIES_COMPUTE_PROPERTY_VALUE_COMMAND__VIEW_ELIST = LAYERS_CONTAINER_OPERATION_COUNT + 1;
/**
* The operation id for the '<em>Get Views Compute Property Value Command</em>' operation.
@@ -272,7 +318,7 @@ public interface LayersPackage extends EPackage {
* @generated
* @ordered
*/
- int LAYERS_STACK___GET_VIEWS_COMPUTE_PROPERTY_VALUE_COMMAND__ELIST_PROPERTY = 2;
+ int LAYERS_STACK___GET_VIEWS_COMPUTE_PROPERTY_VALUE_COMMAND__ELIST_PROPERTY = LAYERS_CONTAINER_OPERATION_COUNT + 2;
/**
* The operation id for the '<em>Start After Creation</em>' operation.
@@ -281,7 +327,7 @@ public interface LayersPackage extends EPackage {
* @generated
* @ordered
*/
- int LAYERS_STACK___START_AFTER_CREATION = 3;
+ int LAYERS_STACK___START_AFTER_CREATION = LAYERS_CONTAINER_OPERATION_COUNT + 3;
/**
* The operation id for the '<em>Attach Layers</em>' operation.
@@ -290,7 +336,7 @@ public interface LayersPackage extends EPackage {
* @generated
* @ordered
*/
- int LAYERS_STACK___ATTACH_LAYERS = 4;
+ int LAYERS_STACK___ATTACH_LAYERS = LAYERS_CONTAINER_OPERATION_COUNT + 4;
/**
* The operation id for the '<em>Attach</em>' operation.
@@ -299,7 +345,7 @@ public interface LayersPackage extends EPackage {
* @generated
* @ordered
*/
- int LAYERS_STACK___ATTACH = 5;
+ int LAYERS_STACK___ATTACH = LAYERS_CONTAINER_OPERATION_COUNT + 5;
/**
* The operation id for the '<em>Detach</em>' operation.
@@ -308,7 +354,7 @@ public interface LayersPackage extends EPackage {
* @generated
* @ordered
*/
- int LAYERS_STACK___DETACH = 6;
+ int LAYERS_STACK___DETACH = LAYERS_CONTAINER_OPERATION_COUNT + 6;
/**
* The operation id for the '<em>Enter Attached State</em>' operation.
@@ -317,7 +363,7 @@ public interface LayersPackage extends EPackage {
* @generated
* @ordered
*/
- int LAYERS_STACK___ENTER_ATTACHED_STATE = 7;
+ int LAYERS_STACK___ENTER_ATTACHED_STATE = LAYERS_CONTAINER_OPERATION_COUNT + 7;
/**
* The operation id for the '<em>Exit Attached State</em>' operation.
@@ -326,7 +372,7 @@ public interface LayersPackage extends EPackage {
* @generated
* @ordered
*/
- int LAYERS_STACK___EXIT_ATTACHED_STATE = 8;
+ int LAYERS_STACK___EXIT_ATTACHED_STATE = LAYERS_CONTAINER_OPERATION_COUNT + 8;
/**
* The number of operations of the '<em>Stack</em>' class.
@@ -335,7 +381,7 @@ public interface LayersPackage extends EPackage {
* @generated
* @ordered
*/
- int LAYERS_STACK_OPERATION_COUNT = 9;
+ int LAYERS_STACK_OPERATION_COUNT = LAYERS_CONTAINER_OPERATION_COUNT + 9;
/**
* The meta object id for the '{@link org.eclipse.papyrus.layers.stackmodel.layers.impl.ApplicationDependantElementImpl <em>Application Dependant Element</em>}' class.
@@ -611,7 +657,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getFolder()
* @generated
*/
- int FOLDER = 29;
+ int FOLDER = 30;
/**
* The meta object id for the '{@link org.eclipse.papyrus.layers.stackmodel.layers.impl.IntInstanceImpl <em>Int Instance</em>}' class.
@@ -621,7 +667,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getIntInstance()
* @generated
*/
- int INT_INSTANCE = 30;
+ int INT_INSTANCE = 31;
/**
* The meta object id for the '{@link org.eclipse.papyrus.layers.stackmodel.layers.impl.BooleanInstanceImpl <em>Boolean Instance</em>}' class.
@@ -631,7 +677,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getBooleanInstance()
* @generated
*/
- int BOOLEAN_INSTANCE = 31;
+ int BOOLEAN_INSTANCE = 32;
/**
* The meta object id for the '{@link org.eclipse.papyrus.layers.stackmodel.layers.impl.StringInstanceImpl <em>String Instance</em>}' class.
@@ -641,7 +687,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getStringInstance()
* @generated
*/
- int STRING_INSTANCE = 32;
+ int STRING_INSTANCE = 33;
/**
* The meta object id for the '{@link org.eclipse.papyrus.layers.stackmodel.layers.impl.IntTypeImpl <em>Int Type</em>}' class.
@@ -651,7 +697,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getIntType()
* @generated
*/
- int INT_TYPE = 33;
+ int INT_TYPE = 34;
/**
* The meta object id for the '{@link org.eclipse.papyrus.layers.stackmodel.layers.impl.BooleanTypeImpl <em>Boolean Type</em>}' class.
@@ -661,7 +707,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getBooleanType()
* @generated
*/
- int BOOLEAN_TYPE = 34;
+ int BOOLEAN_TYPE = 35;
/**
* The meta object id for the '{@link org.eclipse.papyrus.layers.stackmodel.layers.impl.StringTypeImpl <em>String Type</em>}' class.
@@ -671,7 +717,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getStringType()
* @generated
*/
- int STRING_TYPE = 35;
+ int STRING_TYPE = 36;
/**
* The meta object id for the '{@link org.eclipse.papyrus.layers.stackmodel.layers.impl.CustomTypeImpl <em>Custom Type</em>}' class.
@@ -681,7 +727,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getCustomType()
* @generated
*/
- int CUSTOM_TYPE = 36;
+ int CUSTOM_TYPE = 37;
/**
* The meta object id for the '{@link org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersStackApplicationImpl <em>Stack Application</em>}' class.
@@ -1226,7 +1272,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getStringToPropertyIndexMap()
* @generated
*/
- int STRING_TO_PROPERTY_INDEX_MAP = 41;
+ int STRING_TO_PROPERTY_INDEX_MAP = 42;
/**
* The meta object id for the '{@link org.eclipse.papyrus.layers.stackmodel.layers.impl.PropertyIndexImpl <em>Property Index</em>}' class.
@@ -1236,7 +1282,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getPropertyIndex()
* @generated
*/
- int PROPERTY_INDEX = 40;
+ int PROPERTY_INDEX = 41;
/**
* The meta object id for the '{@link org.eclipse.papyrus.layers.stackmodel.layers.impl.TypeRegistryImpl <em>Type Registry</em>}' class.
@@ -1603,7 +1649,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getAbstractLayer()
* @generated
*/
- int ABSTRACT_LAYER = 27;
+ int ABSTRACT_LAYER = 28;
/**
* The meta object id for the '{@link org.eclipse.papyrus.layers.stackmodel.layers.impl.LayerOperatorImpl <em>Layer Operator</em>}' class.
@@ -1653,7 +1699,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getDefaultPropertyOperator()
* @generated
*/
- int DEFAULT_PROPERTY_OPERATOR = 26;
+ int DEFAULT_PROPERTY_OPERATOR = 27;
/**
* The meta object id for the '{@link org.eclipse.papyrus.layers.stackmodel.layers.impl.TopLayerOperatorImpl <em>Top Layer Operator</em>}' class.
@@ -1663,7 +1709,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getTopLayerOperator()
* @generated
*/
- int TOP_LAYER_OPERATOR = 37;
+ int TOP_LAYER_OPERATOR = 38;
/**
* The meta object id for the '{@link org.eclipse.papyrus.layers.stackmodel.layers.impl.StackedLayerOperatorImpl <em>Stacked Layer Operator</em>}' class.
@@ -1673,7 +1719,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getStackedLayerOperator()
* @generated
*/
- int STACKED_LAYER_OPERATOR = 38;
+ int STACKED_LAYER_OPERATOR = 39;
/**
* The meta object id for the '{@link org.eclipse.papyrus.layers.stackmodel.layers.impl.CustomLayerOperatorImpl <em>Custom Layer Operator</em>}' class.
@@ -1683,7 +1729,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getCustomLayerOperator()
* @generated
*/
- int CUSTOM_LAYER_OPERATOR = 39;
+ int CUSTOM_LAYER_OPERATOR = 40;
/**
* The meta object id for the '{@link org.eclipse.papyrus.layers.stackmodel.layers.impl.SimpleLayerDescriptorImpl <em>Simple Layer Descriptor</em>}' class.
@@ -1693,7 +1739,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getSimpleLayerDescriptor()
* @generated
*/
- int SIMPLE_LAYER_DESCRIPTOR = 42;
+ int SIMPLE_LAYER_DESCRIPTOR = 43;
/**
* The meta object id for the '{@link org.eclipse.papyrus.layers.stackmodel.layers.impl.RegExpLayerDescriptorImpl <em>Reg Exp Layer Descriptor</em>}' class.
@@ -1703,7 +1749,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getRegExpLayerDescriptor()
* @generated
*/
- int REG_EXP_LAYER_DESCRIPTOR = 43;
+ int REG_EXP_LAYER_DESCRIPTOR = 44;
/**
* The meta object id for the '{@link org.eclipse.papyrus.layers.stackmodel.layers.impl.NullInstanceImpl <em>Null Instance</em>}' class.
@@ -1713,7 +1759,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getNullInstance()
* @generated
*/
- int NULL_INSTANCE = 44;
+ int NULL_INSTANCE = 45;
/**
* The meta object id for the '{@link org.eclipse.papyrus.layers.stackmodel.layers.impl.RegExpLayerImpl <em>Reg Exp Layer</em>}' class.
@@ -1723,7 +1769,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getRegExpLayer()
* @generated
*/
- int REG_EXP_LAYER = 45;
+ int REG_EXP_LAYER = 46;
/**
* The meta object id for the '{@link org.eclipse.papyrus.layers.stackmodel.layers.impl.ColorImpl <em>Color</em>}' class.
@@ -1733,7 +1779,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getColor()
* @generated
*/
- int COLOR = 47;
+ int COLOR = 48;
/**
* The meta object id for the '{@link org.eclipse.papyrus.layers.stackmodel.layers.impl.ColorInstanceImpl <em>Color Instance</em>}' class.
@@ -1743,7 +1789,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getColorInstance()
* @generated
*/
- int COLOR_INSTANCE = 48;
+ int COLOR_INSTANCE = 49;
/**
* The meta object id for the '{@link org.eclipse.papyrus.layers.stackmodel.layers.impl.FillInstanceImpl <em>Fill Instance</em>}' class.
@@ -1753,7 +1799,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getFillInstance()
* @generated
*/
- int FILL_INSTANCE = 49;
+ int FILL_INSTANCE = 50;
/**
* The meta object id for the '{@link org.eclipse.papyrus.layers.stackmodel.layers.impl.FillImpl <em>Fill</em>}' class.
@@ -1763,7 +1809,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getFill()
* @generated
*/
- int FILL = 50;
+ int FILL = 51;
/**
* The meta object id for the '{@link org.eclipse.papyrus.layers.stackmodel.layers.impl.FillPropertySetterImpl <em>Fill Property Setter</em>}' class.
@@ -1773,7 +1819,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getFillPropertySetter()
* @generated
*/
- int FILL_PROPERTY_SETTER = 51;
+ int FILL_PROPERTY_SETTER = 52;
/**
* The meta object id for the '{@link org.eclipse.papyrus.layers.stackmodel.layers.impl.IsValidPropertySetterImpl <em>Is Valid Property Setter</em>}' class.
@@ -1783,7 +1829,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getIsValidPropertySetter()
* @generated
*/
- int IS_VALID_PROPERTY_SETTER = 52;
+ int IS_VALID_PROPERTY_SETTER = 53;
/**
* The meta object id for the '{@link org.eclipse.papyrus.layers.stackmodel.layers.impl.NullPropertySetterImpl <em>Null Property Setter</em>}' class.
@@ -1793,7 +1839,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getNullPropertySetter()
* @generated
*/
- int NULL_PROPERTY_SETTER = 53;
+ int NULL_PROPERTY_SETTER = 54;
/**
* The meta object id for the '{@link org.eclipse.papyrus.layers.stackmodel.layers.impl.LineTypeImpl <em>Line Type</em>}' class.
@@ -1803,7 +1849,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getLineType()
* @generated
*/
- int LINE_TYPE = 54;
+ int LINE_TYPE = 55;
/**
* The meta object id for the '{@link org.eclipse.papyrus.layers.stackmodel.layers.impl.LineInstanceImpl <em>Line Instance</em>}' class.
@@ -1813,7 +1859,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getLineInstance()
* @generated
*/
- int LINE_INSTANCE = 55;
+ int LINE_INSTANCE = 56;
/**
* The meta object id for the '{@link org.eclipse.papyrus.layers.stackmodel.layers.impl.LinePropertySetterImpl <em>Line Property Setter</em>}' class.
@@ -1823,7 +1869,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getLinePropertySetter()
* @generated
*/
- int LINE_PROPERTY_SETTER = 56;
+ int LINE_PROPERTY_SETTER = 57;
/**
* The meta object id for the '{@link org.eclipse.papyrus.layers.stackmodel.layers.impl.FontPropertySetterImpl <em>Font Property Setter</em>}' class.
@@ -1833,7 +1879,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getFontPropertySetter()
* @generated
*/
- int FONT_PROPERTY_SETTER = 57;
+ int FONT_PROPERTY_SETTER = 58;
/**
* The meta object id for the '{@link org.eclipse.papyrus.layers.stackmodel.layers.impl.FontInstanceImpl <em>Font Instance</em>}' class.
@@ -1843,7 +1889,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getFontInstance()
* @generated
*/
- int FONT_INSTANCE = 58;
+ int FONT_INSTANCE = 59;
/**
* The meta object id for the '{@link org.eclipse.papyrus.layers.stackmodel.layers.impl.FontTypeImpl <em>Font Type</em>}' class.
@@ -1853,7 +1899,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getFontType()
* @generated
*/
- int FONT_TYPE = 59;
+ int FONT_TYPE = 60;
/**
* The meta object id for the '{@link org.eclipse.papyrus.layers.stackmodel.layers.impl.IsVisiblePropertySetterImpl <em>Is Visible Property Setter</em>}' class.
@@ -1863,7 +1909,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getIsVisiblePropertySetter()
* @generated
*/
- int IS_VISIBLE_PROPERTY_SETTER = 60;
+ int IS_VISIBLE_PROPERTY_SETTER = 61;
/**
* The meta object id for the '{@link org.eclipse.papyrus.layers.stackmodel.layers.impl.LayerOperatorDescriptorRegistryImpl <em>Layer Operator Descriptor Registry</em>}' class.
@@ -2263,13 +2309,22 @@ public interface LayersPackage extends EPackage {
int LAYER_OPERATOR___EXIT_ATTACHED_STATE = LAYER_EXPRESSION___EXIT_ATTACHED_STATE;
/**
+ * The operation id for the '<em>Add Layer</em>' operation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int LAYER_OPERATOR___ADD_LAYER__LAYEREXPRESSION = LAYER_EXPRESSION_OPERATION_COUNT + 0;
+
+ /**
* The number of operations of the '<em>Layer Operator</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int LAYER_OPERATOR_OPERATION_COUNT = LAYER_EXPRESSION_OPERATION_COUNT + 0;
+ int LAYER_OPERATOR_OPERATION_COUNT = LAYER_EXPRESSION_OPERATION_COUNT + 1;
/**
* The feature id for the '<em><b>Application</b></em>' reference.
@@ -2461,6 +2516,15 @@ public interface LayersPackage extends EPackage {
int ABSTRACT_LAYER_OPERATOR___EXIT_ATTACHED_STATE = LAYER_OPERATOR___EXIT_ATTACHED_STATE;
/**
+ * The operation id for the '<em>Add Layer</em>' operation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ABSTRACT_LAYER_OPERATOR___ADD_LAYER__LAYEREXPRESSION = LAYER_OPERATOR___ADD_LAYER__LAYEREXPRESSION;
+
+ /**
* The operation id for the '<em>Is Descriptor Set</em>' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -3424,6 +3488,15 @@ public interface LayersPackage extends EPackage {
int TOP_LAYER_OPERATOR___EXIT_ATTACHED_STATE = ABSTRACT_LAYER_OPERATOR___EXIT_ATTACHED_STATE;
/**
+ * The operation id for the '<em>Add Layer</em>' operation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int TOP_LAYER_OPERATOR___ADD_LAYER__LAYEREXPRESSION = ABSTRACT_LAYER_OPERATOR___ADD_LAYER__LAYEREXPRESSION;
+
+ /**
* The operation id for the '<em>Is Descriptor Set</em>' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -3640,6 +3713,15 @@ public interface LayersPackage extends EPackage {
int STACKED_LAYER_OPERATOR___EXIT_ATTACHED_STATE = ABSTRACT_LAYER_OPERATOR___EXIT_ATTACHED_STATE;
/**
+ * The operation id for the '<em>Add Layer</em>' operation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int STACKED_LAYER_OPERATOR___ADD_LAYER__LAYEREXPRESSION = ABSTRACT_LAYER_OPERATOR___ADD_LAYER__LAYEREXPRESSION;
+
+ /**
* The operation id for the '<em>Is Descriptor Set</em>' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -3838,6 +3920,15 @@ public interface LayersPackage extends EPackage {
int CUSTOM_LAYER_OPERATOR___EXIT_ATTACHED_STATE = LAYER_OPERATOR___EXIT_ATTACHED_STATE;
/**
+ * The operation id for the '<em>Add Layer</em>' operation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CUSTOM_LAYER_OPERATOR___ADD_LAYER__LAYEREXPRESSION = LAYER_OPERATOR___ADD_LAYER__LAYEREXPRESSION;
+
+ /**
* The number of operations of the '<em>Custom Layer Operator</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -5411,7 +5502,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getTopLayerOperatorDescriptor()
* @generated
*/
- int TOP_LAYER_OPERATOR_DESCRIPTOR = 61;
+ int TOP_LAYER_OPERATOR_DESCRIPTOR = 62;
/**
* The feature id for the '<em><b>Property Operators</b></em>' reference list.
@@ -5493,7 +5584,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getStackedLayerOperatorDescriptor()
* @generated
*/
- int STACKED_LAYER_OPERATOR_DESCRIPTOR = 62;
+ int STACKED_LAYER_OPERATOR_DESCRIPTOR = 63;
/**
* The feature id for the '<em><b>Property Operators</b></em>' reference list.
@@ -5575,7 +5666,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getCustomPropertyOperator()
* @generated
*/
- int CUSTOM_PROPERTY_OPERATOR = 63;
+ int CUSTOM_PROPERTY_OPERATOR = 64;
/**
* The feature id for the '<em><b>Name</b></em>' attribute.
@@ -5657,7 +5748,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getAndStackedLayerOperatorDescriptor()
* @generated
*/
- int AND_STACKED_LAYER_OPERATOR_DESCRIPTOR = 64;
+ int AND_STACKED_LAYER_OPERATOR_DESCRIPTOR = 65;
/**
* The feature id for the '<em><b>Property Operators</b></em>' reference list.
@@ -5739,7 +5830,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getOrStackedLayerOperatorDescriptor()
* @generated
*/
- int OR_STACKED_LAYER_OPERATOR_DESCRIPTOR = 65;
+ int OR_STACKED_LAYER_OPERATOR_DESCRIPTOR = 66;
/**
* The feature id for the '<em><b>Property Operators</b></em>' reference list.
@@ -5821,7 +5912,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getIsAbstractUmlSetter()
* @generated
*/
- int IS_ABSTRACT_UML_SETTER = 66;
+ int IS_ABSTRACT_UML_SETTER = 67;
/**
* The feature id for the '<em><b>Property</b></em>' reference.
@@ -5876,7 +5967,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getAllViewsDerivedLayer()
* @generated
*/
- int ALL_VIEWS_DERIVED_LAYER = 67;
+ int ALL_VIEWS_DERIVED_LAYER = 68;
/**
* The feature id for the '<em><b>Application</b></em>' reference.
@@ -6138,7 +6229,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getLayerState()
* @generated
*/
- int LAYER_STATE = 68;
+ int LAYER_STATE = 69;
/**
* The meta object id for the '{@link org.eclipse.papyrus.layers.stackmodel.layers.EventLevel <em>Event Level</em>}' enum.
@@ -6148,7 +6239,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getEventLevel()
* @generated
*/
- int EVENT_LEVEL = 69;
+ int EVENT_LEVEL = 70;
/**
* The meta object id for the '<em>String</em>' data type.
@@ -6158,7 +6249,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getString()
* @generated
*/
- int STRING = 70;
+ int STRING = 71;
/**
* The meta object id for the '<em>boolean</em>' data type.
@@ -6167,7 +6258,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getboolean()
* @generated
*/
- int BOOLEAN = 71;
+ int BOOLEAN = 72;
/**
* The meta object id for the '<em>EPackage</em>' data type.
@@ -6177,7 +6268,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getEPackage()
* @generated
*/
- int EPACKAGE = 72;
+ int EPACKAGE = 73;
/**
* The meta object id for the '<em>Not Found Exception</em>' data type.
@@ -6187,7 +6278,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getNotFoundException()
* @generated
*/
- int NOT_FOUND_EXCEPTION = 76;
+ int NOT_FOUND_EXCEPTION = 77;
/**
* The meta object id for the '<em>Compute Property Value Command</em>' data type.
@@ -6197,7 +6288,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getComputePropertyValueCommand()
* @generated
*/
- int COMPUTE_PROPERTY_VALUE_COMMAND = 77;
+ int COMPUTE_PROPERTY_VALUE_COMMAND = 78;
/**
* The meta object id for the '<em>Exception</em>' data type.
@@ -6207,7 +6298,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getLayersException()
* @generated
*/
- int LAYERS_EXCEPTION = 73;
+ int LAYERS_EXCEPTION = 74;
/**
* The meta object id for the '<em>int</em>' data type.
@@ -6216,7 +6307,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getint()
* @generated
*/
- int INT = 74;
+ int INT = 75;
/**
@@ -6227,7 +6318,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getObject()
* @generated
*/
- int OBJECT = 78;
+ int OBJECT = 79;
/**
@@ -6238,7 +6329,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getCustomPropertyOpertorInstance()
* @generated
*/
- int CUSTOM_PROPERTY_OPERTOR_INSTANCE = 79;
+ int CUSTOM_PROPERTY_OPERTOR_INSTANCE = 80;
/**
* The meta object id for the '<em>Bad State Exception</em>' data type.
@@ -6248,7 +6339,7 @@ public interface LayersPackage extends EPackage {
* @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getBadStateException()
* @generated
*/
- int BAD_STATE_EXCEPTION = 75;
+ int BAD_STATE_EXCEPTION = 76;
/**
@@ -8455,6 +8546,26 @@ public interface LayersPackage extends EPackage {
EReference getLayerOperator_Layers();
/**
+ * Returns the meta object for class '{@link org.eclipse.papyrus.layers.stackmodel.layers.LayersContainer <em>Container</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Container</em>'.
+ * @see org.eclipse.papyrus.layers.stackmodel.layers.LayersContainer
+ * @generated
+ */
+ EClass getLayersContainer();
+
+ /**
+ * Returns the meta object for the '{@link org.eclipse.papyrus.layers.stackmodel.layers.LayersContainer#addLayer(org.eclipse.papyrus.layers.stackmodel.layers.LayerExpression) <em>Add Layer</em>}' operation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the '<em>Add Layer</em>' operation.
+ * @see org.eclipse.papyrus.layers.stackmodel.layers.LayersContainer#addLayer(org.eclipse.papyrus.layers.stackmodel.layers.LayerExpression)
+ * @generated
+ */
+ EOperation getLayersContainer__AddLayer__LayerExpression();
+
+ /**
* Returns the meta object for class '{@link org.eclipse.papyrus.layers.stackmodel.layers.AbstractLayerOperator <em>Abstract Layer Operator</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -10589,6 +10700,24 @@ public interface LayersPackage extends EPackage {
EReference LAYER_OPERATOR__LAYERS = eINSTANCE.getLayerOperator_Layers();
/**
+ * The meta object literal for the '{@link org.eclipse.papyrus.layers.stackmodel.layers.LayersContainer <em>Container</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.papyrus.layers.stackmodel.layers.LayersContainer
+ * @see org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersPackageImpl#getLayersContainer()
+ * @generated
+ */
+ EClass LAYERS_CONTAINER = eINSTANCE.getLayersContainer();
+
+ /**
+ * The meta object literal for the '<em><b>Add Layer</b></em>' operation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EOperation LAYERS_CONTAINER___ADD_LAYER__LAYEREXPRESSION = eINSTANCE.getLayersContainer__AddLayer__LayerExpression();
+
+ /**
* The meta object literal for the '{@link org.eclipse.papyrus.layers.stackmodel.layers.impl.AbstractLayerOperatorImpl <em>Abstract Layer Operator</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/LayersStack.java b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/LayersStack.java
index 838f89539c2..16c1e39d7e2 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/LayersStack.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/LayersStack.java
@@ -13,9 +13,7 @@
package org.eclipse.papyrus.layers.stackmodel.layers;
import java.util.List;
-
import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.layers.stackmodel.LayersException;
@@ -41,7 +39,7 @@ import org.eclipse.papyrus.layers.stackmodel.command.ComputePropertyValueCommand
* @model
* @generated
*/
-public interface LayersStack extends EObject {
+public interface LayersStack extends LayersContainer {
/**
* Returns the value of the '<em><b>Layers</b></em>' containment reference.
* <!-- begin-user-doc -->
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 d71603697e0..740ec69cb99 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
@@ -12,6 +12,7 @@
*/
package org.eclipse.papyrus.layers.stackmodel.layers.impl;
+import java.lang.reflect.InvocationTargetException;
import java.util.Collection;
import org.eclipse.emf.common.notify.NotificationChain;
@@ -23,6 +24,7 @@ import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.papyrus.layers.stackmodel.LayersException;
import org.eclipse.papyrus.layers.stackmodel.layers.LayerExpression;
import org.eclipse.papyrus.layers.stackmodel.layers.LayerOperator;
+import org.eclipse.papyrus.layers.stackmodel.layers.LayersContainer;
import org.eclipse.papyrus.layers.stackmodel.layers.LayersPackage;
import org.eclipse.papyrus.layers.stackmodel.layers.LayersStack;
@@ -84,6 +86,15 @@ public abstract class LayerOperatorImpl extends LayerExpressionImpl implements L
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void addLayer(LayerExpression layer) {
+ getLayers().add(layer);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
@Override
@@ -156,6 +167,37 @@ public abstract class LayerOperatorImpl extends LayerExpressionImpl implements L
}
/**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public int eDerivedOperationID(int baseOperationID, Class<?> baseClass) {
+ if (baseClass == LayersContainer.class) {
+ switch (baseOperationID) {
+ case LayersPackage.LAYERS_CONTAINER___ADD_LAYER__LAYEREXPRESSION: return LayersPackage.LAYER_OPERATOR___ADD_LAYER__LAYEREXPRESSION;
+ default: return -1;
+ }
+ }
+ return super.eDerivedOperationID(baseOperationID, baseClass);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException {
+ switch (operationID) {
+ case LayersPackage.LAYER_OPERATOR___ADD_LAYER__LAYEREXPRESSION:
+ addLayer((LayerExpression)arguments.get(0));
+ return null;
+ }
+ return super.eInvoke(operationID, arguments);
+ }
+
+ /**
* Get the LayersStack that own directly or indirectly this Layer.
* Throw an exception if no {@link LayersStack} can be found.
* <br>
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/LayersFactoryForStackImpl.java b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/LayersFactoryForStackImpl.java
new file mode 100644
index 00000000000..520e1c317b1
--- /dev/null
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/LayersFactoryForStackImpl.java
@@ -0,0 +1,205 @@
+/*******************************************************************************
+ * 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:
+ * Cedric Dumoulin - cedric.dumoulin@lifl.fr
+ ******************************************************************************/
+/**
+ */
+package org.eclipse.papyrus.layers.stackmodel.layers.impl;
+
+import org.eclipse.papyrus.layers.stackmodel.LayersException;
+import org.eclipse.papyrus.layers.stackmodel.layers.AbstractLayerOperator;
+import org.eclipse.papyrus.layers.stackmodel.layers.Layer;
+import org.eclipse.papyrus.layers.stackmodel.layers.LayerExpression;
+import org.eclipse.papyrus.layers.stackmodel.layers.LayerOperator;
+import org.eclipse.papyrus.layers.stackmodel.layers.LayerOperatorDescriptor;
+import org.eclipse.papyrus.layers.stackmodel.layers.LayersContainer;
+import org.eclipse.papyrus.layers.stackmodel.layers.LayersFactory;
+import org.eclipse.papyrus.layers.stackmodel.layers.LayersFactoryForStack;
+import org.eclipse.papyrus.layers.stackmodel.layers.LayersStack;
+import org.eclipse.papyrus.layers.stackmodel.layers.LayersStackApplication;
+import org.eclipse.papyrus.layers.stackmodel.layers.RegExpLayer;
+import org.eclipse.papyrus.layers.stackmodel.layers.StackedLayerOperator;
+import org.eclipse.papyrus.layers.stackmodel.layers.TopLayerOperator;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Factory</b>.
+ * This factory allows to create Layers dedicated to a Application and {@link LayersStack} <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class LayersFactoryForStackImpl implements LayersFactoryForStack {
+
+ /**
+ * Index used to postfix the layer name.
+ */
+ protected int newIndex = 0;
+
+ final protected String LAYER_NAME_PREFIX = "layer";
+
+ /**
+ * Creates the default factory implementation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public static LayersFactoryForStack init() {
+ return new LayersFactoryForStackImpl();
+ }
+
+ /**
+ * Creates an instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public LayersFactoryForStackImpl() {
+ super();
+ }
+
+ public String findNewLayerName( LayersContainer parent ) {
+
+ String proposedName = LAYER_NAME_PREFIX + newIndex++;
+
+ // Check if the name is available in the targetted container
+ if( parent instanceof LayerOperator ) {
+ LayerOperator parentOperator = (LayerOperator)parent;
+ while( getLayerByName(parentOperator, proposedName) != null ) {
+ proposedName = LAYER_NAME_PREFIX + newIndex++;
+ }
+ }
+ return proposedName;
+ }
+
+ /**
+ * Get a layer by its name.
+ * @param parentOperator The container containing layers
+ * @param name Name of the requested layer.
+ * @return The requested layer, or null.
+ */
+ private LayerExpression getLayerByName(LayerOperator parentOperator, String name) {
+
+
+ for( LayerExpression layer : parentOperator.getLayers() ) {
+ if( name.equals(layer.getName() ) ) {
+ return layer;
+ }
+ }
+ // Not found
+ return null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated NOT
+ */
+ public LayersStack createLayersStack() {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+
+ /**
+ *
+ * @param layer
+ * The layer to init
+ * @param parentLayer
+ * The parent Layer to which layer is added
+ * @param owningStack
+ * The {@link LayersStack} owning the tree of layers
+ * @param application
+ * The application required by layer.
+ *
+ * @return
+ * @throws LayersException
+ */
+ @Override
+ public LayerExpression initLayer(LayerExpression layer, LayersContainer parentLayer, LayersStack owningStack, LayersStackApplication application) throws LayersException {
+ // Init the created layer
+ layer.setApplication(application);
+ layer.setName(findNewLayerName(parentLayer));
+ parentLayer.addLayer(layer);
+ layer.setOwningLayersStack(owningStack);
+ // Start the layer
+ layer.attach();
+
+ return layer;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @throws LayersException
+ * @generated NOT
+ */
+ @Override
+ public Layer createLayer(LayersContainer parent, LayersStack owningStack, LayersStackApplication application) throws LayersException {
+ Layer layer = LayersFactory.eINSTANCE.createLayer();
+ // Init the created layer
+ initLayer(layer, parent, owningStack, application);
+
+ return layer;
+ }
+
+ @Override
+ public RegExpLayer createRegExpLayer(LayersContainer parent, LayersStack owningStack, LayersStackApplication application) throws LayersException {
+ RegExpLayer layer = LayersFactory.eINSTANCE.createRegExpLayer();
+ // Init the created layer
+ initLayer(layer, parent, owningStack, application);
+
+ return layer;
+ }
+
+ @Override
+ public TopLayerOperator createTopLayerOperator(LayersContainer parent, LayersStack owningStack, LayersStackApplication application) throws LayersException {
+ TopLayerOperator layer = LayersFactory.eINSTANCE.createTopLayerOperator();
+ // Init the created layer
+ initLayer(layer, parent, owningStack, application);
+
+ return layer;
+ }
+
+ @Override
+ public StackedLayerOperator createStackedLayerOperator(LayersContainer parent, LayersStack owningStack, LayersStackApplication application) throws LayersException {
+ StackedLayerOperator layer = LayersFactory.eINSTANCE.createStackedLayerOperator();
+ // Init the created layer
+ initLayer(layer, parent, owningStack, application);
+
+ return layer;
+ }
+
+ /**
+ *
+ * @see org.eclipse.papyrus.layers.stackmodel.layers.LayersFactoryForStack#createLayerOperator(java.lang.String, org.eclipse.papyrus.layers.stackmodel.layers.LayersContainer, org.eclipse.papyrus.layers.stackmodel.layers.LayersStack, org.eclipse.papyrus.layers.stackmodel.layers.LayersStackApplication)
+ *
+ * @param layerOperatorID
+ * @param parent
+ * @param owningStack
+ * @param application
+ * @return
+ * @throws LayersException
+ */
+ @Override
+ public AbstractLayerOperator createLayerOperator(String layerOperatorID, LayersContainer parent, LayersStack owningStack, LayersStackApplication application) throws LayersException {
+ // Create a layer !
+ AbstractLayerOperator layerOperator = application.getLayerOperatorDescriptorRegistry().createLayerOperator(layerOperatorID);
+ // Init the created layer
+ initLayer(layerOperator, parent, owningStack, application);
+
+ return layerOperator;
+ }
+
+
+
+
+} //LayersFactoryImpl
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 bb79017254c..d17d5f4b7a3 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
@@ -64,6 +64,7 @@ import org.eclipse.papyrus.layers.stackmodel.layers.LayerOperatorDescriptor;
import org.eclipse.papyrus.layers.stackmodel.layers.LayerOperatorDescriptorRegistry;
import org.eclipse.papyrus.layers.stackmodel.layers.LayerStackDescriptorRegistry;
import org.eclipse.papyrus.layers.stackmodel.layers.LayerState;
+import org.eclipse.papyrus.layers.stackmodel.layers.LayersContainer;
import org.eclipse.papyrus.layers.stackmodel.layers.LayersFactory;
import org.eclipse.papyrus.layers.stackmodel.layers.LayersPackage;
import org.eclipse.papyrus.layers.stackmodel.layers.LayersStack;
@@ -331,6 +332,13 @@ public class LayersPackageImpl extends EPackageImpl implements LayersPackage {
* <!-- end-user-doc -->
* @generated
*/
+ private EClass layersContainerEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
private EClass abstractLayerOperatorEClass = null;
/**
@@ -1964,6 +1972,24 @@ public class LayersPackageImpl extends EPackageImpl implements LayersPackage {
* <!-- end-user-doc -->
* @generated
*/
+ public EClass getLayersContainer() {
+ return layersContainerEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EOperation getLayersContainer__AddLayer__LayerExpression() {
+ return layersContainerEClass.getEOperations().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public EClass getAbstractLayerOperator() {
return abstractLayerOperatorEClass;
}
@@ -3067,6 +3093,9 @@ public class LayersPackageImpl extends EPackageImpl implements LayersPackage {
layerOperatorEClass = createEClass(LAYER_OPERATOR);
createEReference(layerOperatorEClass, LAYER_OPERATOR__LAYERS);
+ layersContainerEClass = createEClass(LAYERS_CONTAINER);
+ createEOperation(layersContainerEClass, LAYERS_CONTAINER___ADD_LAYER__LAYEREXPRESSION);
+
defaultPropertyOperatorEClass = createEClass(DEFAULT_PROPERTY_OPERATOR);
abstractLayerEClass = createEClass(ABSTRACT_LAYER);
@@ -3249,6 +3278,7 @@ public class LayersPackageImpl extends EPackageImpl implements LayersPackage {
// Add supertypes to classes
layerNamedStyleEClass.getESuperTypes().add(theNotationPackage.getNamedStyle());
+ layersStackEClass.getESuperTypes().add(this.getLayersContainer());
layerExpressionEClass.getESuperTypes().add(this.getApplicationDependantElement());
layersStackApplicationEClass.getESuperTypes().add(this.getFolderElement());
propertyEClass.getESuperTypes().add(this.getFolderElement());
@@ -3257,6 +3287,7 @@ public class LayersPackageImpl extends EPackageImpl implements LayersPackage {
typeInstanceEClass.getESuperTypes().add(this.getComputePropertyValueCommandItf());
abstractLayerOperatorEClass.getESuperTypes().add(this.getLayerOperator());
layerOperatorEClass.getESuperTypes().add(this.getLayerExpression());
+ layerOperatorEClass.getESuperTypes().add(this.getLayersContainer());
defaultPropertyOperatorEClass.getESuperTypes().add(this.getPropertyOperator());
abstractLayerEClass.getESuperTypes().add(this.getLayerExpression());
folderEClass.getESuperTypes().add(this.getFolderElement());
@@ -3578,6 +3609,11 @@ public class LayersPackageImpl extends EPackageImpl implements LayersPackage {
initEClass(layerOperatorEClass, LayerOperator.class, "LayerOperator", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getLayerOperator_Layers(), this.getLayerExpression(), null, "layers", null, 0, -1, LayerOperator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEClass(layersContainerEClass, LayersContainer.class, "LayersContainer", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+
+ op = initEOperation(getLayersContainer__AddLayer__LayerExpression(), null, "addLayer", 1, 1, IS_UNIQUE, !IS_ORDERED);
+ addEParameter(op, this.getLayerExpression(), "layer", 1, 1, IS_UNIQUE, !IS_ORDERED);
+
initEClass(defaultPropertyOperatorEClass, DefaultPropertyOperator.class, "DefaultPropertyOperator", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(abstractLayerEClass, AbstractLayer.class, "AbstractLayer", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
@@ -3791,7 +3827,7 @@ public class LayersPackageImpl extends EPackageImpl implements LayersPackage {
source,
new String[] {
"baseType", "LayersException"
- });
+ });
}
} //LayersPackageImpl
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 f11081e2178..38f3a2d1545 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
@@ -343,6 +343,15 @@ MinimalEObjectImpl.Container implements LayersStack {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ * @generated
+ */
+ public void addLayer(LayerExpression layer) {
+ setLayers(layer);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @throws LayersException
* @generated NOT
*/
@@ -466,7 +475,9 @@ MinimalEObjectImpl.Container implements LayersStack {
* @generated
*/
public void exitAttachedState() {
- // do nothing;
+ // TODO: implement this method
+ // Ensure that you remove @generated or mark it @generated NOT
+ throw new UnsupportedOperationException();
}
/**
@@ -622,6 +633,9 @@ MinimalEObjectImpl.Container implements LayersStack {
@SuppressWarnings("unchecked")
public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException {
switch (operationID) {
+ case LayersPackage.LAYERS_STACK___ADD_LAYER__LAYEREXPRESSION:
+ addLayer((LayerExpression)arguments.get(0));
+ return null;
case LayersPackage.LAYERS_STACK___GET_COMPUTE_PROPERTY_VALUE_COMMAND__VIEW_PROPERTY:
try {
return getComputePropertyValueCommand((View)arguments.get(0), (Property)arguments.get(1));
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 6b45e9d7014..c34b79d9acc 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
@@ -187,6 +187,10 @@ public class LayersAdapterFactory extends AdapterFactoryImpl {
return createLayerOperatorAdapter();
}
@Override
+ public Adapter caseLayersContainer(LayersContainer object) {
+ return createLayersContainerAdapter();
+ }
+ @Override
public Adapter caseDefaultPropertyOperator(DefaultPropertyOperator object) {
return createDefaultPropertyOperatorAdapter();
}
@@ -1237,6 +1241,20 @@ public class LayersAdapterFactory extends AdapterFactoryImpl {
}
/**
+ * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.layers.stackmodel.layers.LayersContainer <em>Container</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.LayersContainer
+ * @generated
+ */
+ public Adapter createLayersContainerAdapter() {
+ return null;
+ }
+
+ /**
* Creates a new adapter for an object of class '{@link org.eclipse.papyrus.layers.stackmodel.layers.AbstractLayerOperator <em>Abstract Layer Operator</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 86aeafe7a77..4be600c0ef1 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
@@ -92,6 +92,7 @@ public class LayersSwitch<T> extends Switch<T> {
case LayersPackage.LAYERS_STACK: {
LayersStack layersStack = (LayersStack)theEObject;
T result = caseLayersStack(layersStack);
+ if (result == null) result = caseLayersContainer(layersStack);
if (result == null) result = defaultCase(theEObject);
return result;
}
@@ -238,6 +239,7 @@ public class LayersSwitch<T> extends Switch<T> {
T result = caseAbstractLayerOperator(abstractLayerOperator);
if (result == null) result = caseLayerOperator(abstractLayerOperator);
if (result == null) result = caseLayerExpression(abstractLayerOperator);
+ if (result == null) result = caseLayersContainer(abstractLayerOperator);
if (result == null) result = caseApplicationDependantElement(abstractLayerOperator);
if (result == null) result = defaultCase(theEObject);
return result;
@@ -246,10 +248,17 @@ public class LayersSwitch<T> extends Switch<T> {
LayerOperator layerOperator = (LayerOperator)theEObject;
T result = caseLayerOperator(layerOperator);
if (result == null) result = caseLayerExpression(layerOperator);
+ if (result == null) result = caseLayersContainer(layerOperator);
if (result == null) result = caseApplicationDependantElement(layerOperator);
if (result == null) result = defaultCase(theEObject);
return result;
}
+ case LayersPackage.LAYERS_CONTAINER: {
+ LayersContainer layersContainer = (LayersContainer)theEObject;
+ T result = caseLayersContainer(layersContainer);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
case LayersPackage.DEFAULT_PROPERTY_OPERATOR: {
DefaultPropertyOperator defaultPropertyOperator = (DefaultPropertyOperator)theEObject;
T result = caseDefaultPropertyOperator(defaultPropertyOperator);
@@ -340,6 +349,7 @@ public class LayersSwitch<T> extends Switch<T> {
if (result == null) result = caseAbstractLayerOperator(topLayerOperator);
if (result == null) result = caseLayerOperator(topLayerOperator);
if (result == null) result = caseLayerExpression(topLayerOperator);
+ if (result == null) result = caseLayersContainer(topLayerOperator);
if (result == null) result = caseApplicationDependantElement(topLayerOperator);
if (result == null) result = defaultCase(theEObject);
return result;
@@ -350,6 +360,7 @@ public class LayersSwitch<T> extends Switch<T> {
if (result == null) result = caseAbstractLayerOperator(stackedLayerOperator);
if (result == null) result = caseLayerOperator(stackedLayerOperator);
if (result == null) result = caseLayerExpression(stackedLayerOperator);
+ if (result == null) result = caseLayersContainer(stackedLayerOperator);
if (result == null) result = caseApplicationDependantElement(stackedLayerOperator);
if (result == null) result = defaultCase(theEObject);
return result;
@@ -359,6 +370,7 @@ public class LayersSwitch<T> extends Switch<T> {
T result = caseCustomLayerOperator(customLayerOperator);
if (result == null) result = caseLayerOperator(customLayerOperator);
if (result == null) result = caseLayerExpression(customLayerOperator);
+ if (result == null) result = caseLayersContainer(customLayerOperator);
if (result == null) result = caseApplicationDependantElement(customLayerOperator);
if (result == null) result = defaultCase(theEObject);
return result;
@@ -1494,6 +1506,21 @@ public class LayersSwitch<T> extends Switch<T> {
}
/**
+ * Returns the result of interpreting the object as an instance of '<em>Container</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>Container</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseLayersContainer(LayersContainer object) {
+ return null;
+ }
+
+ /**
* Returns the result of interpreting the object as an instance of '<em>Abstract Layer Operator</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/test/org/eclipse/papyrus/layers/stackmodel/integration/LayersStateAfterReloadTest.java b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/test/org/eclipse/papyrus/layers/stackmodel/integration/LayersStateAfterReloadTest.java
new file mode 100644
index 00000000000..f1089221dd7
--- /dev/null
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/test/org/eclipse/papyrus/layers/stackmodel/integration/LayersStateAfterReloadTest.java
@@ -0,0 +1,387 @@
+/*****************************************************************************
+ * Copyright (c) 2014 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.integration;
+
+import static org.junit.Assert.*;
+
+import java.util.List;
+
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.NotationFactory;
+import org.eclipse.papyrus.layers.stackmodel.LayersException;
+import org.eclipse.papyrus.layers.stackmodel.layers.AbstractLayerOperator;
+import org.eclipse.papyrus.layers.stackmodel.layers.Layer;
+import org.eclipse.papyrus.layers.stackmodel.layers.LayerOperator;
+import org.eclipse.papyrus.layers.stackmodel.layers.LayerOperatorDescriptor;
+import org.eclipse.papyrus.layers.stackmodel.layers.LayerState;
+import org.eclipse.papyrus.layers.stackmodel.layers.LayersFactory;
+import org.eclipse.papyrus.layers.stackmodel.layers.LayersFactoryForStack;
+import org.eclipse.papyrus.layers.stackmodel.layers.LayersStack;
+import org.eclipse.papyrus.layers.stackmodel.layers.LayersStackApplication;
+import org.eclipse.papyrus.layers.stackmodel.layers.RegExpLayer;
+import org.eclipse.papyrus.layers.stackmodel.layers.StackedLayerOperator;
+import org.eclipse.papyrus.layers.stackmodel.layers.TopLayerOperator;
+import org.eclipse.papyrus.layers.stackmodel.layers.util.LayersFactoryTestUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+
+
+/**
+ * Tests checking the states of the layers after a reload of the model.
+ * The state should normally be "ATTACHED".
+ *
+ * @author cedric dumoulin
+ *
+ */
+public class LayersStateAfterReloadTest {
+
+ /**
+ * @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.layers.impl.LayersFactoryForStackImpl#LayersFactoryForStackImpl()}.
+ * @throws LayersException
+ */
+ @Test
+ public void testCreateLayersFactoryForStackImpl() throws LayersException {
+ // Create requested objects
+ LayersStackApplication application = LayersFactory.eINSTANCE.createLayersStackApplication();
+ Diagram diagram = NotationFactory.eINSTANCE.createDiagram();
+ // Create stack
+ LayersStack owningStack = application.getLayersStackFor(diagram);
+
+ LayersFactoryForStack factory = LayersFactoryForStack.eINSTANCE;
+ assertNotNull("factory created", factory);
+
+ // Create tree
+ TopLayerOperator rootLayer = factory.createTopLayerOperator(owningStack, owningStack, application);
+ Layer layer1 = factory.createLayer(rootLayer, owningStack, application);
+ Layer layer2 = factory.createLayer(rootLayer, owningStack, application);
+ TopLayerOperator layerOperator1 = factory.createTopLayerOperator(rootLayer, owningStack, application);
+ Layer layer3 = factory.createLayer(layerOperator1, owningStack, application);
+
+ // asserts
+ assertNotNull("Layer created", rootLayer);
+ assertNotNull("Layer created", layer1);
+ assertNotNull("Layer created", layer2);
+ assertNotNull("Layer created", layerOperator1);
+ assertNotNull("Layer created", layer3);
+
+ }
+
+ /**
+ * Test method for {@link org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersFactoryForStackImpl#findNewLayerName(org.eclipse.papyrus.layers.stackmodel.layers.LayersContainer)}.
+ */
+ @Test
+ public void testFindNewLayerName() {
+
+ LayersFactoryForStackImpl factory = new LayersFactoryForStackImpl();
+ String expectedName1 = factory.LAYER_NAME_PREFIX + "0";
+
+
+ LayerOperator parent = LayersFactory.eINSTANCE.createTopLayerOperator();
+ String name1 = factory.findNewLayerName(parent);
+
+ assertEquals( "expected name", expectedName1, name1);
+ }
+
+ /**
+ * Test method for {@link org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersFactoryForStackImpl#createLayersStack()}.
+ */
+ @Test
+ @Ignore
+ public void testCreateLayersStack() {
+ fail("Not yet implemented");
+ }
+
+ /**
+ * Test method for {@link org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersFactoryForStackImpl#initLayer(org.eclipse.papyrus.layers.stackmodel.layers.LayerExpression, org.eclipse.papyrus.layers.stackmodel.layers.LayersContainer, org.eclipse.papyrus.layers.stackmodel.layers.LayersStack, org.eclipse.papyrus.layers.stackmodel.layers.LayersStackApplication)}.
+ * @throws LayersException
+ */
+ @Test
+ public void testInitLayer() throws LayersException {
+ // Create requested objects
+ LayersStackApplication application = LayersFactory.eINSTANCE.createLayersStackApplication();
+ Diagram diagram = NotationFactory.eINSTANCE.createDiagram();
+ // Create stack
+ LayersStack owningStack = application.getLayersStackFor(diagram);
+
+ LayersFactoryForStack factory = LayersFactoryForStack.eINSTANCE;
+
+ // Create a Tree
+ TopLayerOperator rootLayer = factory.createTopLayerOperator(owningStack, owningStack, application);
+
+ // Create a layer and initialize it
+ Layer layer1 = LayersFactory.eINSTANCE.createLayer();
+ factory.initLayer(layer1, rootLayer, owningStack, application);
+
+ // asserts
+ assertNotNull("Layer created", layer1);
+ assertSame("state attached", LayerState.ATTACHED, layer1.getState() );
+ assertSame("application set", application, layer1.getApplication() );
+ assertSame("owningStack set", owningStack, layer1.getOwningLayersStack() );
+ assertSame("parent set", rootLayer, layer1.eContainer() );
+ }
+
+ /**
+ * Test method for {@link org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersFactoryForStackImpl#createLayer(org.eclipse.papyrus.layers.stackmodel.layers.LayersContainer, org.eclipse.papyrus.layers.stackmodel.layers.LayersStack, org.eclipse.papyrus.layers.stackmodel.layers.LayersStackApplication)}.
+ * @throws LayersException
+ */
+ @Test
+ public void testCreateLayer() throws LayersException {
+ // Create requested objects
+ LayersStackApplication application = LayersFactory.eINSTANCE.createLayersStackApplication();
+ Diagram diagram = NotationFactory.eINSTANCE.createDiagram();
+ // Create stack
+ LayersStack owningStack = application.getLayersStackFor(diagram);
+
+ LayersFactoryForStack factory = LayersFactoryForStack.eINSTANCE;
+
+ // Create tree
+ TopLayerOperator rootLayer = factory.createTopLayerOperator(owningStack, owningStack, application);
+ Layer layer1 = factory.createLayer(rootLayer, owningStack, application);
+
+ // asserts
+ assertNotNull("Layer created", layer1);
+ assertSame("state attached", LayerState.ATTACHED, layer1.getState() );
+ assertSame("application set", application, layer1.getApplication() );
+ assertSame("owningStack set", owningStack, layer1.getOwningLayersStack() );
+ assertSame("parent set", rootLayer, layer1.eContainer() );
+ }
+
+ /**
+ * Test method for {@link org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersFactoryForStackImpl#createLayer(org.eclipse.papyrus.layers.stackmodel.layers.LayersContainer, org.eclipse.papyrus.layers.stackmodel.layers.LayersStack, org.eclipse.papyrus.layers.stackmodel.layers.LayersStackApplication)}.
+ * @throws LayersException
+ */
+ @Test
+ public void testCreateLayerAsRoot() throws LayersException {
+ // Create requested objects
+ LayersStackApplication application = LayersFactory.eINSTANCE.createLayersStackApplication();
+ Diagram diagram = NotationFactory.eINSTANCE.createDiagram();
+ // Create stack
+ LayersStack owningStack = application.getLayersStackFor(diagram);
+
+ LayersFactoryForStack factory = LayersFactoryForStack.eINSTANCE;
+
+ // Create tree
+ Layer layer1 = factory.createLayer(owningStack, owningStack, application);
+
+ // asserts
+ assertNotNull("Layer created", layer1);
+ assertSame("state attached", LayerState.ATTACHED, layer1.getState() );
+ assertSame("application set", application, layer1.getApplication() );
+ assertSame("owningStack set", owningStack, layer1.getOwningLayersStack() );
+ assertSame("parent set", owningStack, layer1.eContainer() );
+ }
+
+ /**
+ * Test method for {@link org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersFactoryForStackImpl#createRegExpLayer(org.eclipse.papyrus.layers.stackmodel.layers.LayersContainer, org.eclipse.papyrus.layers.stackmodel.layers.LayersStack, org.eclipse.papyrus.layers.stackmodel.layers.LayersStackApplication)}.
+ * @throws LayersException
+ */
+ @Test
+ public void testCreateRegExpLayer() throws LayersException {
+ // Create requested objects
+ LayersStackApplication application = LayersFactory.eINSTANCE.createLayersStackApplication();
+ Diagram diagram = NotationFactory.eINSTANCE.createDiagram();
+ // Create stack
+ LayersStack owningStack = application.getLayersStackFor(diagram);
+
+ LayersFactoryForStack factory = LayersFactoryForStack.eINSTANCE;
+
+ // Create tree
+ TopLayerOperator rootLayer = factory.createTopLayerOperator(owningStack, owningStack, application);
+ RegExpLayer layer1 = factory.createRegExpLayer(rootLayer, owningStack, application);
+
+ // asserts
+ assertNotNull("Layer created", layer1);
+ assertSame("state attached", LayerState.ATTACHED, layer1.getState() );
+ assertSame("application set", application, layer1.getApplication() );
+ assertSame("owningStack set", owningStack, layer1.getOwningLayersStack() );
+ assertSame("parent set", rootLayer, layer1.eContainer() );
+ }
+
+ /**
+ * Test method for {@link org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersFactoryForStackImpl#createLayer(org.eclipse.papyrus.layers.stackmodel.layers.LayersContainer, org.eclipse.papyrus.layers.stackmodel.layers.LayersStack, org.eclipse.papyrus.layers.stackmodel.layers.LayersStackApplication)}.
+ * @throws LayersException
+ */
+ @Test
+ public void testCreateRegExpLayerAsRoot() throws LayersException {
+ // Create requested objects
+ LayersStackApplication application = LayersFactory.eINSTANCE.createLayersStackApplication();
+ Diagram diagram = NotationFactory.eINSTANCE.createDiagram();
+ // Create stack
+ LayersStack owningStack = application.getLayersStackFor(diagram);
+
+ LayersFactoryForStack factory = LayersFactoryForStack.eINSTANCE;
+
+ // Create tree
+ RegExpLayer layer1 = factory.createRegExpLayer(owningStack, owningStack, application);
+
+ // asserts
+ assertNotNull("Layer created", layer1);
+ assertSame("state attached", LayerState.ATTACHED, layer1.getState() );
+ assertSame("application set", application, layer1.getApplication() );
+ assertSame("owningStack set", owningStack, layer1.getOwningLayersStack() );
+ assertSame("parent set", owningStack, layer1.eContainer() );
+ }
+
+ /**
+ * Test method for {@link org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersFactoryForStackImpl#createTopLayerOperator(org.eclipse.papyrus.layers.stackmodel.layers.LayersContainer, org.eclipse.papyrus.layers.stackmodel.layers.LayersStack, org.eclipse.papyrus.layers.stackmodel.layers.LayersStackApplication)}.
+ * @throws LayersException
+ */
+ @Test
+ public void testCreateTopLayerOperator() throws LayersException {
+ // Create requested objects
+ LayersStackApplication application = LayersFactory.eINSTANCE.createLayersStackApplication();
+ Diagram diagram = NotationFactory.eINSTANCE.createDiagram();
+ // Create stack
+ LayersStack owningStack = application.getLayersStackFor(diagram);
+
+ LayersFactoryForStack factory = LayersFactoryForStack.eINSTANCE;
+
+ // Create tree
+ TopLayerOperator rootLayer = factory.createTopLayerOperator(owningStack, owningStack, application);
+ TopLayerOperator layer1 = factory.createTopLayerOperator(rootLayer, owningStack, application);
+
+ // asserts
+ assertNotNull("Layer created", layer1);
+ assertSame("state attached", LayerState.ATTACHED, layer1.getState() );
+ assertSame("application set", application, layer1.getApplication() );
+ assertSame("owningStack set", owningStack, layer1.getOwningLayersStack() );
+ assertSame("parent set", rootLayer, layer1.eContainer() );
+ }
+
+ /**
+ * Test method for {@link org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersFactoryForStackImpl#createTopLayerOperator(org.eclipse.papyrus.layers.stackmodel.layers.LayersContainer, org.eclipse.papyrus.layers.stackmodel.layers.LayersStack, org.eclipse.papyrus.layers.stackmodel.layers.LayersStackApplication)}.
+ * @throws LayersException
+ */
+ @Test
+ public void testCreateTopLayerOperatorAsRoot() throws LayersException {
+ // Create requested objects
+ LayersStackApplication application = LayersFactory.eINSTANCE.createLayersStackApplication();
+ Diagram diagram = NotationFactory.eINSTANCE.createDiagram();
+ // Create stack
+ LayersStack owningStack = application.getLayersStackFor(diagram);
+
+ LayersFactoryForStack factory = LayersFactoryForStack.eINSTANCE;
+
+ // Create tree
+ TopLayerOperator layer1 = factory.createTopLayerOperator(owningStack, owningStack, application);
+
+ // asserts
+ assertNotNull("Layer created", layer1);
+ assertSame("state attached", LayerState.ATTACHED, layer1.getState() );
+ assertSame("application set", application, layer1.getApplication() );
+ assertSame("owningStack set", owningStack, layer1.getOwningLayersStack() );
+ assertSame("parent set", owningStack, layer1.eContainer() );
+ }
+
+ /**
+ * Test method for {@link org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersFactoryForStackImpl#createStackedLayerOperator(org.eclipse.papyrus.layers.stackmodel.layers.LayersContainer, org.eclipse.papyrus.layers.stackmodel.layers.LayersStack, org.eclipse.papyrus.layers.stackmodel.layers.LayersStackApplication)}.
+ * @throws LayersException
+ */
+ @Test
+ public void testCreateStackedLayerOperator() throws LayersException {
+ // Create requested objects
+ LayersStackApplication application = LayersFactory.eINSTANCE.createLayersStackApplication();
+ Diagram diagram = NotationFactory.eINSTANCE.createDiagram();
+ // Create stack
+ LayersStack owningStack = application.getLayersStackFor(diagram);
+
+ LayersFactoryForStack factory = LayersFactoryForStack.eINSTANCE;
+
+ // Create tree
+ TopLayerOperator rootLayer = factory.createTopLayerOperator(owningStack, owningStack, application);
+ StackedLayerOperator layer1 = factory.createStackedLayerOperator(rootLayer, owningStack, application);
+
+ // asserts
+ assertNotNull("Layer created", layer1);
+ assertSame("state attached", LayerState.ATTACHED, layer1.getState() );
+ assertSame("application set", application, layer1.getApplication() );
+ assertSame("owningStack set", owningStack, layer1.getOwningLayersStack() );
+ assertSame("parent set", rootLayer, layer1.eContainer() );
+ }
+
+ /**
+ * Test method for {@link org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersFactoryForStackImpl#createTopLayerOperator(org.eclipse.papyrus.layers.stackmodel.layers.LayersContainer, org.eclipse.papyrus.layers.stackmodel.layers.LayersStack, org.eclipse.papyrus.layers.stackmodel.layers.LayersStackApplication)}.
+ * @throws LayersException
+ */
+ @Test
+ public void testCreateStackedLayerOperatorAsRoot() throws LayersException {
+ // Create requested objects
+ LayersStackApplication application = LayersFactory.eINSTANCE.createLayersStackApplication();
+ Diagram diagram = NotationFactory.eINSTANCE.createDiagram();
+ // Create stack
+ LayersStack owningStack = application.getLayersStackFor(diagram);
+
+ LayersFactoryForStack factory = LayersFactoryForStack.eINSTANCE;
+
+ // Create tree
+ StackedLayerOperator layer1 = factory.createStackedLayerOperator(owningStack, owningStack, application);
+
+ // asserts
+ assertNotNull("Layer created", layer1);
+ assertSame("state attached", LayerState.ATTACHED, layer1.getState() );
+ assertSame("application set", application, layer1.getApplication() );
+ assertSame("owningStack set", owningStack, layer1.getOwningLayersStack() );
+ assertSame("parent set", owningStack, layer1.eContainer() );
+ }
+
+ /**
+ * Test method for {@link LayersFactoryForStackImpl#createLayerOperator(String, LayersContainer, LayersStack, LayersStackApplication)}.
+ * @throws LayersException
+ */
+ @Test
+ public void testCreateLayerOperator() throws LayersException {
+ // Create requested objects
+ LayersStackApplication application = LayersFactory.eINSTANCE.createLayersStackApplication();
+ Diagram diagram = NotationFactory.eINSTANCE.createDiagram();
+ // Create stack
+ LayersStack owningStack = application.getLayersStackFor(diagram);
+
+ LayersFactoryForStack factory = LayersFactoryForStack.eINSTANCE;
+
+ // Create tree
+ TopLayerOperator rootLayer = factory.createTopLayerOperator(owningStack, owningStack, application);
+ List<LayerOperatorDescriptor> operatorDescs = application.getLayerOperatorDescriptorRegistry().getDescriptors();
+ assertNotNull("descs found", operatorDescs);
+ assertTrue("a least one desc is defined", operatorDescs.size()>0);
+
+ String layerID = operatorDescs.get(0).getName();
+ AbstractLayerOperator layer1 = factory.createLayerOperator(layerID, rootLayer, owningStack, application);
+
+ // asserts
+ assertNotNull("Layer created", layer1);
+ assertSame("state attached", LayerState.ATTACHED, layer1.getState() );
+ assertSame("application set", application, layer1.getApplication() );
+ assertSame("owningStack set", owningStack, layer1.getOwningLayersStack() );
+ assertSame("parent set", rootLayer, layer1.eContainer() );
+ }
+
+
+}
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/test/org/eclipse/papyrus/layers/stackmodel/layers/impl/LayerExpressionInitWithApplicationImplTest.java b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/test/org/eclipse/papyrus/layers/stackmodel/layers/impl/LayerExpressionInitWithApplicationImplTest.java
index f2c151717cc..c47ba71b764 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/test/org/eclipse/papyrus/layers/stackmodel/layers/impl/LayerExpressionInitWithApplicationImplTest.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/test/org/eclipse/papyrus/layers/stackmodel/layers/impl/LayerExpressionInitWithApplicationImplTest.java
@@ -80,8 +80,8 @@ public class LayerExpressionInitWithApplicationImplTest {
stack.setLayers(top);
TopLayerOperator container1 = (TopLayerOperator)factory.getLayer("top");
Layer layer1 = (Layer)factory.getLayer("layer1");
- Layer layer2 = (Layer)factory.getLayer("layer1");
- Layer layer3 = (Layer)factory.getLayer("layer1");
+ Layer layer2 = (Layer)factory.getLayer("layer2");
+ Layer layer3 = (Layer)factory.getLayer("layer3");
// Assert
@@ -196,8 +196,8 @@ public class LayerExpressionInitWithApplicationImplTest {
stack.setLayers(top);
TopLayerOperator container1 = (TopLayerOperator)factory.getLayer("top");
Layer layer1 = (Layer)factory.getLayer("layer1");
- Layer layer2 = (Layer)factory.getLayer("layer1");
- Layer layer3 = (Layer)factory.getLayer("layer1");
+ Layer layer2 = (Layer)factory.getLayer("layer2");
+ Layer layer3 = (Layer)factory.getLayer("layer3");
// Assert
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/test/org/eclipse/papyrus/layers/stackmodel/layers/impl/LayersFactoryForStackImplWithApplicationTest.java b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/test/org/eclipse/papyrus/layers/stackmodel/layers/impl/LayersFactoryForStackImplWithApplicationTest.java
new file mode 100644
index 00000000000..751347c1d9f
--- /dev/null
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/test/org/eclipse/papyrus/layers/stackmodel/layers/impl/LayersFactoryForStackImplWithApplicationTest.java
@@ -0,0 +1,384 @@
+/*****************************************************************************
+ * Copyright (c) 2014 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.layers.impl;
+
+import static org.junit.Assert.*;
+
+import java.util.List;
+
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.NotationFactory;
+import org.eclipse.papyrus.layers.stackmodel.LayersException;
+import org.eclipse.papyrus.layers.stackmodel.layers.AbstractLayerOperator;
+import org.eclipse.papyrus.layers.stackmodel.layers.Layer;
+import org.eclipse.papyrus.layers.stackmodel.layers.LayerOperator;
+import org.eclipse.papyrus.layers.stackmodel.layers.LayerOperatorDescriptor;
+import org.eclipse.papyrus.layers.stackmodel.layers.LayerState;
+import org.eclipse.papyrus.layers.stackmodel.layers.LayersFactory;
+import org.eclipse.papyrus.layers.stackmodel.layers.LayersFactoryForStack;
+import org.eclipse.papyrus.layers.stackmodel.layers.LayersStack;
+import org.eclipse.papyrus.layers.stackmodel.layers.LayersStackApplication;
+import org.eclipse.papyrus.layers.stackmodel.layers.RegExpLayer;
+import org.eclipse.papyrus.layers.stackmodel.layers.StackedLayerOperator;
+import org.eclipse.papyrus.layers.stackmodel.layers.TopLayerOperator;
+import org.eclipse.papyrus.layers.stackmodel.layers.util.LayersFactoryTestUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+
+
+/**
+ * @author cedric dumoulin
+ *
+ */
+public class LayersFactoryForStackImplWithApplicationTest {
+
+ /**
+ * @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.layers.impl.LayersFactoryForStackImpl#LayersFactoryForStackImpl()}.
+ * @throws LayersException
+ */
+ @Test
+ public void testCreateLayersFactoryForStackImpl() throws LayersException {
+ // Create requested objects
+ LayersStackApplication application = LayersFactory.eINSTANCE.createLayersStackApplication();
+ Diagram diagram = NotationFactory.eINSTANCE.createDiagram();
+ // Create stack
+ LayersStack owningStack = application.getLayersStackFor(diagram);
+
+ LayersFactoryForStack factory = LayersFactoryForStack.eINSTANCE;
+ assertNotNull("factory created", factory);
+
+ // Create tree
+ TopLayerOperator rootLayer = factory.createTopLayerOperator(owningStack, owningStack, application);
+ Layer layer1 = factory.createLayer(rootLayer, owningStack, application);
+ Layer layer2 = factory.createLayer(rootLayer, owningStack, application);
+ TopLayerOperator layerOperator1 = factory.createTopLayerOperator(rootLayer, owningStack, application);
+ Layer layer3 = factory.createLayer(layerOperator1, owningStack, application);
+
+ // asserts
+ assertNotNull("Layer created", rootLayer);
+ assertNotNull("Layer created", layer1);
+ assertNotNull("Layer created", layer2);
+ assertNotNull("Layer created", layerOperator1);
+ assertNotNull("Layer created", layer3);
+
+ }
+
+ /**
+ * Test method for {@link org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersFactoryForStackImpl#findNewLayerName(org.eclipse.papyrus.layers.stackmodel.layers.LayersContainer)}.
+ */
+ @Test
+ public void testFindNewLayerName() {
+
+ LayersFactoryForStackImpl factory = new LayersFactoryForStackImpl();
+ String expectedName1 = factory.LAYER_NAME_PREFIX + "0";
+
+
+ LayerOperator parent = LayersFactory.eINSTANCE.createTopLayerOperator();
+ String name1 = factory.findNewLayerName(parent);
+
+ assertEquals( "expected name", expectedName1, name1);
+ }
+
+ /**
+ * Test method for {@link org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersFactoryForStackImpl#createLayersStack()}.
+ */
+ @Test
+ @Ignore
+ public void testCreateLayersStack() {
+ fail("Not yet implemented");
+ }
+
+ /**
+ * Test method for {@link org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersFactoryForStackImpl#initLayer(org.eclipse.papyrus.layers.stackmodel.layers.LayerExpression, org.eclipse.papyrus.layers.stackmodel.layers.LayersContainer, org.eclipse.papyrus.layers.stackmodel.layers.LayersStack, org.eclipse.papyrus.layers.stackmodel.layers.LayersStackApplication)}.
+ * @throws LayersException
+ */
+ @Test
+ public void testInitLayer() throws LayersException {
+ // Create requested objects
+ LayersStackApplication application = LayersFactory.eINSTANCE.createLayersStackApplication();
+ Diagram diagram = NotationFactory.eINSTANCE.createDiagram();
+ // Create stack
+ LayersStack owningStack = application.getLayersStackFor(diagram);
+
+ LayersFactoryForStack factory = LayersFactoryForStack.eINSTANCE;
+
+ // Create a Tree
+ TopLayerOperator rootLayer = factory.createTopLayerOperator(owningStack, owningStack, application);
+
+ // Create a layer and initialize it
+ Layer layer1 = LayersFactory.eINSTANCE.createLayer();
+ factory.initLayer(layer1, rootLayer, owningStack, application);
+
+ // asserts
+ assertNotNull("Layer created", layer1);
+ assertSame("state attached", LayerState.ATTACHED, layer1.getState() );
+ assertSame("application set", application, layer1.getApplication() );
+ assertSame("owningStack set", owningStack, layer1.getOwningLayersStack() );
+ assertSame("parent set", rootLayer, layer1.eContainer() );
+ }
+
+ /**
+ * Test method for {@link org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersFactoryForStackImpl#createLayer(org.eclipse.papyrus.layers.stackmodel.layers.LayersContainer, org.eclipse.papyrus.layers.stackmodel.layers.LayersStack, org.eclipse.papyrus.layers.stackmodel.layers.LayersStackApplication)}.
+ * @throws LayersException
+ */
+ @Test
+ public void testCreateLayer() throws LayersException {
+ // Create requested objects
+ LayersStackApplication application = LayersFactory.eINSTANCE.createLayersStackApplication();
+ Diagram diagram = NotationFactory.eINSTANCE.createDiagram();
+ // Create stack
+ LayersStack owningStack = application.getLayersStackFor(diagram);
+
+ LayersFactoryForStack factory = LayersFactoryForStack.eINSTANCE;
+
+ // Create tree
+ TopLayerOperator rootLayer = factory.createTopLayerOperator(owningStack, owningStack, application);
+ Layer layer1 = factory.createLayer(rootLayer, owningStack, application);
+
+ // asserts
+ assertNotNull("Layer created", layer1);
+ assertSame("state attached", LayerState.ATTACHED, layer1.getState() );
+ assertSame("application set", application, layer1.getApplication() );
+ assertSame("owningStack set", owningStack, layer1.getOwningLayersStack() );
+ assertSame("parent set", rootLayer, layer1.eContainer() );
+ }
+
+ /**
+ * Test method for {@link org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersFactoryForStackImpl#createLayer(org.eclipse.papyrus.layers.stackmodel.layers.LayersContainer, org.eclipse.papyrus.layers.stackmodel.layers.LayersStack, org.eclipse.papyrus.layers.stackmodel.layers.LayersStackApplication)}.
+ * @throws LayersException
+ */
+ @Test
+ public void testCreateLayerAsRoot() throws LayersException {
+ // Create requested objects
+ LayersStackApplication application = LayersFactory.eINSTANCE.createLayersStackApplication();
+ Diagram diagram = NotationFactory.eINSTANCE.createDiagram();
+ // Create stack
+ LayersStack owningStack = application.getLayersStackFor(diagram);
+
+ LayersFactoryForStack factory = LayersFactoryForStack.eINSTANCE;
+
+ // Create tree
+ Layer layer1 = factory.createLayer(owningStack, owningStack, application);
+
+ // asserts
+ assertNotNull("Layer created", layer1);
+ assertSame("state attached", LayerState.ATTACHED, layer1.getState() );
+ assertSame("application set", application, layer1.getApplication() );
+ assertSame("owningStack set", owningStack, layer1.getOwningLayersStack() );
+ assertSame("parent set", owningStack, layer1.eContainer() );
+ }
+
+ /**
+ * Test method for {@link org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersFactoryForStackImpl#createRegExpLayer(org.eclipse.papyrus.layers.stackmodel.layers.LayersContainer, org.eclipse.papyrus.layers.stackmodel.layers.LayersStack, org.eclipse.papyrus.layers.stackmodel.layers.LayersStackApplication)}.
+ * @throws LayersException
+ */
+ @Test
+ public void testCreateRegExpLayer() throws LayersException {
+ // Create requested objects
+ LayersStackApplication application = LayersFactory.eINSTANCE.createLayersStackApplication();
+ Diagram diagram = NotationFactory.eINSTANCE.createDiagram();
+ // Create stack
+ LayersStack owningStack = application.getLayersStackFor(diagram);
+
+ LayersFactoryForStack factory = LayersFactoryForStack.eINSTANCE;
+
+ // Create tree
+ TopLayerOperator rootLayer = factory.createTopLayerOperator(owningStack, owningStack, application);
+ RegExpLayer layer1 = factory.createRegExpLayer(rootLayer, owningStack, application);
+
+ // asserts
+ assertNotNull("Layer created", layer1);
+ assertSame("state attached", LayerState.ATTACHED, layer1.getState() );
+ assertSame("application set", application, layer1.getApplication() );
+ assertSame("owningStack set", owningStack, layer1.getOwningLayersStack() );
+ assertSame("parent set", rootLayer, layer1.eContainer() );
+ }
+
+ /**
+ * Test method for {@link org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersFactoryForStackImpl#createLayer(org.eclipse.papyrus.layers.stackmodel.layers.LayersContainer, org.eclipse.papyrus.layers.stackmodel.layers.LayersStack, org.eclipse.papyrus.layers.stackmodel.layers.LayersStackApplication)}.
+ * @throws LayersException
+ */
+ @Test
+ public void testCreateRegExpLayerAsRoot() throws LayersException {
+ // Create requested objects
+ LayersStackApplication application = LayersFactory.eINSTANCE.createLayersStackApplication();
+ Diagram diagram = NotationFactory.eINSTANCE.createDiagram();
+ // Create stack
+ LayersStack owningStack = application.getLayersStackFor(diagram);
+
+ LayersFactoryForStack factory = LayersFactoryForStack.eINSTANCE;
+
+ // Create tree
+ RegExpLayer layer1 = factory.createRegExpLayer(owningStack, owningStack, application);
+
+ // asserts
+ assertNotNull("Layer created", layer1);
+ assertSame("state attached", LayerState.ATTACHED, layer1.getState() );
+ assertSame("application set", application, layer1.getApplication() );
+ assertSame("owningStack set", owningStack, layer1.getOwningLayersStack() );
+ assertSame("parent set", owningStack, layer1.eContainer() );
+ }
+
+ /**
+ * Test method for {@link org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersFactoryForStackImpl#createTopLayerOperator(org.eclipse.papyrus.layers.stackmodel.layers.LayersContainer, org.eclipse.papyrus.layers.stackmodel.layers.LayersStack, org.eclipse.papyrus.layers.stackmodel.layers.LayersStackApplication)}.
+ * @throws LayersException
+ */
+ @Test
+ public void testCreateTopLayerOperator() throws LayersException {
+ // Create requested objects
+ LayersStackApplication application = LayersFactory.eINSTANCE.createLayersStackApplication();
+ Diagram diagram = NotationFactory.eINSTANCE.createDiagram();
+ // Create stack
+ LayersStack owningStack = application.getLayersStackFor(diagram);
+
+ LayersFactoryForStack factory = LayersFactoryForStack.eINSTANCE;
+
+ // Create tree
+ TopLayerOperator rootLayer = factory.createTopLayerOperator(owningStack, owningStack, application);
+ TopLayerOperator layer1 = factory.createTopLayerOperator(rootLayer, owningStack, application);
+
+ // asserts
+ assertNotNull("Layer created", layer1);
+ assertSame("state attached", LayerState.ATTACHED, layer1.getState() );
+ assertSame("application set", application, layer1.getApplication() );
+ assertSame("owningStack set", owningStack, layer1.getOwningLayersStack() );
+ assertSame("parent set", rootLayer, layer1.eContainer() );
+ }
+
+ /**
+ * Test method for {@link org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersFactoryForStackImpl#createTopLayerOperator(org.eclipse.papyrus.layers.stackmodel.layers.LayersContainer, org.eclipse.papyrus.layers.stackmodel.layers.LayersStack, org.eclipse.papyrus.layers.stackmodel.layers.LayersStackApplication)}.
+ * @throws LayersException
+ */
+ @Test
+ public void testCreateTopLayerOperatorAsRoot() throws LayersException {
+ // Create requested objects
+ LayersStackApplication application = LayersFactory.eINSTANCE.createLayersStackApplication();
+ Diagram diagram = NotationFactory.eINSTANCE.createDiagram();
+ // Create stack
+ LayersStack owningStack = application.getLayersStackFor(diagram);
+
+ LayersFactoryForStack factory = LayersFactoryForStack.eINSTANCE;
+
+ // Create tree
+ TopLayerOperator layer1 = factory.createTopLayerOperator(owningStack, owningStack, application);
+
+ // asserts
+ assertNotNull("Layer created", layer1);
+ assertSame("state attached", LayerState.ATTACHED, layer1.getState() );
+ assertSame("application set", application, layer1.getApplication() );
+ assertSame("owningStack set", owningStack, layer1.getOwningLayersStack() );
+ assertSame("parent set", owningStack, layer1.eContainer() );
+ }
+
+ /**
+ * Test method for {@link org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersFactoryForStackImpl#createStackedLayerOperator(org.eclipse.papyrus.layers.stackmodel.layers.LayersContainer, org.eclipse.papyrus.layers.stackmodel.layers.LayersStack, org.eclipse.papyrus.layers.stackmodel.layers.LayersStackApplication)}.
+ * @throws LayersException
+ */
+ @Test
+ public void testCreateStackedLayerOperator() throws LayersException {
+ // Create requested objects
+ LayersStackApplication application = LayersFactory.eINSTANCE.createLayersStackApplication();
+ Diagram diagram = NotationFactory.eINSTANCE.createDiagram();
+ // Create stack
+ LayersStack owningStack = application.getLayersStackFor(diagram);
+
+ LayersFactoryForStack factory = LayersFactoryForStack.eINSTANCE;
+
+ // Create tree
+ TopLayerOperator rootLayer = factory.createTopLayerOperator(owningStack, owningStack, application);
+ StackedLayerOperator layer1 = factory.createStackedLayerOperator(rootLayer, owningStack, application);
+
+ // asserts
+ assertNotNull("Layer created", layer1);
+ assertSame("state attached", LayerState.ATTACHED, layer1.getState() );
+ assertSame("application set", application, layer1.getApplication() );
+ assertSame("owningStack set", owningStack, layer1.getOwningLayersStack() );
+ assertSame("parent set", rootLayer, layer1.eContainer() );
+ }
+
+ /**
+ * Test method for {@link org.eclipse.papyrus.layers.stackmodel.layers.impl.LayersFactoryForStackImpl#createTopLayerOperator(org.eclipse.papyrus.layers.stackmodel.layers.LayersContainer, org.eclipse.papyrus.layers.stackmodel.layers.LayersStack, org.eclipse.papyrus.layers.stackmodel.layers.LayersStackApplication)}.
+ * @throws LayersException
+ */
+ @Test
+ public void testCreateStackedLayerOperatorAsRoot() throws LayersException {
+ // Create requested objects
+ LayersStackApplication application = LayersFactory.eINSTANCE.createLayersStackApplication();
+ Diagram diagram = NotationFactory.eINSTANCE.createDiagram();
+ // Create stack
+ LayersStack owningStack = application.getLayersStackFor(diagram);
+
+ LayersFactoryForStack factory = LayersFactoryForStack.eINSTANCE;
+
+ // Create tree
+ StackedLayerOperator layer1 = factory.createStackedLayerOperator(owningStack, owningStack, application);
+
+ // asserts
+ assertNotNull("Layer created", layer1);
+ assertSame("state attached", LayerState.ATTACHED, layer1.getState() );
+ assertSame("application set", application, layer1.getApplication() );
+ assertSame("owningStack set", owningStack, layer1.getOwningLayersStack() );
+ assertSame("parent set", owningStack, layer1.eContainer() );
+ }
+
+ /**
+ * Test method for {@link LayersFactoryForStackImpl#createLayerOperator(String, LayersContainer, LayersStack, LayersStackApplication)}.
+ * @throws LayersException
+ */
+ @Test
+ public void testCreateLayerOperator() throws LayersException {
+ // Create requested objects
+ LayersStackApplication application = LayersFactory.eINSTANCE.createLayersStackApplication();
+ Diagram diagram = NotationFactory.eINSTANCE.createDiagram();
+ // Create stack
+ LayersStack owningStack = application.getLayersStackFor(diagram);
+
+ LayersFactoryForStack factory = LayersFactoryForStack.eINSTANCE;
+
+ // Create tree
+ TopLayerOperator rootLayer = factory.createTopLayerOperator(owningStack, owningStack, application);
+ List<LayerOperatorDescriptor> operatorDescs = application.getLayerOperatorDescriptorRegistry().getDescriptors();
+ assertNotNull("descs found", operatorDescs);
+ assertTrue("a least one desc is defined", operatorDescs.size()>0);
+
+ String layerID = operatorDescs.get(0).getName();
+ AbstractLayerOperator layer1 = factory.createLayerOperator(layerID, rootLayer, owningStack, application);
+
+ // asserts
+ assertNotNull("Layer created", layer1);
+ assertSame("state attached", LayerState.ATTACHED, layer1.getState() );
+ assertSame("application set", application, layer1.getApplication() );
+ assertSame("owningStack set", owningStack, layer1.getOwningLayersStack() );
+ assertSame("parent set", rootLayer, layer1.eContainer() );
+ }
+
+
+}
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/test/org/eclipse/papyrus/layers/stackmodel/layers/util/LayersFactoryForStackTestUtils.java b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/test/org/eclipse/papyrus/layers/stackmodel/layers/util/LayersFactoryForStackTestUtils.java
new file mode 100644
index 00000000000..276aa2b99ea
--- /dev/null
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/test/org/eclipse/papyrus/layers/stackmodel/layers/util/LayersFactoryForStackTestUtils.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.layers.util;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.papyrus.layers.stackmodel.LayersException;
+import org.eclipse.papyrus.layers.stackmodel.layers.LayerExpression;
+import org.eclipse.papyrus.layers.stackmodel.layers.LayersFactory;
+import org.eclipse.papyrus.layers.stackmodel.layers.LayersFactoryForStack;
+import org.eclipse.papyrus.layers.stackmodel.layers.LayersStack;
+import org.eclipse.papyrus.layers.stackmodel.layers.LayersStackApplication;
+import org.eclipse.papyrus.layers.stackmodel.layers.TopLayerOperator;
+
+/**
+ * Utilities to create programmatically a Tree of layers with the {@link LayersFactoryForStack}
+ *
+ * @author cedric dumoulin
+ *
+ */
+public class LayersFactoryForStackTestUtils {
+
+ /**
+ * Application object.
+ */
+ protected LayersStackApplication application;
+
+ /**
+ * Stack object.
+ */
+ protected LayersStack stack;
+
+ /**
+ * factory object.
+ */
+ protected LayersFactoryForStack factory;
+
+ protected Map<String, LayerExpression> createdLayers = new HashMap<String, LayerExpression>();
+
+
+ /**
+ * Constructor.
+ *
+ * @param stack
+ * @param factory
+ * @param application
+ */
+ public LayersFactoryForStackTestUtils(LayersStack stack, LayersFactoryForStack factory, LayersStackApplication application) {
+ this.stack = stack;
+ this.factory = factory;
+ this.application = application;
+ }
+
+ /**
+ * Constructor.
+ * Use the global factory for {@link LayersFactoryForStack}
+ * @param stack
+ * @param application
+ */
+ public LayersFactoryForStackTestUtils(LayersStack stack, LayersStackApplication application) {
+ this.stack = stack;
+ this.factory = LayersFactoryForStack.eINSTANCE;
+ this.application = application;
+ }
+
+ /**
+ * @return the createdLayers
+ */
+ public Map<String, LayerExpression> getCreatedLayers() {
+ return createdLayers;
+ }
+
+ /**
+ * @return the createdLayers
+ */
+ public LayerExpression getLayer(String name) {
+ return createdLayers.get(name);
+ }
+
+ /**
+ * Create a TopLayer
+ * @return
+ * @throws LayersException
+ */
+ public TopLayerOperator newTopLayer() throws LayersException {
+ // Create a TopLayer
+ TopLayerOperator layer = factory.createTopLayerOperator(stack, stack, application);
+
+ return layer;
+ }
+
+ /**
+ * Create a TopLayer
+ * @return
+ * @throws LayersException
+ */
+ public TopLayerOperator newTopLayer(String name) throws LayersException {
+ TopLayerOperator layer = newTopLayer();
+ createdLayers.put(name, layer);
+ return layer;
+
+ }
+
+ /**
+ * Create a TopLayer and add the specified sublayers to it.
+ * Sublayers are initialized with {@link LayersFactoryForStack#initLayer(LayerExpression, org.eclipse.papyrus.layers.stackmodel.layers.LayersContainer, LayersStack, LayersStackApplication)}
+ * before being added to their parent.
+ * @return
+ * @throws LayersException
+ */
+ public TopLayerOperator newTopLayer(String name, LayerExpression ...exprs) throws LayersException {
+
+ TopLayerOperator layer = newTopLayer(exprs);
+ createdLayers.put(name, layer);
+ return layer;
+ }
+
+ /**
+ * Create a TopLayer and add the specified sublayers to it.
+ * Sublayers are initialized with {@link LayersFactoryForStack#initLayer(LayerExpression, org.eclipse.papyrus.layers.stackmodel.layers.LayersContainer, LayersStack, LayersStackApplication)}
+ * before being added to their parent.
+ *
+ * @return
+ * @throws LayersException
+ */
+ public TopLayerOperator newTopLayer(LayerExpression ...exprs) throws LayersException {
+ // Create a TopLayer
+ TopLayerOperator layer = newTopLayer();
+
+ for( LayerExpression l : exprs) {
+ factory.initLayer(l, layer, stack, application);
+ }
+
+ return layer;
+ }
+
+ /**
+ * Create an uninitialized Layer
+ * @return
+ */
+ public LayerExpression newLayer() {
+ // Create a TopLayer
+ LayerExpression layer = LayersFactory.eINSTANCE.createLayer();
+
+ return layer;
+ }
+
+ /**
+ * Create a an uninitialized Layer and store it in the map of layers under the specified name.
+ * @return
+ */
+ public LayerExpression newLayer(String name) {
+ LayerExpression layer = newLayer();
+ createdLayers.put(name, layer);
+ return layer;
+
+ }
+
+
+}

Back to the top