diff options
| author | cbrun | 2015-04-24 10:03:42 +0000 |
|---|---|---|
| committer | cbrun | 2015-04-27 12:04:17 +0000 |
| commit | 34acb43c3371a057814c08e561fca5e3c52d4322 (patch) | |
| tree | dcfce91f5396d0089ad44ea89b0854ee19cfc56b | |
| parent | 915df21a09b35f257dda2c3a0d72d91b666151cf (diff) | |
| download | org.eclipse.sirius-34acb43c3371a057814c08e561fca5e3c52d4322.tar.gz org.eclipse.sirius-34acb43c3371a057814c08e561fca5e3c52d4322.tar.xz org.eclipse.sirius-34acb43c3371a057814c08e561fca5e3c52d4322.zip | |
[465300] Declare the "diagram" variable in OperationAction
Dynamically declare the "diagram" variable in the context of an
OperationAction if it is contained in a DiagramDescription.
This is done to match the behavior implemented during execution in
UndoRedoCapableEMFCommandFactory.buildOperationActionFromTool
Bug: 465300
Change-Id: I9bbb8c87ff00ccf60ac20293be324e86537949fb
Signed-off-by: Cedric Brun <cedric.brun@obeo.fr>
| -rw-r--r-- | plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/dialect/description/DiagramInterpretedExpressionQuery.java | 9 |
1 files changed, 9 insertions, 0 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 adcb612b73..f46810e16d 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 @@ -30,6 +30,7 @@ import org.eclipse.sirius.diagram.ContainerLayout; import org.eclipse.sirius.diagram.DiagramPackage; import org.eclipse.sirius.diagram.business.api.diagramtype.DiagramTypeDescriptorRegistry; import org.eclipse.sirius.diagram.business.api.diagramtype.IDiagramTypeDescriptor; +import org.eclipse.sirius.diagram.business.api.query.EObjectQuery; import org.eclipse.sirius.diagram.description.AbstractNodeMapping; import org.eclipse.sirius.diagram.description.ContainerMapping; import org.eclipse.sirius.diagram.description.DescriptionPackage; @@ -54,6 +55,7 @@ import org.eclipse.sirius.ext.base.Options; import org.eclipse.sirius.viewpoint.description.RepresentationDescription; import org.eclipse.sirius.viewpoint.description.RepresentationElementMapping; import org.eclipse.sirius.viewpoint.description.tool.EditMaskVariables; +import org.eclipse.sirius.viewpoint.description.tool.OperationAction; import org.eclipse.sirius.viewpoint.description.tool.ToolPackage; import com.google.common.collect.Iterables; @@ -217,6 +219,13 @@ public class DiagramInterpretedExpressionQuery extends AbstractInterpretedExpres availableVariables.put(IInterpreterSiriusVariables.CONTAINER, VariableType.fromStrings(possibleTypes)); } + if (operationContext instanceof OperationAction) { + OperationAction tool = (OperationAction) operationContext; + if (new EObjectQuery(tool).getFirstAncestorOfType(DescriptionPackage.Literals.DIAGRAM_DESCRIPTION).some()) { + availableVariables.put("diagram", VariableType.fromString("diagram.DSemanticDiagram")); + } + } + } /* * [428757] tool variables and not displayed in autocompletion This |
