diff options
author | cbrun | 2017-01-09 15:34:14 +0000 |
---|---|---|
committer | cbrun | 2017-01-10 10:57:22 +0000 |
commit | 595702402dbbe1f618bbe1aab4539902357ec161 (patch) | |
tree | c185b239c17adac29174a5e3e9f31bcda868cc4f | |
parent | 0e73512590dd688f3b290691eb1f6d6af51e7055 (diff) | |
download | org.eclipse.sirius-595702402dbbe1f618bbe1aab4539902357ec161.tar.gz org.eclipse.sirius-595702402dbbe1f618bbe1aab4539902357ec161.tar.xz org.eclipse.sirius-595702402dbbe1f618bbe1aab4539902357ec161.zip |
[510126] Specify type of containerView in ContainerCreationDescription
Add the code and supporting test cases so that the 'containerView'
variable accessible in a ContainerCreationDescription tool is typed
based on the mapping structure instead of a generic DSemanticDecorator.
Bug: 510126
Change-Id: Iefebaf6da0b485d6cff92bec0f270ed28bce9c02
Signed-off-by: Cedric Brun <cedric.brun@obeo.fr>
2 files changed, 23 insertions, 1 deletions
diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/dialect/description/DiagramInterpretedExpressionQuery.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/dialect/description/DiagramInterpretedExpressionQuery.java index 610113e644..e824559ee0 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/dialect/description/DiagramInterpretedExpressionQuery.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/dialect/description/DiagramInterpretedExpressionQuery.java @@ -264,7 +264,9 @@ public class DiagramInterpretedExpressionQuery extends AbstractInterpretedExpres possibleTypes.add(domainClass); } } - collectPotentialContainerTypes(possibleTypes, Sets.<String> newLinkedHashSet(), tool.getContainerMappings()); + Collection<String> possibleViewTypes = Sets.newLinkedHashSet(); + collectPotentialContainerTypes(possibleTypes, possibleViewTypes, tool.getContainerMappings()); + refineVariableType(availableVariables, IInterpreterSiriusVariables.CONTAINER_VIEW, possibleViewTypes); refineVariableType(availableVariables, IInterpreterSiriusVariables.CONTAINER, possibleTypes); } diff --git a/plugins/org.eclipse.sirius.tests.junit/data/unit/vsm/validateVariableTypes.odesign b/plugins/org.eclipse.sirius.tests.junit/data/unit/vsm/validateVariableTypes.odesign index 25f943b2fa..6d7dc4cf26 100644 --- a/plugins/org.eclipse.sirius.tests.junit/data/unit/vsm/validateVariableTypes.odesign +++ b/plugins/org.eclipse.sirius.tests.junit/data/unit/vsm/validateVariableTypes.odesign @@ -135,6 +135,12 @@ </conditionnalStyles> </containerMappings> <containerMappings name="InteractionContainer" domainClass="interactions.Interaction"> + <subContainerMappings name="InteractionContainerInContainer" semanticCandidatesExpression="var:self" domainClass="interactions.Interaction"> + <style xsi:type="style:WorkspaceImageDescription" borderSizeComputationExpression="1" arcWidth="1" arcHeight="1" workspacePath="/org.eclipse.emf.ecore.edit/icons/full/obj16/EClass.gif"> + <borderColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> + <labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> + </style> + </subContainerMappings> <style xsi:type="style:WorkspaceImageDescription" borderSizeComputationExpression="1" arcWidth="1" arcHeight="1" workspacePath="/org.eclipse.emf.ecore.edit/icons/full/obj16/EClass.gif"> <borderColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> <labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> @@ -179,6 +185,9 @@ <subModelOperations xsi:type="tool:ChangeContext" browseExpression="aql:i.executions"/> </subModelOperations> </subModelOperations> + <subModelOperations xsi:type="tool:ChangeContext" browseExpression="var:containerView"> + <subModelOperations xsi:type="tool:ChangeContext" browseExpression="feature:edges"/> + </subModelOperations> </firstModelOperations> </initialOperation> </ownedTools> @@ -417,6 +426,17 @@ </firstModelOperations> </initialOperation> </ownedTools> + <ownedTools xsi:type="tool_1:ContainerCreationDescription" name="Check container view when its a container" containerMappings="//@ownedViewpoints[name='VSMTypes']/@ownedRepresentations[name='SelfTypeInference']/@defaultLayer/@containerMappings[name='InteractionContainer']/@subContainerMappings[name='InteractionContainerInContainer']"> + <variable name="container"/> + <viewVariable name="containerView"/> + <initialOperation> + <firstModelOperations xsi:type="tool:ChangeContext" browseExpression="var:self"> + <subModelOperations xsi:type="tool:ChangeContext" browseExpression="var:containerView"> + <subModelOperations xsi:type="tool:ChangeContext" browseExpression="aql:self.childrenPresentation = diagram::ContainerLayout::List"/> + </subModelOperations> + </firstModelOperations> + </initialOperation> + </ownedTools> <subSections name="Ignored"> <ownedTools xsi:type="tool_1:DirectEditLabel" name="ElementType"> <mask mask="{0}"/> |