Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnsgar Radermacher2014-08-21 04:32:07 -0400
committerAnsgar Radermacher2014-08-21 10:56:31 -0400
commit6329c6fc185feeb14575641ef2b6cd0d42f02342 (patch)
tree7eb1d0df461c35c219a008677653b4f4b3daeadb /plugins
parent2ddada0845b7a24ce8f308483bac2f789e8f9a5b (diff)
downloadorg.eclipse.papyrus-6329c6fc185feeb14575641ef2b6cd0d42f02342.tar.gz
org.eclipse.papyrus-6329c6fc185feeb14575641ef2b6cd0d42f02342.tar.xz
org.eclipse.papyrus-6329c6fc185feeb14575641ef2b6cd0d42f02342.zip
436924 - [State Machine Diagram] Irregular OCL Constraint editing for State Machines
Diffstat (limited to 'plugins')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/commands/CustomConstraintCreateCommand.java65
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/edit/part/CustomConstraintEditPart.java35
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/edit/part/CustomStateNameEditPart.java1
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/factory/CustomUMLEditPartFactory.java4
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/figures/CustomContextLinkFigure.java55
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/policies/CustomAppliedStereotypeContextLinkLabelDisplayEditPolicy.java54
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/policies/CustomRegionCompartmentItemSemanticEditPolicy.java50
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/messages.properties2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/model/stateMachineDiagram.gmfgen66
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/plugin.properties1
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/plugin.xml537
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/commands/ContextLinkCreateCommand.java102
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/commands/ContextLinkReorientCommand.java158
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/parts/ConstraintEditPart.java12
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/parts/ContextLinkAppliedStereotypeEditPart.java753
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/parts/ContextLinkEditPart.java109
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/parts/RegionCompartmentEditPart.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/parts/UMLEditPartFactory.java4
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/ConstraintItemSemanticEditPolicy.java14
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/ContextLinkItemSemanticEditPolicy.java37
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/FinalStateItemSemanticEditPolicy.java14
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/RegionItemSemanticEditPolicy.java16
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/StateItemSemanticEditPolicy.java16
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/StateMachineItemSemanticEditPolicy.java15
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/TransitionItemSemanticEditPolicy.java14
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/UMLBaseItemSemanticEditPolicy.java23
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/part/Messages.java10
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/part/UMLDiagramEditor.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/part/UMLDiagramEditorPlugin.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/part/UMLDiagramEditorUtil.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/part/UMLDiagramUpdater.java36
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/part/UMLPaletteFactory.java18
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/part/UMLVisualIDRegistry.java7
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/providers/ElementInitializers.java1192
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/providers/UMLElementTypes.java10
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/providers/UMLParserProvider.java23
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/providers/UMLViewProvider.java38
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/sheet/UMLPropertySection.java2
38 files changed, 2641 insertions, 860 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/commands/CustomConstraintCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/commands/CustomConstraintCreateCommand.java
new file mode 100644
index 00000000000..d5dd4993081
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/commands/CustomConstraintCreateCommand.java
@@ -0,0 +1,65 @@
+/**
+ * Copyright (c) 2014 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:
+ * CEA LIST - Initial API and implementation
+ */
+package org.eclipse.papyrus.uml.diagram.statemachine.custom.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.papyrus.infra.viewpoints.policy.ModelAddData;
+import org.eclipse.papyrus.infra.viewpoints.policy.PolicyChecker;
+import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.ConstraintCreateCommand;
+import org.eclipse.papyrus.uml.diagram.statemachine.providers.ElementInitializers;
+import org.eclipse.uml2.uml.Constraint;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.UMLFactory;
+
+/**
+ * Create a constraint command. Unlike the original command, the constraint is created in the nearest
+ * package. This is more consistent with the behavior in the class diagram and does not set the context attribute.
+ * (if already set, the user cannot set the context link via the context-link tool).
+ */
+public class CustomConstraintCreateCommand extends ConstraintCreateCommand {
+
+ private Diagram diagram = null;
+
+ public CustomConstraintCreateCommand(CreateElementRequest req, Diagram diagram) {
+ super(req, diagram);
+ this.diagram = diagram;
+ }
+
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ Constraint newElement = UMLFactory.eINSTANCE.createConstraint();
+ EObject target = getElementToEdit();
+ ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target, newElement);
+ if(data.isPermitted()) {
+ if(data.isPathDefined()) {
+ if(!data.execute(target, newElement))
+ return CommandResult.newErrorCommandResult("Failed to follow the policy-specified for the insertion of the new element"); //$NON-NLS-1$
+ } else {
+ Package qualifiedTarget = ((Element)target).getNearestPackage();
+ qualifiedTarget.getPackagedElements().add(newElement);
+ }
+ } else {
+ return CommandResult.newErrorCommandResult("The active policy restricts the addition of this element"); //$NON-NLS-1$
+ }
+ ElementInitializers.getInstance().init_Constraint_668(newElement);
+ doConfigure(newElement, monitor, info);
+ ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ return CommandResult.newOKCommandResult(newElement);
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/edit/part/CustomConstraintEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/edit/part/CustomConstraintEditPart.java
new file mode 100644
index 00000000000..125b5331c92
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/edit/part/CustomConstraintEditPart.java
@@ -0,0 +1,35 @@
+/*****************************************************************************
+ * Copyright (c) 2014 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:
+ * Ansgar Radermacher (CEA LIST) ansgar.radermacher@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.statemachine.custom.edit.part;
+
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ConstraintEditPart;
+import org.eclipse.papyrus.uml.diagram.statemachine.providers.UMLElementTypes;
+
+/**
+ * Custom variant. Provides elementType for @see AbstractConstraintEditPart
+ */
+public class CustomConstraintEditPart extends ConstraintEditPart {
+
+ public CustomConstraintEditPart(View view) {
+ super(view);
+ }
+
+ @Override
+ protected IElementType elementTypeOfToolAfterCreation() {
+ return UMLElementTypes.ConstraintContext_8500;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/edit/part/CustomStateNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/edit/part/CustomStateNameEditPart.java
index 42ef9c8e651..f7e00af13ec 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/edit/part/CustomStateNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/edit/part/CustomStateNameEditPart.java
@@ -120,7 +120,6 @@ public class CustomStateNameEditPart extends StateNameEditPart {
if(stateCompartHeight == 0) {
// stateCompartHeight is 0 after creation, get height from figure
// stateCompartHeight = stateFigure.getStateCompartmentFigure().getBounds().height;
- // System.err.println("Set state compartment height from fig.");
}
int dx = width - stateWidth;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/factory/CustomUMLEditPartFactory.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/factory/CustomUMLEditPartFactory.java
index 11e1a291f99..b1e0a9f09b9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/factory/CustomUMLEditPartFactory.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/factory/CustomUMLEditPartFactory.java
@@ -15,6 +15,7 @@ package org.eclipse.papyrus.uml.diagram.statemachine.custom.factory;
import org.eclipse.gef.EditPart;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.uml.diagram.statemachine.custom.edit.part.CustomConnectionPointReferenceNameEditPart;
+import org.eclipse.papyrus.uml.diagram.statemachine.custom.edit.part.CustomConstraintEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.custom.edit.part.CustomFinalStateEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.custom.edit.part.CustomPackageEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.custom.edit.part.CustomRegionCompartmentEditPart;
@@ -28,6 +29,7 @@ import org.eclipse.papyrus.uml.diagram.statemachine.custom.edit.part.CustomState
import org.eclipse.papyrus.uml.diagram.statemachine.custom.edit.part.CustomTransitionEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.custom.edit.part.CustomTransitionGuardEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ConnectionPointReferenceNameEditPart;
+import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ConstraintEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.FinalStateEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.PackageEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.RegionCompartmentEditPart;
@@ -76,6 +78,8 @@ public class CustomUMLEditPartFactory extends UMLEditPartFactory {
return new CustomConnectionPointReferenceNameEditPart(view);
case TransitionEditPart.VISUAL_ID:
return new CustomTransitionEditPart(view);
+ case ConstraintEditPart.VISUAL_ID:
+ return new CustomConstraintEditPart(view);
}
}
return super.createEditPart(context, model);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/figures/CustomContextLinkFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/figures/CustomContextLinkFigure.java
new file mode 100644
index 00000000000..3dbb31c43ed
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/figures/CustomContextLinkFigure.java
@@ -0,0 +1,55 @@
+/*****************************************************************************
+ * 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:
+ * Boutheina Bannour (CEA LIST) boutheina.bannour@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.statemachine.custom.figures;
+
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.PolylineDecoration;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.papyrus.uml.diagram.common.figure.edge.DashedEdgeFigure;
+
+/**
+ * Create an {@link CustomContextLinkFigure} with the tag <code>&laquo context &raquo</code>
+ *
+ */
+public class CustomContextLinkFigure extends DashedEdgeFigure {
+
+ /* label of context link does not contain information for the moment */
+ private WrappingLabel conveyedLabel;
+
+ public WrappingLabel getConveyedLabel() {
+ return conveyedLabel;
+ }
+
+ @Override
+ protected void createContents() {
+ super.createContents();
+ conveyedLabel = new WrappingLabel();
+ conveyedLabel.setOpaque(false);
+ conveyedLabel.setForegroundColor(getNameLabel().getForegroundColor());
+ conveyedLabel.setFont(getNameLabel().getFont());
+ add(conveyedLabel, 0);
+ }
+
+ /**
+ * @see org.eclipse.papyrus.uml.diagram.common.figure.edge.DashedEdgeFigure#resetStyle()
+ */
+ @Override
+ public void resetStyle() {
+ PolylineDecoration dec = new PolylineDecoration();
+ dec.setScale(15, 5);
+ dec.setLineWidth(1);
+ this.setTargetDecoration(null);
+ this.setLineStyle(Graphics.LINE_DASHDOT); // line drawing style
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/policies/CustomAppliedStereotypeContextLinkLabelDisplayEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/policies/CustomAppliedStereotypeContextLinkLabelDisplayEditPolicy.java
new file mode 100644
index 00000000000..50a5fe3f6c7
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/policies/CustomAppliedStereotypeContextLinkLabelDisplayEditPolicy.java
@@ -0,0 +1,54 @@
+/*****************************************************************************
+ * 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:
+ * Boutheina Bannour (CEA LIST) boutheina.bannour@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.statemachine.custom.policies;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLinkLabelDisplayEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusUMLElementFigure;
+
+/**
+ * Edit Policy for Applied Stereotype Label for {@link ContextLink}.
+ */
+public class CustomAppliedStereotypeContextLinkLabelDisplayEditPolicy extends AppliedStereotypeLinkLabelDisplayEditPolicy {
+
+ /**
+ * Creates the EditPolicy, with the correct tag.
+ */
+ public CustomAppliedStereotypeContextLinkLabelDisplayEditPolicy() {
+ super("context"); //$NON-NLS-1$
+ }
+
+ public void activate() {
+ // retrieve the view
+ View view = getView();
+ if(view == null) {
+ return;
+ }
+ //call the refresh overridden in this class
+ refreshDisplay();
+ }
+
+ /**
+ * Refreshes the tag display
+ */
+ protected void refreshStereotypeDisplay() {
+ IFigure figure = ((GraphicalEditPart)getHost()).getFigure();
+ // the tag displayed here is <code>&laquo context &raquo</code> see the class constructor
+ if(figure instanceof IPapyrusUMLElementFigure) {
+ ((IPapyrusUMLElementFigure)figure).setStereotypeDisplay(tag, null);
+ }
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/policies/CustomRegionCompartmentItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/policies/CustomRegionCompartmentItemSemanticEditPolicy.java
new file mode 100644
index 00000000000..b1d788a629e
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/policies/CustomRegionCompartmentItemSemanticEditPolicy.java
@@ -0,0 +1,50 @@
+/**
+ * Copyright (c) 2014 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:
+ * CEA LIST - Initial API and implementation
+ */
+package org.eclipse.papyrus.uml.diagram.statemachine.custom.policies;
+
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
+import org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandRequestWrapper;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
+import org.eclipse.papyrus.uml.diagram.statemachine.custom.commands.CustomConstraintCreateCommand;
+import org.eclipse.papyrus.uml.diagram.statemachine.edit.policies.RegionCompartmentItemSemanticEditPolicy;
+import org.eclipse.papyrus.uml.diagram.statemachine.providers.UMLElementTypes;
+
+/**
+ * Custom edit policy that handles the creation of constraints (within regions). The called custom command
+ * places the constraint into the nearest package instead of using the ownedRules attribute. The latter affects
+ * the context attribute of the constraint and prevents the use of the context link attribute.
+ */
+public class CustomRegionCompartmentItemSemanticEditPolicy extends RegionCompartmentItemSemanticEditPolicy {
+
+ @Override
+ public Command getCommand(Request request) {
+ if (request instanceof EditCommandRequestWrapper) {
+ IEditCommandRequest gmfRequest = ((EditCommandRequestWrapper) request).getEditCommandRequest();
+ if (gmfRequest instanceof CreateElementRequest) {
+ CreateElementRequest createRequest = (CreateElementRequest) gmfRequest;
+ IElementType elementType = createRequest.getElementType();
+ if (((IHintedType) elementType).getSemanticHint().equals(((IHintedType) UMLElementTypes.Constraint_668).getSemanticHint())) {
+ ICommand cmd = new CustomConstraintCreateCommand(createRequest, DiagramUtils.getDiagramFrom(getHost()));
+ return new ICommandProxy(cmd);
+ }
+ }
+ }
+ return super.getCommand(request);
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/messages.properties b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/messages.properties
index 1af4bef7c97..6541db4180c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/messages.properties
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/messages.properties
@@ -89,3 +89,5 @@ CommandName_OpenDiagram=Open Diagram
MessageFormatParser_InvalidInputError=Invalid input at {0}
UMLModelingAssistantProviderTitle=Select domain model element
UMLModelingAssistantProviderMessage=Available domain model elements:
+ContextLink3CreationTool_title=ContextLink
+ContextLink3CreationTool_desc=Creation of a context link for a Constraint
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/model/stateMachineDiagram.gmfgen b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/model/stateMachineDiagram.gmfgen
index 83cb6f9ae4c..f8653ffefda 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/model/stateMachineDiagram.gmfgen
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/model/stateMachineDiagram.gmfgen
@@ -2059,6 +2059,54 @@
href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Constraint/constrainedElement"/>
</modelFacet>
</links>
+ <links
+ visualID="8500"
+ editPartClassName="ContextLinkEditPart"
+ itemSemanticEditPolicyClassName="ContextLinkItemSemanticEditPolicy"
+ createCommandClassName="ContextLinkCreateCommand"
+ reorientCommandClassName="ContextLinkReorientCommand">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/>
+ <elementType
+ xsi:type="gmfgen:SpecializationType"/>
+ <viewmap
+ xsi:type="gmfgen:FigureViewmap"
+ figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.statemachine.custom.figures.CustomContextLinkFigure"/>
+ <behaviour
+ xsi:type="gmfgen:CustomBehaviour"
+ key="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLinkLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY"
+ editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.statemachine.custom.policies.CustomAppliedStereotypeContextLinkLabelDisplayEditPolicy"/>
+ <modelFacet
+ xsi:type="gmfgen:FeatureLinkModelFacet">
+ <metaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Constraint/context"/>
+ </modelFacet>
+ <labels
+ visualID="8501"
+ editPartClassName="ContextLinkAppliedStereotypeEditPart"
+ itemSemanticEditPolicyClassName="ContextLinkAppliedStereotypeItemSemanticEditPolicy"
+ readOnly="true">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <viewmap
+ xsi:type="gmfgen:ParentAssignedViewmap"
+ getterName="getAppliedStereotypeLabel"
+ figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel"/>
+ <behaviour
+ xsi:type="gmfgen:CustomBehaviour"
+ key="org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY"
+ editPolicyQualifiedClassName="org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.NoSemanticParserEditPolicy"/>
+ <modelFacet
+ xsi:type="gmfgen:FeatureLabelModelFacet"
+ parser="/0/@labelParsers/@implementations.0"
+ viewPattern="&lt;&lt;{0}>>"
+ editorPattern="&lt;&lt;{0}>>"
+ editPattern="&lt;&lt;{0}>>">
+ <metaFeatures
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
+ </modelFacet>
+ </labels>
+ </links>
<compartments
visualID="3002"
editPartClassName="RegionCompartmentEditPart"
@@ -2093,6 +2141,10 @@
xsi:type="gmfgen:CustomBehaviour"
key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE"
editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.statemachine.custom.policies.CustomRegionCompartmentXYLayoutEditPolicy"/>
+ <behaviour
+ xsi:type="gmfgen:CustomBehaviour"
+ key="org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.SEMANTIC_ROLE"
+ editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.statemachine.custom.policies.CustomRegionCompartmentItemSemanticEditPolicy"/>
</compartments>
<compartments
visualID="2002"
@@ -2321,6 +2373,13 @@
smallIconPath="icons/obj16/Link.gif"
createMethodName="createCommentlinkCreationTool"
genLinks="/0/@diagram/@links.2 /0/@diagram/@links.3"/>
+ <entries
+ xsi:type="gmfgen:ToolEntry"
+ title="ContextLink"
+ description="Creation of a context link for a Constraint"
+ largeIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Association.gif"
+ smallIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Association.gif"
+ genLinks="/0/@diagram/@links.4"/>
</groups>
</palette>
<preferencePages
@@ -2488,7 +2547,7 @@
extensibleViaService="true">
<implementations
xsi:type="gmfgen:PredefinedParser"
- uses="/0/@diagram/@topLevelNodes.0/@labels.0/@modelFacet /0/@diagram/@childNodes.2/@labels.0/@modelFacet /0/@diagram/@childNodes.1/@labels.0/@modelFacet /0/@diagram/@links.0/@labels.0/@modelFacet /0/@diagram/@childNodes.3/@labels.0/@modelFacet /0/@diagram/@childNodes.4/@labels.0/@modelFacet /0/@diagram/@childNodes.5/@labels.0/@modelFacet /0/@diagram/@childNodes.6/@labels.0/@modelFacet /0/@diagram/@childNodes.7/@labels.0/@modelFacet /0/@diagram/@childNodes.8/@labels.0/@modelFacet /0/@diagram/@childNodes.9/@labels.0/@modelFacet /0/@diagram/@childNodes.10/@labels.0/@modelFacet /0/@diagram/@childNodes.11/@labels.0/@modelFacet /0/@diagram/@childNodes.12/@labels.0/@modelFacet /0/@diagram/@childNodes.13/@labels.0/@modelFacet /0/@diagram/@links.1/@labels.0/@modelFacet /0/@diagram/@childNodes.15/@labels.0/@modelFacet"/>
+ uses="/0/@diagram/@topLevelNodes.0/@labels.0/@modelFacet /0/@diagram/@childNodes.2/@labels.0/@modelFacet /0/@diagram/@childNodes.1/@labels.0/@modelFacet /0/@diagram/@links.0/@labels.0/@modelFacet /0/@diagram/@childNodes.3/@labels.0/@modelFacet /0/@diagram/@childNodes.4/@labels.0/@modelFacet /0/@diagram/@childNodes.5/@labels.0/@modelFacet /0/@diagram/@childNodes.6/@labels.0/@modelFacet /0/@diagram/@childNodes.7/@labels.0/@modelFacet /0/@diagram/@childNodes.8/@labels.0/@modelFacet /0/@diagram/@childNodes.9/@labels.0/@modelFacet /0/@diagram/@childNodes.10/@labels.0/@modelFacet /0/@diagram/@childNodes.11/@labels.0/@modelFacet /0/@diagram/@childNodes.12/@labels.0/@modelFacet /0/@diagram/@childNodes.13/@labels.0/@modelFacet /0/@diagram/@links.1/@labels.0/@modelFacet /0/@diagram/@childNodes.15/@labels.0/@modelFacet /0/@diagram/@links.4/@labels.0/@modelFacet"/>
<implementations
xsi:type="gmfgen:CustomParser"
uses="/0/@diagram/@links.0/@labels.2/@modelFacet /0/@diagram/@childNodes.1/@labels.1/@modelFacet /0/@diagram/@childNodes.3/@labels.1/@modelFacet /0/@diagram/@childNodes.4/@labels.1/@modelFacet /0/@diagram/@childNodes.5/@labels.1/@modelFacet /0/@diagram/@childNodes.6/@labels.1/@modelFacet /0/@diagram/@childNodes.7/@labels.1/@modelFacet /0/@diagram/@childNodes.8/@labels.1/@modelFacet /0/@diagram/@childNodes.9/@labels.1/@modelFacet /0/@diagram/@childNodes.10/@labels.1/@modelFacet /0/@diagram/@childNodes.11/@labels.1/@modelFacet /0/@diagram/@childNodes.12/@labels.1/@modelFacet /0/@diagram/@childNodes.13/@labels.1/@modelFacet"
@@ -2575,5 +2634,10 @@
genView="/0/@diagram/@childNodes.1 /0/@diagram/@childNodes.3 /0/@diagram/@childNodes.4 /0/@diagram/@childNodes.5 /0/@diagram/@childNodes.6 /0/@diagram/@childNodes.7 /0/@diagram/@childNodes.8 /0/@diagram/@childNodes.9 /0/@diagram/@childNodes.10"
name="UMLNodeEditPart"
superOwnedEditPart="org.eclipse.papyrus.uml.diagram.common.editparts.UMLNodeEditPart"/>
+ <extensionNodes
+ xsi:type="papyrusgmfgenextension:ExtendedGenView"
+ genView="/0/@diagram/@childNodes.15"
+ name="ConstraintEditPart extension"
+ superOwnedEditPart="org.eclipse.papyrus.uml.diagram.common.editparts.AbstractConstraintEditPart"/>
</papyrusgmfgenextension:PapyrusExtensionRootNode>
</xmi:XMI>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/plugin.properties b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/plugin.properties
index 4ea5594ee55..f57940edba7 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/plugin.properties
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/plugin.properties
@@ -49,3 +49,4 @@ metatype.name.Behavior_691=DoActivityStateBehavior
metatype.name.Behavior_692=ExitStateBehavior
metatype.name.CommentAnnotatedElement_667=Undefined
metatype.name.ConstraintConstrainedElement_670=Undefined
+metatype.name.ConstraintContext_8500=Undefined
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/plugin.xml b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/plugin.xml
index 4bd88bec7bb..8d3ca3f790f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/plugin.xml
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/plugin.xml
@@ -1,21 +1,21 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<!--
- Copyright (c) 2009, 2014 MOSKitt, CEA and others.
-
- 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:
- MOSKitt - Initial API and implementation
- Christian W. Damus (CEA) - bug 323802
-
--->
-<plugin>
-
-
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<!--
+ Copyright (c) 2009, 2014 MOSKitt, CEA and others.
+
+ 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:
+ MOSKitt - Initial API and implementation
+ Christian W. Damus (CEA) - bug 323802
+
+-->
+<plugin>
+
+
<extension point="org.eclipse.gmf.runtime.common.ui.services.markerNavigationProviders" id="markers-navigation">
<?gmfgen generated="true"?>
<MarkerNavigationProvider class="org.eclipse.papyrus.uml.diagram.statemachine.providers.UMLMarkerNavigationProvider">
@@ -23,19 +23,19 @@
<Priority name="Lowest"/>
</MarkerNavigationProvider>
</extension>
-
+
<extension id="diagnostic" name="PapyrusUMLStateMachineDiagram problems" point="org.eclipse.core.resources.markers">
<?gmfgen generated="true"?>
<super type="org.eclipse.core.resources.problemmarker"/>
<super type="org.eclipse.gmf.runtime.common.ui.services.marker"/>
<persistent value="true"/>
- </extension>
-
+ </extension>
+
<extension point="org.eclipse.core.runtime.preferences" id="prefs">
<?gmfgen generated="true"?>
<initializer class="org.eclipse.papyrus.uml.diagram.statemachine.preferences.DiagramPreferenceInitializer"/>
</extension>
-
+
<extension point="org.eclipse.ui.preferencePages" id="prefpages">
<?gmfgen generated="true"?>
<page
@@ -57,7 +57,7 @@
class="org.eclipse.papyrus.uml.diagram.statemachine.preferences.DiagramRulersAndGridPreferencePage">
</page>
</extension>
-
+
<extension point="org.eclipse.ui.views.properties.tabbed.propertyContributor" id="prop-contrib">
<?gmfgen generated="true"?>
<propertyContributor
@@ -68,7 +68,7 @@
<propertyCategory category="extra"/>
</propertyContributor>
</extension>
-
+
<extension point="org.eclipse.ui.views.properties.tabbed.propertyTabs" id="proptabs">
<?gmfgen generated="true"?>
<propertyTabs contributorId="org.eclipse.papyrus.uml.diagram.statemachine">
@@ -94,7 +94,7 @@
label="%tab.domain"/>
</propertyTabs>
</extension>
-
+
<extension point="org.eclipse.ui.views.properties.tabbed.propertySections" id="propsections">
<?gmfgen generated="true"?>
<propertySections contributorId="org.eclipse.papyrus.uml.diagram.statemachine">
@@ -141,21 +141,21 @@
</propertySection>
</propertySections>
</extension>
-
-
-<?gmfgen generated="true"?>
-
-
+
+
+<?gmfgen generated="true"?>
+
+
<extension point="org.eclipse.gmf.runtime.diagram.core.viewProviders" id="view-provider">
<?gmfgen generated="true"?>
<viewProvider class="org.eclipse.papyrus.uml.diagram.statemachine.providers.UMLViewProvider">
<Priority name="Lowest"/>
<context viewClass="org.eclipse.gmf.runtime.notation.Diagram" semanticHints="PapyrusUMLStateMachineDiagram"/>
<context viewClass="org.eclipse.gmf.runtime.notation.Node" semanticHints="2000,3000,5000,6000,8000,9000,10000,11000,12000,13000,14000,15000,16000,17000,18000,666,668,680,690,691,692"/>
- <context viewClass="org.eclipse.gmf.runtime.notation.Edge" semanticHints="7000,19000,667,670"/>
+ <context viewClass="org.eclipse.gmf.runtime.notation.Edge" semanticHints="7000,19000,667,670,8500"/>
</viewProvider>
</extension>
-
+
<extension point="org.eclipse.gmf.runtime.diagram.ui.editpartProviders" id="ep-provider">
<?gmfgen generated="true"?>
<editpartProvider class="org.eclipse.papyrus.uml.diagram.statemachine.providers.UMLEditPartProvider">
@@ -167,7 +167,7 @@
<method name="getType()" value="2000,3000,5000,6000,8000,9000,10000,11000,12000,13000,14000,15000,16000,17000,18000,666,668,680,690,691,692"/>
</object>
<object class="org.eclipse.gmf.runtime.notation.Edge" id="generated-links">
- <method name="getType()" value="7000,19000,667,670"/>
+ <method name="getType()" value="7000,19000,667,670,8500"/>
</object>
<object class="org.eclipse.gmf.runtime.notation.Node" id="generated-labels">
<method name="getType()" value="2001,5001,5002,6001,8001,8002,9001,9002,10001,10002,11001,11002,12001,12002,13001,13002,14001,14002,15001,15002,16001,16002,17001,17002,18001,18002,6666,6668,6669"/>
@@ -178,22 +178,22 @@
<context views="generated-diagram,generated-nodes,generated-links,generated-labels,generated-compartments"/>
</editpartProvider>
</extension>
-
-
+
+
<extension point="org.eclipse.gmf.runtime.common.ui.services.iconProviders" id="icon-provider">
<?gmfgen generated="true"?>
<IconProvider class="org.eclipse.papyrus.uml.diagram.statemachine.providers.UMLIconProvider">
<Priority name="Low"/>
</IconProvider>
</extension>
-
+
<extension point="org.eclipse.gmf.runtime.common.ui.services.parserProviders" id="parser-provider">
<?gmfgen generated="true"?>
<ParserProvider class="org.eclipse.papyrus.uml.diagram.statemachine.providers.UMLParserProvider">
<Priority name="Lowest"/>
</ParserProvider>
</extension>
-
+
<extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypes" id="element-types">
<?gmfgen generated="true"?>
<metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
@@ -453,8 +453,17 @@
<param name="semanticHint" value="670"/>
</specializationType>
</metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ <specializationType
+ id="org.eclipse.papyrus.uml.diagram.statemachine.ConstraintContext_8500"
+ name="%metatype.name.ConstraintContext_8500"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
+ <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
+ <param name="semanticHint" value="8500"/>
+ </specializationType>
+ </metamodel>
</extension>
-
+
<extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypeBindings" id="element-types-bindings">
<?gmfgen generated="true"?>
<clientContext id="org.eclipse.papyrus.uml.diagram.statemachine.TypeContext">
@@ -491,12 +500,13 @@
<elementType ref="org.eclipse.papyrus.uml.diagram.statemachine.Generalization_19000"/>
<elementType ref="org.eclipse.papyrus.uml.diagram.statemachine.CommentAnnotatedElement_667"/>
<elementType ref="org.eclipse.papyrus.uml.diagram.statemachine.ConstraintConstrainedElement_670"/>
+ <elementType ref="org.eclipse.papyrus.uml.diagram.statemachine.ConstraintContext_8500"/>
<advice ref="org.eclipse.gmf.runtime.diagram.core.advice.notationDepdendents"/>
</binding>
</extension>
-
-
-
+
+
+
<extension point="org.eclipse.ui.commands" id="update-cmd">
<?gmfgen generated="true"?>
<command
@@ -506,7 +516,7 @@
id="org.eclipse.papyrus.uml.diagram.statemachine.updateDiagram"
name="%update.diagram.name"/>
</extension>
-
+
<extension point="org.eclipse.ui.bindings" id="update-cmd-binding">
<?gmfgen generated="true"?>
<key
@@ -515,7 +525,7 @@
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
sequence="F5"/>
</extension>
-
+
<extension point="org.eclipse.ui.menus" id="context-menus">
<?gmfgen generated="true"?>
<!-- menuContribution locationURI="menu:org.eclipse.ui.main.menu?after=">
@@ -535,7 +545,7 @@
</command>
</menuContribution>
</extension>
-
+
<extension point="org.eclipse.ui.commands" id="menu-commands">
<?gmfgen generated="true"?>
<category id="org.eclipse.papyrus.uml.diagram.statemachine.part.UMLDiagramEditorID" name="%cmdcategory.name" description="%cmdcategory.desc"/>
@@ -544,91 +554,219 @@
categoryId="org.eclipse.papyrus.uml.diagram.statemachine.part.UMLDiagramEditorID"
defaultHandler="org.eclipse.papyrus.uml.diagram.statemachine.part.LoadResourceAction"/>
</extension>
-
-<!-- Diagram creation command and handler -->
-<extension point="org.eclipse.ui.commands">
- <command id="org.eclipse.papyrus.uml.diagram.statemachine.CreationCommand"
- name="Create a new StateMachine Diagram"
- description="Create a new StateMachine Diagram"
- categoryId="org.eclipse.papyrus.editor.category"/>
-</extension>
-
-
-<!-- Diagram creation command registration in menu and toolbar -->
-
- <extension
- point="org.eclipse.papyrus.infra.core.papyrusDiagram">
- <editorDiagram
- actionBarContributorId="org.eclipse.papyrus.uml.diagram.common.part.UMLDiagramActionBarContributor"
- factoryClass="org.eclipse.papyrus.uml.diagram.statemachine.StateMachineDiagramEditorFactory"
- icon="icons/obj16/Diagram_StateMachine.gif">
- </editorDiagram>
- <creationCommand
- creationCommandClass="org.eclipse.papyrus.uml.diagram.statemachine.CreateStateMachineDiagramCommand"
- creationCondition="org.eclipse.papyrus.uml.diagram.statemachine.StateMachineDiagramCreationCondition"
- icon="icons/obj16/Diagram_StateMachine.gif"
- id="org.eclipse.papyrus.uml.diagram.statemachine.CreationCommand"
- language="uml"
- label="UML StateMachine Diagram">
- </creationCommand>
- </extension>
-
-<extension
- point="org.eclipse.gmf.runtime.diagram.ui.editpartProviders">
- <editpartProvider
- class="org.eclipse.papyrus.uml.diagram.statemachine.custom.providers.CustomUMLEditPartProvider">
- <Priority
- name="Highest">
- </Priority>
- <object
- class="org.eclipse.gmf.runtime.notation.Diagram"
- id="generated-diagram">
- <method
- name="getType()"
- value="PapyrusUMLStateMachineDiagram">
- </method>
- </object>
- <object
- class="org.eclipse.gmf.runtime.notation.Node"
- id="generated-nodes">
- <method
- name="getType()"
- value="2000,3000,4000">
- </method>
- </object>
- <object
- class="org.eclipse.gmf.runtime.notation.Edge"
- id="generated-links">
- <method
- name="getType()">
- </method>
- </object>
- <object
- class="org.eclipse.gmf.runtime.notation.Node"
- id="generated-labels">
- <method
- name="getType()"
- value="2001,3001">
- </method>
- </object>
- <object
- class="org.eclipse.gmf.runtime.notation.Node"
- id="generated-compartments">
- <method
- name="getType()"
- value="3002,2002,4002">
- </method>
- </object>
- <context
- views="generated-diagram,generated-nodes,generated-links,generated-labels,generated-compartments">
- </context>
- </editpartProvider>
-</extension>
-
-
-
-
-
+
+<!-- Diagram creation command and handler -->
+<extension point="org.eclipse.ui.commands">
+ <command id="org.eclipse.papyrus.uml.diagram.statemachine.CreationCommand"
+ name="Create a new StateMachine Diagram"
+ description="Create a new StateMachine Diagram"
+ categoryId="org.eclipse.papyrus.editor.category"/>
+</extension>
+
+
+<!-- Diagram creation command registration in menu and toolbar -->
+
+ <extension
+ point="org.eclipse.papyrus.infra.core.papyrusDiagram">
+ <editorDiagram
+ actionBarContributorId="org.eclipse.papyrus.uml.diagram.common.part.UMLDiagramActionBarContributor"
+ factoryClass="org.eclipse.papyrus.uml.diagram.statemachine.StateMachineDiagramEditorFactory"
+ icon="icons/obj16/Diagram_StateMachine.gif">
+ </editorDiagram>
+ <creationCommand
+ creationCommandClass="org.eclipse.papyrus.uml.diagram.statemachine.CreateStateMachineDiagramCommand"
+ creationCondition="org.eclipse.papyrus.uml.diagram.statemachine.StateMachineDiagramCreationCondition"
+ icon="icons/obj16/Diagram_StateMachine.gif"
+ id="org.eclipse.papyrus.uml.diagram.statemachine.CreationCommand"
+ language="uml"
+ label="UML StateMachine Diagram">
+ </creationCommand>
+ </extension>
+
+<extension
+ point="org.eclipse.gmf.runtime.diagram.ui.editpartProviders">
+ <editpartProvider
+ class="org.eclipse.papyrus.uml.diagram.statemachine.custom.providers.CustomUMLEditPartProvider">
+ <Priority
+ name="Highest">
+ </Priority>
+ <object
+ class="org.eclipse.gmf.runtime.notation.Diagram"
+ id="generated-diagram">
+ <method
+ name="getType()"
+ value="PapyrusUMLStateMachineDiagram">
+ </method>
+ </object>
+ <object
+ class="org.eclipse.gmf.runtime.notation.Node"
+ id="generated-nodes">
+ <method
+ name="getType()"
+ value="2000,3000,4000">
+ </method>
+ </object>
+ <object
+ class="org.eclipse.gmf.runtime.notation.Edge"
+ id="generated-links">
+ <method
+ name="getType()">
+ </method>
+ </object>
+ <object
+ class="org.eclipse.gmf.runtime.notation.Node"
+ id="generated-labels">
+ <method
+ name="getType()"
+ value="2001,3001">
+ </method>
+ </object>
+ <object
+ class="org.eclipse.gmf.runtime.notation.Node"
+ id="generated-compartments">
+ <method
+ name="getType()"
+ value="3002,2002,4002">
+ </method>
+ </object>
+ <context
+ views="generated-diagram,generated-nodes,generated-links,generated-labels,generated-compartments">
+ </context>
+ </editpartProvider>
+</extension>
+
+
+
+
+
+
+<extension point="org.eclipse.ui.handlers" id="menu-handlers">
+ <?gmfgen generated="true"?>
+ </extension>
+<extension
+ id="ui-context"
+ point="org.eclipse.ui.contexts">
+ <context
+ description="%context.description"
+ id="org.eclipse.papyrus.uml.diagram.statemachine.ui.diagramContext"
+ name="%context.name"
+ parentId="org.eclipse.gmf.runtime.diagram.ui.diagramContext">
+ </context>
+</extension>
+<extension id="validationDecoratorProvider" name="ValidationDecorations" point="org.eclipse.gmf.runtime.diagram.ui.decoratorProviders">
+ <?gmfgen generated="true"?>
+ <decoratorProvider class="org.eclipse.papyrus.uml.diagram.statemachine.providers.UMLValidationDecoratorProvider">
+ <Priority name="Lowest"/>
+ <object class="org.eclipse.gmf.runtime.diagram.ui.editparts.IPrimaryEditPart(org.eclipse.gmf.runtime.diagram.ui)" id="PRIMARY_VIEW"/>
+ <context decoratorTargets="PRIMARY_VIEW"/>
+ </decoratorProvider>
+ </extension>
+<extension point="org.eclipse.emf.validation.constraintProviders">
+ <?gmfgen generated="true"?>
+ <category id="org.eclipse.uml2.uml.util.UMLValidator.validateInternalTransition" mandatory="false" name="validateInternalTransition">
+ <![CDATA[Validate internal transition]]>
+ </category>
+ <constraintProvider cache="true">
+ <package namespaceUri="http://www.eclipse.org/uml2/5.0.0/UML"/>
+ <constraints categories="org.eclipse.uml2.uml.util.UMLValidator.validateInternalTransition">
+ <constraint id="org.eclipse.uml2.uml.util.UMLValidator.validateInternalTransition_sameTargetAndSrouce"
+ lang="OCL"
+ name="validateInternalTransitionEnd"
+ mode="Live"
+ severity="ERROR" statusCode="200">
+ <![CDATA[(kind = TransitionKind::internal) implies (source.oclIsKindOf (State) and source = target)]]>
+ <description><![CDATA[Validate that internal transition has the same state for source and target]]></description>
+ <message><![CDATA[Validate that internal transition has the same state for source and target]]></message>
+ <target class="uml.Transition"/>
+ </constraint>
+ </constraints>
+ </constraintProvider>
+ </extension>
+
+<extension point="org.eclipse.emf.validation.constraintBindings">
+ <?gmfgen generated="true"?>
+ <clientContext default="false" id="org.eclipse.papyrus.uml.diagram.statemachineDefaultCtx">
+ <selector class="org.eclipse.papyrus.uml.diagram.statemachine.providers.UMLValidationProvider$DefaultCtx"/>
+ </clientContext>
+ <binding context="org.eclipse.papyrus.uml.diagram.statemachineDefaultCtx">
+ <constraint ref="org.eclipse.papyrus.uml.diagram.statemachine.org.eclipse.uml2.uml.util.UMLValidator.validateInternalTransition_sameTargetAndSrouce"/>
+ </binding>
+
+ </extension>
+
+<extension point="org.eclipse.emf.validation.ui.UIRegisteredClientContext">
+ <?gmfgen generated="true"?>
+ <clientContext id="org.eclipse.papyrus.uml.diagram.statemachineDefaultCtx"/>
+ </extension>
+
+ <extension
+ point="org.eclipse.emf.transaction.listeners">
+ <listener
+ class="org.eclipse.papyrus.uml.diagram.statemachine.custom.listeners.StateBehaviorsListener">
+ <editingDomain
+ id="org.eclipse.papyrus.SharedEditingDomainID">
+ </editingDomain>
+ </listener>
+ <listener
+ class="org.eclipse.papyrus.uml.diagram.statemachine.custom.listeners.InternalStateListener">
+ <editingDomain
+ id="org.eclipse.papyrus.SharedEditingDomainID">
+ </editingDomain>
+ </listener>
+ </extension>
+
+
+ <!-- optionally, specify keybindings -->
+
+ <!-- Diagram specific advices -->
+<extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypes">
+
+ <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
+
+ <!-- Region specific advice (eventually adapt other regions, if a region gets deleted -->
+ <adviceBinding id="org.eclipse.papyrus.uml.diagram.statemachine.custom.helpers.advice.RegionHelperAdvice"
+ class="org.eclipse.papyrus.uml.diagram.statemachine.custom.helpers.advice.RegionHelperAdvice"
+ inheritance="all" typeId="org.eclipse.papyrus.uml.Region">
+ </adviceBinding>
+
+ </metamodel>
+</extension>
+
+<!-- UML ElementType bindings to Papyrus shared IClientContext -->
+<extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypeBindings">
+
+ <!-- Bindings declaration to shared IClientContext -->
+ <binding context="org.eclipse.papyrus.infra.services.edit.TypeContext">
+ <elementType ref="org.eclipse.papyrus.uml.diagram.statemachine.custom.helpers.advice.RegionHelperAdvice"/>
+ </binding>
+
+</extension>
+<extension point="org.eclipse.papyrus.infra.gmfdiag.common.notationTypesMapping">
+ <diagramMappings diagramID="PapyrusUMLStateMachineDiagram">
+ <mapping type="PapyrusUMLStateMachineDiagram" humanReadableType="StateMachineDiagram"/>
+
+ <mapping
+ humanReadableType="Region"
+ type="3002">
+ </mapping>
+
+ <mapping
+ humanReadableType="StateMachine"
+ type="2002">
+ </mapping>
+
+ <mapping
+ humanReadableType="State"
+ type="6002">
+ </mapping>
+ </diagramMappings>
+ </extension>
+
+
+
+
+
+
<extension
id="PapyrusUMLStateMachineDiagram.palettedefinition"
name="PapyrusUMLStateMachineDiagram Predefined Entries"
@@ -823,25 +961,22 @@
path=""
small_icon="icons/obj16/Link.gif">
</entry>
+ <entry
+ defineOnly="true"
+ description="Creation of a context link for a Constraint"
+ id="createContextLink3CreationTool"
+ kind="tool"
+ label="ContextLink"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Association.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Association.gif">
+ </entry>
</contribution>
</paletteProvider>
</extension>
-
-<extension point="org.eclipse.ui.handlers" id="menu-handlers">
- <?gmfgen generated="true"?>
- </extension>
-<extension
- id="ui-context"
- point="org.eclipse.ui.contexts">
- <context
- description="%context.description"
- id="org.eclipse.papyrus.uml.diagram.statemachine.ui.diagramContext"
- name="%context.name"
- parentId="org.eclipse.gmf.runtime.diagram.ui.diagramContext">
- </context>
-</extension>
+
<extension
id="PapyrusUMLStateMachineDiagram.standard"
name="PapyrusUMLStateMachineDiagram Standard Palette"
@@ -952,118 +1087,16 @@
id="createCommentlinkCreationTool"
path="/createEdgesGroup">
</predefinedEntry>
+ <predefinedEntry
+ id="createContextLink3CreationTool"
+ path="/createEdgesGroup">
+ </predefinedEntry>
</contribution>
<editor id="org.eclipse.papyrus.uml.diagram.statemachine"/>
</paletteProvider>
</extension>
-<extension id="validationDecoratorProvider" name="ValidationDecorations" point="org.eclipse.gmf.runtime.diagram.ui.decoratorProviders">
- <?gmfgen generated="true"?>
- <decoratorProvider class="org.eclipse.papyrus.uml.diagram.statemachine.providers.UMLValidationDecoratorProvider">
- <Priority name="Lowest"/>
- <object class="org.eclipse.gmf.runtime.diagram.ui.editparts.IPrimaryEditPart(org.eclipse.gmf.runtime.diagram.ui)" id="PRIMARY_VIEW"/>
- <context decoratorTargets="PRIMARY_VIEW"/>
- </decoratorProvider>
- </extension>
-<extension point="org.eclipse.emf.validation.constraintProviders">
- <?gmfgen generated="true"?>
- <category id="org.eclipse.uml2.uml.util.UMLValidator.validateInternalTransition" mandatory="false" name="validateInternalTransition">
- <![CDATA[Validate internal transition]]>
- </category>
- <constraintProvider cache="true">
- <package namespaceUri="http://www.eclipse.org/uml2/5.0.0/UML"/>
- <constraints categories="org.eclipse.uml2.uml.util.UMLValidator.validateInternalTransition">
- <constraint id="org.eclipse.uml2.uml.util.UMLValidator.validateInternalTransition_sameTargetAndSrouce"
- lang="OCL"
- name="validateInternalTransitionEnd"
- mode="Live"
- severity="ERROR" statusCode="200">
- <![CDATA[(kind = TransitionKind::internal) implies (source.oclIsKindOf (State) and source = target)]]>
- <description><![CDATA[Validate that internal transition has the same state for source and target]]></description>
- <message><![CDATA[Validate that internal transition has the same state for source and target]]></message>
- <target class="uml.Transition"/>
- </constraint>
- </constraints>
- </constraintProvider>
- </extension>
-
-<extension point="org.eclipse.emf.validation.constraintBindings">
- <?gmfgen generated="true"?>
- <clientContext default="false" id="org.eclipse.papyrus.uml.diagram.statemachineDefaultCtx">
- <selector class="org.eclipse.papyrus.uml.diagram.statemachine.providers.UMLValidationProvider$DefaultCtx"/>
- </clientContext>
- <binding context="org.eclipse.papyrus.uml.diagram.statemachineDefaultCtx">
- <constraint ref="org.eclipse.papyrus.uml.diagram.statemachine.org.eclipse.uml2.uml.util.UMLValidator.validateInternalTransition_sameTargetAndSrouce"/>
- </binding>
- </extension>
-
-<extension point="org.eclipse.emf.validation.ui.UIRegisteredClientContext">
- <?gmfgen generated="true"?>
- <clientContext id="org.eclipse.papyrus.uml.diagram.statemachineDefaultCtx"/>
- </extension>
-
- <extension
- point="org.eclipse.emf.transaction.listeners">
- <listener
- class="org.eclipse.papyrus.uml.diagram.statemachine.custom.listeners.StateBehaviorsListener">
- <editingDomain
- id="org.eclipse.papyrus.SharedEditingDomainID">
- </editingDomain>
- </listener>
- <listener
- class="org.eclipse.papyrus.uml.diagram.statemachine.custom.listeners.InternalStateListener">
- <editingDomain
- id="org.eclipse.papyrus.SharedEditingDomainID">
- </editingDomain>
- </listener>
- </extension>
-
-
- <!-- optionally, specify keybindings -->
-
- <!-- Diagram specific advices -->
-<extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypes">
-
- <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
-
- <!-- Region specific advice (eventually adapt other regions, if a region gets deleted -->
- <adviceBinding id="org.eclipse.papyrus.uml.diagram.statemachine.custom.helpers.advice.RegionHelperAdvice"
- class="org.eclipse.papyrus.uml.diagram.statemachine.custom.helpers.advice.RegionHelperAdvice"
- inheritance="all" typeId="org.eclipse.papyrus.uml.Region">
- </adviceBinding>
-
- </metamodel>
-</extension>
-
-<!-- UML ElementType bindings to Papyrus shared IClientContext -->
-<extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypeBindings">
-
- <!-- Bindings declaration to shared IClientContext -->
- <binding context="org.eclipse.papyrus.infra.services.edit.TypeContext">
- <elementType ref="org.eclipse.papyrus.uml.diagram.statemachine.custom.helpers.advice.RegionHelperAdvice"/>
- </binding>
-
-</extension>
-<extension point="org.eclipse.papyrus.infra.gmfdiag.common.notationTypesMapping">
- <diagramMappings diagramID="PapyrusUMLStateMachineDiagram">
- <mapping type="PapyrusUMLStateMachineDiagram" humanReadableType="StateMachineDiagram"/>
-
- <mapping
- humanReadableType="Region"
- type="3002">
- </mapping>
-
- <mapping
- humanReadableType="StateMachine"
- type="2002">
- </mapping>
-
- <mapping
- humanReadableType="State"
- type="6002">
- </mapping>
- </diagramMappings>
- </extension>
-
-</plugin>
+
+
+</plugin>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/commands/ContextLinkCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/commands/ContextLinkCreateCommand.java
new file mode 100644
index 00000000000..42a4213b7cd
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/commands/ContextLinkCreateCommand.java
@@ -0,0 +1,102 @@
+/**
+ * Copyright (c) 2014 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:
+ * CEA LIST - Initial API and implementation
+ */
+package org.eclipse.papyrus.uml.diagram.statemachine.edit.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.papyrus.uml.diagram.statemachine.edit.policies.UMLBaseItemSemanticEditPolicy;
+import org.eclipse.uml2.uml.Constraint;
+import org.eclipse.uml2.uml.Namespace;
+
+/**
+ * @generated
+ */
+public class ContextLinkCreateCommand extends EditElementCommand {
+
+ /**
+ * @generated
+ */
+ protected final EObject source;
+
+ /**
+ * @generated
+ */
+ protected final EObject target;
+
+ /**
+ * @generated
+ */
+ public ContextLinkCreateCommand(CreateRelationshipRequest request, EObject source, EObject target) {
+ super(request.getLabel(), null, request);
+ this.source = source;
+ this.target = target;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute() {
+ if(source == null && target == null) {
+ return false;
+ }
+ if(source != null && false == source instanceof Constraint) {
+ return false;
+ }
+ if(target != null && false == target instanceof Namespace) {
+ return false;
+ }
+ if(getSource() == null) {
+ return true; // link creation is in progress; source is not defined yet
+ }
+ // target may be null here but it's possible to check constraint
+ return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canCreateConstraintContext_8500(getSource(), getTarget());
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ if(!canExecute()) {
+ throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
+ }
+ if(getSource() != null && getTarget() != null) {
+ getSource().setContext(getTarget());
+ }
+ return CommandResult.newOKCommandResult();
+ }
+
+ /**
+ * @generated
+ */
+ protected void setElementToEdit(EObject element) {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * @generated
+ */
+ protected Constraint getSource() {
+ return (Constraint)source;
+ }
+
+ /**
+ * @generated
+ */
+ protected Namespace getTarget() {
+ return (Namespace)target;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/commands/ContextLinkReorientCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/commands/ContextLinkReorientCommand.java
new file mode 100644
index 00000000000..d0b722192d8
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/commands/ContextLinkReorientCommand.java
@@ -0,0 +1,158 @@
+/**
+ * Copyright (c) 2014 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:
+ * CEA LIST - Initial API and implementation
+ */
+package org.eclipse.papyrus.uml.diagram.statemachine.edit.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.papyrus.uml.diagram.statemachine.edit.policies.UMLBaseItemSemanticEditPolicy;
+import org.eclipse.uml2.uml.Constraint;
+import org.eclipse.uml2.uml.Namespace;
+
+/**
+ * @generated
+ */
+public class ContextLinkReorientCommand extends EditElementCommand {
+
+ /**
+ * @generated
+ */
+ private final int reorientDirection;
+
+ /**
+ * @generated
+ */
+ private final EObject referenceOwner;
+
+ /**
+ * @generated
+ */
+ private final EObject oldEnd;
+
+ /**
+ * @generated
+ */
+ private final EObject newEnd;
+
+ /**
+ * @generated
+ */
+ public ContextLinkReorientCommand(ReorientReferenceRelationshipRequest request) {
+ super(request.getLabel(), null, request);
+ reorientDirection = request.getDirection();
+ referenceOwner = request.getReferenceOwner();
+ oldEnd = request.getOldRelationshipEnd();
+ newEnd = request.getNewRelationshipEnd();
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute() {
+ if(false == referenceOwner instanceof Constraint) {
+ return false;
+ }
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ return canReorientSource();
+ }
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ return canReorientTarget();
+ }
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean canReorientSource() {
+ if(!(oldEnd instanceof Namespace && newEnd instanceof Constraint)) {
+ return false;
+ }
+ return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistConstraintContext_8500(getNewSource(), getOldTarget());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean canReorientTarget() {
+ if(!(oldEnd instanceof Namespace && newEnd instanceof Namespace)) {
+ return false;
+ }
+ return UMLBaseItemSemanticEditPolicy.getLinkConstraints().canExistConstraintContext_8500(getOldSource(), getNewTarget());
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ if(!canExecute()) {
+ throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
+ }
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ return reorientSource();
+ }
+ if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ return reorientTarget();
+ }
+ throw new IllegalStateException();
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult reorientSource() throws ExecutionException {
+ getOldSource().setContext(null);
+ getNewSource().setContext(getOldTarget());
+ return CommandResult.newOKCommandResult(referenceOwner);
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult reorientTarget() throws ExecutionException {
+ getOldSource().setContext(getNewTarget());
+ return CommandResult.newOKCommandResult(referenceOwner);
+ }
+
+ /**
+ * @generated
+ */
+ protected Constraint getOldSource() {
+ return (Constraint)referenceOwner;
+ }
+
+ /**
+ * @generated
+ */
+ protected Constraint getNewSource() {
+ return (Constraint)newEnd;
+ }
+
+ /**
+ * @generated
+ */
+ protected Namespace getOldTarget() {
+ return (Namespace)oldEnd;
+ }
+
+ /**
+ * @generated
+ */
+ protected Namespace getNewTarget() {
+ return (Namespace)newEnd;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/parts/ConstraintEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/parts/ConstraintEditPart.java
index 1dda682009a..ee4bc1f2f18 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/parts/ConstraintEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/parts/ConstraintEditPart.java
@@ -12,6 +12,7 @@
package org.eclipse.papyrus.uml.diagram.statemachine.edit.parts;
import org.eclipse.draw2d.IFigure;
+import org.eclipse.emf.common.notify.Notification;
import org.eclipse.gef.EditPart;
import org.eclipse.gef.EditPolicy;
import org.eclipse.gef.Request;
@@ -28,6 +29,7 @@ import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.infra.gmfdiag.common.editpart.NodeEditPart;
import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.IPapyrusNodeFigure;
import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.SelectableBorderedNodeFigure;
+import org.eclipse.papyrus.uml.diagram.common.editparts.AbstractConstraintEditPart;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy;
import org.eclipse.papyrus.uml.diagram.common.figure.node.ConstraintFigure;
@@ -38,7 +40,7 @@ import org.eclipse.swt.graphics.Color;
/**
* @generated
*/
-public class ConstraintEditPart extends NodeEditPart {
+public class ConstraintEditPart extends AbstractConstraintEditPart {
/**
* @generated
@@ -100,6 +102,14 @@ public class ConstraintEditPart extends NodeEditPart {
}
/**
+ *Papyrus codeGen
+ *@generated
+ **/
+ protected void handleNotificationEvent(Notification event) {
+ super.handleNotificationEvent(event);
+ }
+
+ /**
* @generated
*/
protected IFigure createNodeShape() {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/parts/ContextLinkAppliedStereotypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/parts/ContextLinkAppliedStereotypeEditPart.java
new file mode 100644
index 00000000000..b350d345637
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/parts/ContextLinkAppliedStereotypeEditPart.java
@@ -0,0 +1,753 @@
+/**
+ * Copyright (c) 2014 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:
+ * CEA LIST - Initial API and implementation
+ */
+package org.eclipse.papyrus.uml.diagram.statemachine.edit.parts;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.ConnectionLocator;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.AccessibleEditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.gmf.tooling.runtime.edit.policies.DefaultLinkLabelDragPolicy;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.viewers.ICellEditorValidator;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.extensionpoints.editors.Activator;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.ICustomDirectEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
+import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
+import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
+import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IControlParserForDirectEdit;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusLabelEditPart;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.NoSemanticParserEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
+import org.eclipse.papyrus.uml.diagram.statemachine.edit.policies.UMLTextSelectionEditPolicy;
+import org.eclipse.papyrus.uml.diagram.statemachine.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.uml.diagram.statemachine.providers.UMLElementTypes;
+import org.eclipse.papyrus.uml.diagram.statemachine.providers.UMLParserProvider;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.custom.BusyIndicator;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.Feature;
+
+/**
+ * @generated
+ */
+public class ContextLinkAppliedStereotypeEditPart extends PapyrusLabelEditPart implements ITextAwareEditPart, IControlParserForDirectEdit {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 8501;
+
+ /**
+ * @generated
+ */
+ private DirectEditManager manager;
+
+ /**
+ * @generated
+ */
+ private IParser parser;
+
+ /**
+ * @generated
+ */
+ private List<?> parserElements;
+
+ /**
+ * @generated
+ */
+ private String defaultText;
+
+ /**
+ * direct edition mode (default, undefined, registered editor, etc.)
+ * @generated
+ */
+ protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
+
+ /**
+ * configuration from a registered edit dialog
+ * @generated
+ */
+ protected IDirectEditorConfiguration configuration;
+ /**
+ * @generated
+ */
+ static {
+ registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ContextLinkAppliedStereotypeEditPart.VISUAL_ID), new Point(0, 0));
+ }
+
+ /**
+ * @generated
+ */
+ public ContextLinkAppliedStereotypeEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
+ installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DefaultLinkLabelDragPolicy());
+ installEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY, new NoSemanticParserEditPolicy());
+ }
+
+ /**
+ * @generated
+ */
+ public int getKeyPoint() {
+ return ConnectionLocator.MIDDLE;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelTextHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getText();
+ } else if(figure instanceof ILabelFigure) {
+ return ((ILabelFigure)figure).getText();
+ } else {
+ return ((Label)figure).getText();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelTextHelper(IFigure figure, String text) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setText(text);
+ } else if(figure instanceof ILabelFigure) {
+ ((ILabelFigure)figure).setText(text);
+ } else {
+ ((Label)figure).setText(text);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIconHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getIcon();
+ } else if(figure instanceof ILabelFigure) {
+ return ((ILabelFigure)figure).getIcon();
+ } else {
+ return ((Label)figure).getIcon();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelIconHelper(IFigure figure, Image icon) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setIcon(icon);
+ } else if(figure instanceof ILabelFigure) {
+ ((ILabelFigure)figure).setIcon(icon);
+ } else {
+ ((Label)figure).setIcon(icon);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(IFigure figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ /**
+ * @generated
+ */
+ protected List<?> getModelChildren() {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ public void setParser(IParser parser) {
+ this.parser = parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected EObject getParserElement() {
+ return resolveSemanticElement();
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIcon() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelText() {
+ String text = null;
+ EObject parserElement = getParserElement();
+ if(parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ }
+ if(text == null || text.length() == 0) {
+ text = defaultText;
+ }
+ return text;
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabelText(String text) {
+ setLabelTextHelper(getFigure(), text);
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public String getEditText() {
+ if(getParserElement() == null || getParser() == null) {
+ return ""; //$NON-NLS-1$
+ }
+ return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isEditable() {
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ public ICellEditorValidator getEditTextValidator() {
+ return new ICellEditorValidator() {
+
+ public String isValid(final Object value) {
+ if(value instanceof String) {
+ final EObject element = getParserElement();
+ final IParser parser = getParser();
+ try {
+ IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ }
+ });
+ return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
+ } catch (InterruptedException ie) {
+ ie.printStackTrace();
+ }
+ }
+ // shouldn't get here
+ return null;
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ public IContentAssistProcessor getCompletionProcessor() {
+ if(getParserElement() == null || getParser() == null) {
+ return null;
+ }
+ return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ }
+
+ /**
+ * @generated
+ */
+ public ParserOptions getParserOptions() {
+ return ParserOptions.NONE;
+ }
+
+ /**
+ * @generated
+ */
+ public IParser getParser() {
+ if(parser == null) {
+ parser = UMLParserProvider.getParser(UMLElementTypes.ConstraintContext_8500, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ContextLinkAppliedStereotypeEditPart.VISUAL_ID));
+ }
+ return parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected DirectEditManager getManager() {
+ if(manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ }
+ return manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setManager(DirectEditManager manager) {
+ this.manager = manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit() {
+ BusyIndicator.showWhile(Display.getDefault(), new java.lang.Runnable() {
+
+ public void run() {
+ getManager().show();
+ }
+ });
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit(Point eventLocation) {
+ if(getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void performDirectEdit(char initialCharacter) {
+ if(getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager)getManager()).show(initialCharacter);
+ } else {
+ performDirectEdit();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEditRequest(Request request) {
+ final Request theRequest = request;
+ if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ directEditionMode = getDirectEditionType();
+ }
+ switch(directEditionMode) {
+ case IDirectEdition.NO_DIRECT_EDITION:
+ // no direct edition mode => does nothing
+ return;
+ case IDirectEdition.EXTENDED_DIRECT_EDITOR:
+ updateExtendedEditorConfiguration();
+ if(configuration == null || configuration.getLanguage() == null) {
+ // Create default edit manager
+ setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ performDefaultDirectEditorEdit(theRequest);
+ } else {
+ configuration.preEditAction(resolveSemanticElement());
+ Dialog dialog = null;
+ if(configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ initializeDirectEditManager(theRequest);
+ return;
+ } else if(configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ helper.showEditor();
+ return;
+ } else if(configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if(configuration instanceof IDirectEditorConfiguration) {
+ dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
+ } else {
+ return;
+ }
+ final Dialog finalDialog = dialog;
+ if(Window.OK == dialog.open()) {
+ TransactionalEditingDomain domain = getEditingDomain();
+ RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
+
+ @Override
+ protected void doExecute() {
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ }
+ };
+ domain.getCommandStack().execute(command);
+ }
+ }
+ break;
+ case IDirectEdition.DEFAULT_DIRECT_EDITOR:
+ initializeDirectEditManager(theRequest);
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void initializeDirectEditManager(final Request request) {
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshLabel();
+ refreshFont();
+ refreshFontColor();
+ refreshUnderline();
+ refreshStrikeThrough();
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshLabel() {
+ EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
+ if(maskLabelPolicy == null) {
+ maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
+ }
+ if(maskLabelPolicy == null) {
+ View view = (View)getModel();
+ if(view.isVisible()) {
+ setLabelTextHelper(getFigure(), getLabelText());
+ setLabelIconHelper(getFigure(), getLabelIcon());
+ } else {
+ setLabelTextHelper(getFigure(), ""); //$NON-NLS-1$
+ setLabelIconHelper(getFigure(), null);
+ }
+ }
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshUnderline() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if(resolveSemanticElement() instanceof Feature) {
+ if(((Feature)resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel)getFigure()).setTextUnderline(true);
+ } else {
+ ((WrappingLabel)getFigure()).setTextUnderline(false);
+ }
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshStrikeThrough() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshFont() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null) {
+ FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ setFont(fontData);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setFontColor(Color color) {
+ getFigure().setForegroundColor(color);
+ }
+
+ /**
+ * @generated
+ */
+ protected void addSemanticListeners() {
+ if(getParser() instanceof ISemanticParser) {
+ EObject element = resolveSemanticElement();
+ parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
+ for(int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ }
+ } else {
+ super.addSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeSemanticListeners() {
+ if(parserElements != null) {
+ for(int i = 0; i < parserElements.size(); i++) {
+ removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
+ }
+ } else {
+ super.removeSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected AccessibleEditPart getAccessibleEditPart() {
+ if(accessibleEP == null) {
+ accessibleEP = new AccessibleGraphicalEditPart() {
+
+ public void getName(AccessibleEvent e) {
+ e.result = getLabelTextHelper(getFigure());
+ }
+ };
+ }
+ return accessibleEP;
+ }
+
+ /**
+ * @generated
+ */
+ private View getFontStyleOwnerView() {
+ return getPrimaryView();
+ }
+
+ /**
+ * Returns the kind of associated editor for direct edition.
+ *
+ * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
+ * @generated
+ */
+ public int getDirectEditionType() {
+ // The label is read-only (defined in GMFGen model)
+ return IDirectEdition.NO_DIRECT_EDITION;
+ }
+
+ /**
+ * Checks if an extended editor is present.
+ *
+ * @return <code>true</code> if an extended editor is present.
+ * @generated
+ */
+ protected boolean checkExtendedEditor() {
+ if(resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ return false;
+ }
+
+ /**
+ * Checks if a default direct edition is available
+ *
+ * @return <code>true</code> if a default direct edition is available
+ * @generated
+ */
+ protected boolean checkDefaultEdition() {
+ return (getParser() != null);
+ }
+
+ /**
+ * Initializes the extended editor configuration
+ * @generated
+ */
+ protected void initExtendedEditorConfiguration() {
+ if(configuration == null) {
+ final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else {
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ }
+ }
+
+ /**
+ * Updates the preference configuration
+ * @generated
+ */
+ protected void updateExtendedEditorConfiguration() {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ configuration = null;
+ }
+ }
+
+ /**
+ * Performs the direct edit usually used by GMF editors.
+ * @param theRequest the direct edit request that starts the direct edit system
+ * @generated
+ */
+ protected void performDefaultDirectEditorEdit(final Request theRequest) {
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void handleNotificationEvent(Notification event) {
+ Object feature = event.getFeature();
+ if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer)event.getNewValue();
+ setFontColor(DiagramColorRegistry.getInstance().getColor(c));
+ } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ refreshUnderline();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ refreshStrikeThrough();
+ } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ refreshFont();
+ } else {
+ if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ refreshLabel();
+ }
+ if(getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser)getParser();
+ if(modelParser.areSemanticElementsAffected(null, event)) {
+ removeSemanticListeners();
+ if(resolveSemanticElement() != null) {
+ addSemanticListeners();
+ }
+ refreshLabel();
+ }
+ }
+ }
+ super.handleNotificationEvent(event);
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigure() {
+ // Parent should assign one using setLabel() method
+ return null;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/parts/ContextLinkEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/parts/ContextLinkEditPart.java
new file mode 100644
index 00000000000..34f93497e80
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/parts/ContextLinkEditPart.java
@@ -0,0 +1,109 @@
+/**
+ * Copyright (c) 2014 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:
+ * CEA LIST - Initial API and implementation
+ */
+package org.eclipse.papyrus.uml.diagram.statemachine.edit.parts;
+
+import org.eclipse.draw2d.Connection;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpart.ConnectionEditPart;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLinkLabelDisplayEditPolicy;
+import org.eclipse.papyrus.uml.diagram.statemachine.custom.figures.CustomContextLinkFigure;
+import org.eclipse.papyrus.uml.diagram.statemachine.custom.policies.CustomAppliedStereotypeContextLinkLabelDisplayEditPolicy;
+import org.eclipse.papyrus.uml.diagram.statemachine.edit.policies.ContextLinkItemSemanticEditPolicy;
+
+/**
+ * @generated
+ */
+public class ContextLinkEditPart extends ConnectionEditPart implements ITreeBranchEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 8500;
+
+ /**
+ * @generated
+ */
+ public ContextLinkEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ContextLinkItemSemanticEditPolicy());
+ installEditPolicy(AppliedStereotypeLinkLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new CustomAppliedStereotypeContextLinkLabelDisplayEditPolicy());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean addFixedChild(EditPart childEditPart) {
+ if(childEditPart instanceof ContextLinkAppliedStereotypeEditPart) {
+ ((ContextLinkAppliedStereotypeEditPart)childEditPart).setLabel(getPrimaryShape().getAppliedStereotypeLabel());
+ }
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ protected void addChildVisual(EditPart childEditPart, int index) {
+ if(addFixedChild(childEditPart)) {
+ return;
+ }
+ super.addChildVisual(childEditPart, -1);
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean removeFixedChild(EditPart childEditPart) {
+ if(childEditPart instanceof ContextLinkAppliedStereotypeEditPart) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeChildVisual(EditPart childEditPart) {
+ if(removeFixedChild(childEditPart)) {
+ return;
+ }
+ super.removeChildVisual(childEditPart);
+ }
+
+ /**
+ * Creates figure for this edit part.
+ *
+ * Body of this method does not depend on settings in generation model
+ * so you may safely remove <i>generated</i> tag and modify it.
+ *
+ * @generated
+ */
+ protected Connection createConnectionFigure() {
+ return new CustomContextLinkFigure();
+ }
+
+ /**
+ * @generated
+ */
+ public CustomContextLinkFigure getPrimaryShape() {
+ return (CustomContextLinkFigure)getFigure();
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/parts/RegionCompartmentEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/parts/RegionCompartmentEditPart.java
index 136fd630b36..45fe9ffda1a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/parts/RegionCompartmentEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/parts/RegionCompartmentEditPart.java
@@ -30,6 +30,7 @@ import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.DuplicatePasteEditPolicy;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.PapyrusCreationEditPolicy;
import org.eclipse.papyrus.uml.diagram.statemachine.custom.policies.CustomRegionCompartmentCreationEditPolicy;
+import org.eclipse.papyrus.uml.diagram.statemachine.custom.policies.CustomRegionCompartmentItemSemanticEditPolicy;
import org.eclipse.papyrus.uml.diagram.statemachine.custom.policies.CustomRegionCompartmentXYLayoutEditPolicy;
import org.eclipse.papyrus.uml.diagram.statemachine.custom.policies.CustomStateMachineDiagramDragDropEditPolicy;
import org.eclipse.papyrus.uml.diagram.statemachine.custom.policies.RemoveOrphanViewPolicy;
@@ -84,6 +85,7 @@ public class RegionCompartmentEditPart extends ShapeCompartmentEditPart {
installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CustomRegionCompartmentCreationEditPolicy());
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomStateMachineDiagramDragDropEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, new CustomRegionCompartmentXYLayoutEditPolicy());
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomRegionCompartmentItemSemanticEditPolicy());
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/parts/UMLEditPartFactory.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/parts/UMLEditPartFactory.java
index a4aae97d016..d1fe791ffde 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/parts/UMLEditPartFactory.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/parts/UMLEditPartFactory.java
@@ -161,6 +161,10 @@ public class UMLEditPartFactory implements EditPartFactory {
return new CommentAnnotatedElementEditPart(view);
case ConstraintConstrainedElementEditPart.VISUAL_ID:
return new ConstraintConstrainedElementEditPart(view);
+ case ContextLinkEditPart.VISUAL_ID:
+ return new ContextLinkEditPart(view);
+ case ContextLinkAppliedStereotypeEditPart.VISUAL_ID:
+ return new ContextLinkAppliedStereotypeEditPart(view);
}
}
return createUnrecognizedEditPart(context, model);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/ConstraintItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/ConstraintItemSemanticEditPolicy.java
index 390dcc2d95c..0105f6b0f02 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/ConstraintItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/ConstraintItemSemanticEditPolicy.java
@@ -31,8 +31,11 @@ import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.CommentAnnotat
import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.CommentAnnotatedElementReorientCommand;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.ConstraintConstrainedElementCreateCommand;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.ConstraintConstrainedElementReorientCommand;
+import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.ContextLinkCreateCommand;
+import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.ContextLinkReorientCommand;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.CommentAnnotatedElementEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ConstraintConstrainedElementEditPart;
+import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ContextLinkEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.providers.UMLElementTypes;
/**
@@ -106,6 +109,12 @@ public class ConstraintItemSemanticEditPolicy extends UMLBaseItemSemanticEditPol
}
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
+ if(UMLElementTypes.ConstraintContext_8500 == baseElementType) {
+ if(isExtendedType) {
+ return getExtendedStartCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ }
+ return getGEFWrapper(new ContextLinkCreateCommand(req, req.getSource(), req.getTarget()));
+ }
return null;
}
@@ -141,6 +150,9 @@ public class ConstraintItemSemanticEditPolicy extends UMLBaseItemSemanticEditPol
}
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
+ if(UMLElementTypes.ConstraintContext_8500 == baseElementType) {
+ return null;
+ }
return null;
}
@@ -156,6 +168,8 @@ public class ConstraintItemSemanticEditPolicy extends UMLBaseItemSemanticEditPol
return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
return getGEFWrapper(new ConstraintConstrainedElementReorientCommand(req));
+ case ContextLinkEditPart.VISUAL_ID:
+ return getGEFWrapper(new ContextLinkReorientCommand(req));
}
return super.getReorientReferenceRelationshipCommand(req);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/ContextLinkItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/ContextLinkItemSemanticEditPolicy.java
new file mode 100644
index 00000000000..32c109a1120
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/ContextLinkItemSemanticEditPolicy.java
@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2014 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:
+ * CEA LIST - Initial API and implementation
+ */
+package org.eclipse.papyrus.uml.diagram.statemachine.edit.policies;
+
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyReferenceCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest;
+import org.eclipse.papyrus.uml.diagram.statemachine.providers.UMLElementTypes;
+
+/**
+ * @generated
+ */
+public class ContextLinkItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ public ContextLinkItemSemanticEditPolicy() {
+ super(UMLElementTypes.ConstraintContext_8500);
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getDestroyReferenceCommand(DestroyReferenceRequest req) {
+ return getGEFWrapper(new DestroyReferenceCommand(req));
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/FinalStateItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/FinalStateItemSemanticEditPolicy.java
index 59f8d683003..898d2590a9a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/FinalStateItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/FinalStateItemSemanticEditPolicy.java
@@ -32,10 +32,13 @@ import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.CommentAnnotat
import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.CommentAnnotatedElementReorientCommand;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.ConstraintConstrainedElementCreateCommand;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.ConstraintConstrainedElementReorientCommand;
+import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.ContextLinkCreateCommand;
+import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.ContextLinkReorientCommand;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.TransitionCreateCommand;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.TransitionReorientCommand;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.CommentAnnotatedElementEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ConstraintConstrainedElementEditPart;
+import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ContextLinkEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.TransitionEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.providers.UMLElementTypes;
@@ -113,6 +116,9 @@ public class FinalStateItemSemanticEditPolicy extends UMLBaseItemSemanticEditPol
if(UMLElementTypes.ConstraintConstrainedElement_670 == baseElementType) {
return null;
}
+ if(UMLElementTypes.ConstraintContext_8500 == baseElementType) {
+ return null;
+ }
return null;
}
@@ -154,6 +160,12 @@ public class FinalStateItemSemanticEditPolicy extends UMLBaseItemSemanticEditPol
}
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
+ if(UMLElementTypes.ConstraintContext_8500 == baseElementType) {
+ if(isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ }
+ return getGEFWrapper(new ContextLinkCreateCommand(req, req.getSource(), req.getTarget()));
+ }
return null;
}
@@ -183,6 +195,8 @@ public class FinalStateItemSemanticEditPolicy extends UMLBaseItemSemanticEditPol
return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
return getGEFWrapper(new ConstraintConstrainedElementReorientCommand(req));
+ case ContextLinkEditPart.VISUAL_ID:
+ return getGEFWrapper(new ContextLinkReorientCommand(req));
}
return super.getReorientReferenceRelationshipCommand(req);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/RegionItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/RegionItemSemanticEditPolicy.java
index 1c4f3765b75..57a58ece873 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/RegionItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/RegionItemSemanticEditPolicy.java
@@ -38,10 +38,13 @@ import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.CommentAnnotat
import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.CommentAnnotatedElementReorientCommand;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.ConstraintConstrainedElementCreateCommand;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.ConstraintConstrainedElementReorientCommand;
+import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.ContextLinkCreateCommand;
+import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.ContextLinkReorientCommand;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.CommentAnnotatedElementEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.CommentEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ConstraintConstrainedElementEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ConstraintEditPart;
+import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ContextLinkEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.FinalStateEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.PseudostateChoiceEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.PseudostateDeepHistoryEditPart;
@@ -280,6 +283,7 @@ public class RegionItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy
switch(UMLVisualIDRegistry.getVisualID(incomingLink)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
case ConstraintConstrainedElementEditPart.VISUAL_ID:
+ case ContextLinkEditPart.VISUAL_ID:
DestroyReferenceRequest destroyRefReq = new DestroyReferenceRequest(incomingLink.getSource().getElement(), null, incomingLink.getTarget().getElement(), false);
cmd.add(new DestroyReferenceCommand(destroyRefReq));
cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), incomingLink));
@@ -301,6 +305,7 @@ public class RegionItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy
switch(UMLVisualIDRegistry.getVisualID(incomingLink)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
case ConstraintConstrainedElementEditPart.VISUAL_ID:
+ case ContextLinkEditPart.VISUAL_ID:
DestroyReferenceRequest destroyRefReq = new DestroyReferenceRequest(incomingLink.getSource().getElement(), null, incomingLink.getTarget().getElement(), false);
cmd.add(new DestroyReferenceCommand(destroyRefReq));
cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), incomingLink));
@@ -428,6 +433,9 @@ public class RegionItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy
if(UMLElementTypes.ConstraintConstrainedElement_670 == baseElementType) {
return null;
}
+ if(UMLElementTypes.ConstraintContext_8500 == baseElementType) {
+ return null;
+ }
return null;
}
@@ -463,6 +471,12 @@ public class RegionItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy
}
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
+ if(UMLElementTypes.ConstraintContext_8500 == baseElementType) {
+ if(isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ }
+ return getGEFWrapper(new ContextLinkCreateCommand(req, req.getSource(), req.getTarget()));
+ }
return null;
}
@@ -478,6 +492,8 @@ public class RegionItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy
return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
return getGEFWrapper(new ConstraintConstrainedElementReorientCommand(req));
+ case ContextLinkEditPart.VISUAL_ID:
+ return getGEFWrapper(new ContextLinkReorientCommand(req));
}
return super.getReorientReferenceRelationshipCommand(req);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/StateItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/StateItemSemanticEditPolicy.java
index e5c486286e0..5fb4331551b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/StateItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/StateItemSemanticEditPolicy.java
@@ -42,6 +42,8 @@ import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.CommentAnnotat
import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.ConnectionPointReferenceCreateCommand;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.ConstraintConstrainedElementCreateCommand;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.ConstraintConstrainedElementReorientCommand;
+import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.ContextLinkCreateCommand;
+import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.ContextLinkReorientCommand;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.DoActivityStateBehaviorStateCreateCommand;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.EntryStateBehaviorCreateCommand;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.ExitStateBehaviorCreateCommand;
@@ -54,6 +56,7 @@ import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.TransitionReor
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.CommentAnnotatedElementEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ConnectionPointReferenceEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ConstraintConstrainedElementEditPart;
+import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ContextLinkEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.DoActivityStateBehaviorStateEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.EntryStateBehaviorEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ExitStateBehaviorEditPart;
@@ -190,6 +193,7 @@ public class StateItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
switch(UMLVisualIDRegistry.getVisualID(incomingLink)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
case ConstraintConstrainedElementEditPart.VISUAL_ID:
+ case ContextLinkEditPart.VISUAL_ID:
DestroyReferenceRequest destroyRefReq = new DestroyReferenceRequest(incomingLink.getSource().getElement(), null, incomingLink.getTarget().getElement(), false);
cmd.add(new DestroyReferenceCommand(destroyRefReq));
cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), incomingLink));
@@ -278,6 +282,7 @@ public class StateItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
switch(UMLVisualIDRegistry.getVisualID(incomingLink)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
case ConstraintConstrainedElementEditPart.VISUAL_ID:
+ case ContextLinkEditPart.VISUAL_ID:
DestroyReferenceRequest destroyRefReq = new DestroyReferenceRequest(incomingLink.getSource().getElement(), null, incomingLink.getTarget().getElement(), false);
cmd.add(new DestroyReferenceCommand(destroyRefReq));
cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), incomingLink));
@@ -361,6 +366,9 @@ public class StateItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
if(UMLElementTypes.ConstraintConstrainedElement_670 == baseElementType) {
return null;
}
+ if(UMLElementTypes.ConstraintContext_8500 == baseElementType) {
+ return null;
+ }
return null;
}
@@ -402,6 +410,12 @@ public class StateItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
}
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
+ if(UMLElementTypes.ConstraintContext_8500 == baseElementType) {
+ if(isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ }
+ return getGEFWrapper(new ContextLinkCreateCommand(req, req.getSource(), req.getTarget()));
+ }
return null;
}
@@ -431,6 +445,8 @@ public class StateItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
return getGEFWrapper(new ConstraintConstrainedElementReorientCommand(req));
+ case ContextLinkEditPart.VISUAL_ID:
+ return getGEFWrapper(new ContextLinkReorientCommand(req));
}
return super.getReorientReferenceRelationshipCommand(req);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/StateMachineItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/StateMachineItemSemanticEditPolicy.java
index e22e62a5482..a2a3d8cdb56 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/StateMachineItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/StateMachineItemSemanticEditPolicy.java
@@ -41,12 +41,15 @@ import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.CommentAnnotat
import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.CommentAnnotatedElementReorientCommand;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.ConstraintConstrainedElementCreateCommand;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.ConstraintConstrainedElementReorientCommand;
+import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.ContextLinkCreateCommand;
+import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.ContextLinkReorientCommand;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.GeneralizationCreateCommand;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.GeneralizationReorientCommand;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.PseudostateEntryPointCreateCommand;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.PseudostateExitPointCreateCommand;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.CommentAnnotatedElementEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ConstraintConstrainedElementEditPart;
+import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ContextLinkEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.GeneralizationEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.PseudostateEntryPointEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.PseudostateExitPointEditPart;
@@ -168,6 +171,7 @@ public class StateMachineItemSemanticEditPolicy extends UMLBaseItemSemanticEditP
switch(UMLVisualIDRegistry.getVisualID(incomingLink)) {
case CommentAnnotatedElementEditPart.VISUAL_ID:
case ConstraintConstrainedElementEditPart.VISUAL_ID:
+ case ContextLinkEditPart.VISUAL_ID:
DestroyReferenceRequest destroyRefReq = new DestroyReferenceRequest(incomingLink.getSource().getElement(), null, incomingLink.getTarget().getElement(), false);
cmd.add(new DestroyReferenceCommand(destroyRefReq));
cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), incomingLink));
@@ -272,6 +276,9 @@ public class StateMachineItemSemanticEditPolicy extends UMLBaseItemSemanticEditP
if(UMLElementTypes.ConstraintConstrainedElement_670 == baseElementType) {
return null;
}
+ if(UMLElementTypes.ConstraintContext_8500 == baseElementType) {
+ return null;
+ }
return null;
}
@@ -313,6 +320,12 @@ public class StateMachineItemSemanticEditPolicy extends UMLBaseItemSemanticEditP
}
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
+ if(UMLElementTypes.ConstraintContext_8500 == baseElementType) {
+ if(isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ }
+ return getGEFWrapper(new ContextLinkCreateCommand(req, req.getSource(), req.getTarget()));
+ }
return null;
}
@@ -342,6 +355,8 @@ public class StateMachineItemSemanticEditPolicy extends UMLBaseItemSemanticEditP
return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
return getGEFWrapper(new ConstraintConstrainedElementReorientCommand(req));
+ case ContextLinkEditPart.VISUAL_ID:
+ return getGEFWrapper(new ContextLinkReorientCommand(req));
}
return super.getReorientReferenceRelationshipCommand(req);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/TransitionItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/TransitionItemSemanticEditPolicy.java
index 60cf57ed427..6c8431a14e2 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/TransitionItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/TransitionItemSemanticEditPolicy.java
@@ -29,8 +29,11 @@ import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.CommentAnnotat
import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.CommentAnnotatedElementReorientCommand;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.ConstraintConstrainedElementCreateCommand;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.ConstraintConstrainedElementReorientCommand;
+import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.ContextLinkCreateCommand;
+import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.ContextLinkReorientCommand;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.CommentAnnotatedElementEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ConstraintConstrainedElementEditPart;
+import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ContextLinkEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.providers.UMLElementTypes;
/**
@@ -90,6 +93,9 @@ public class TransitionItemSemanticEditPolicy extends UMLBaseItemSemanticEditPol
if(UMLElementTypes.ConstraintConstrainedElement_670 == baseElementType) {
return null;
}
+ if(UMLElementTypes.ConstraintContext_8500 == baseElementType) {
+ return null;
+ }
return null;
}
@@ -125,6 +131,12 @@ public class TransitionItemSemanticEditPolicy extends UMLBaseItemSemanticEditPol
}
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
+ if(UMLElementTypes.ConstraintContext_8500 == baseElementType) {
+ if(isExtendedType) {
+ return getExtendedCompleteCreateRelationshipCommand(req, (IExtendedHintedElementType)requestElementType);
+ }
+ return getGEFWrapper(new ContextLinkCreateCommand(req, req.getSource(), req.getTarget()));
+ }
return null;
}
@@ -140,6 +152,8 @@ public class TransitionItemSemanticEditPolicy extends UMLBaseItemSemanticEditPol
return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
case ConstraintConstrainedElementEditPart.VISUAL_ID:
return getGEFWrapper(new ConstraintConstrainedElementReorientCommand(req));
+ case ContextLinkEditPart.VISUAL_ID:
+ return getGEFWrapper(new ContextLinkReorientCommand(req));
}
return super.getReorientReferenceRelationshipCommand(req);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/UMLBaseItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/UMLBaseItemSemanticEditPolicy.java
index 438efa4f9b6..2d86771dd14 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/UMLBaseItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/UMLBaseItemSemanticEditPolicy.java
@@ -55,6 +55,7 @@ import org.eclipse.uml2.uml.Comment;
import org.eclipse.uml2.uml.Constraint;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.Generalization;
+import org.eclipse.uml2.uml.Namespace;
import org.eclipse.uml2.uml.Region;
import org.eclipse.uml2.uml.Transition;
import org.eclipse.uml2.uml.Vertex;
@@ -443,6 +444,21 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
/**
* @generated
*/
+ public boolean canCreateConstraintContext_8500(Constraint source, Namespace target) {
+ if(source != null) {
+ if(source.getContext() != null) {
+ return false;
+ }
+ }
+ if(target != null && (target.getOwnedRules().contains(target))) {
+ return false;
+ }
+ return canExistConstraintContext_8500(source, target);
+ }
+
+ /**
+ * @generated
+ */
public boolean canExistTransition_7000(Region container, Transition linkInstance, Vertex source, Vertex target) {
return true;
}
@@ -467,5 +483,12 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
public boolean canExistConstraintConstrainedElement_670(Constraint source, Element target) {
return true;
}
+
+ /**
+ * @generated
+ */
+ public boolean canExistConstraintContext_8500(Constraint source, Namespace target) {
+ return true;
+ }
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/part/Messages.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/part/Messages.java
index 1f4312579b2..95f8c57ba7c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/part/Messages.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/part/Messages.java
@@ -444,6 +444,16 @@ public class Messages extends NLS {
/**
* @generated
*/
+ public static String ContextLink3CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String ContextLink3CreationTool_desc;
+
+ /**
+ * @generated
+ */
public static String RegionCompartmentEditPart_title;
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/part/UMLDiagramEditor.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/part/UMLDiagramEditor.java
index b481ca55bcd..60d1868666d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/part/UMLDiagramEditor.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/part/UMLDiagramEditor.java
@@ -358,7 +358,7 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
* (between two selected shapes)
*
* @param event
- * the KeyEvent
+ * the KeyEvent
* @return <code>true</code> if KeyEvent was handled in some way
*/
public boolean keyReleased(KeyEvent event) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/part/UMLDiagramEditorPlugin.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/part/UMLDiagramEditorPlugin.java
index dbfc1c628d2..afbbee83a0a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/part/UMLDiagramEditorPlugin.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/part/UMLDiagramEditorPlugin.java
@@ -210,7 +210,7 @@ public class UMLDiagramEditorPlugin extends AbstractUIPlugin {
public UMLDocumentProvider getDocumentProvider() {
if(documentProvider == null) {
documentProvider = new UMLDocumentProvider();
- }
+ }
return documentProvider;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/part/UMLDiagramEditorUtil.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/part/UMLDiagramEditorUtil.java
index 3edd708f28b..5f7c8c6de2d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/part/UMLDiagramEditorUtil.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/part/UMLDiagramEditorUtil.java
@@ -176,7 +176,6 @@ public class UMLDiagramEditorUtil {
* Create a new instance of domain element associated with canvas.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
private static Package createInitialModel() {
@@ -187,7 +186,6 @@ public class UMLDiagramEditorUtil {
* Store model element in the resource.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
private static void attachModelToResource(Package model, Resource resource) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/part/UMLDiagramUpdater.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/part/UMLDiagramUpdater.java
index bfd1f37f7b1..cdbfcb7860b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/part/UMLDiagramUpdater.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/part/UMLDiagramUpdater.java
@@ -29,6 +29,7 @@ import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.CommentEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ConnectionPointReferenceEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ConstraintConstrainedElementEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ConstraintEditPart;
+import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ContextLinkEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.DoActivityStateBehaviorStateEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.EntryStateBehaviorEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ExitStateBehaviorEditPart;
@@ -62,6 +63,7 @@ import org.eclipse.uml2.uml.Constraint;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.FinalState;
import org.eclipse.uml2.uml.Generalization;
+import org.eclipse.uml2.uml.Namespace;
import org.eclipse.uml2.uml.Package;
import org.eclipse.uml2.uml.PackageableElement;
import org.eclipse.uml2.uml.Pseudostate;
@@ -601,6 +603,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
Constraint modelElement = (Constraint)view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElement_670(modelElement));
+ result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_Context_8500(modelElement));
return result;
}
@@ -665,6 +668,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
result.addAll(getIncomingTypeModelFacetLinks_Generalization_19000(modelElement, crossReferencer));
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_667(modelElement, crossReferencer));
result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElement_670(modelElement, crossReferencer));
+ result.addAll(getIncomingFeatureModelFacetLinks_Constraint_Context_8500(modelElement, crossReferencer));
return result;
}
@@ -677,6 +681,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_667(modelElement, crossReferencer));
result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElement_670(modelElement, crossReferencer));
+ result.addAll(getIncomingFeatureModelFacetLinks_Constraint_Context_8500(modelElement, crossReferencer));
return result;
}
@@ -690,6 +695,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
result.addAll(getIncomingTypeModelFacetLinks_Transition_7000(modelElement, crossReferencer));
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_667(modelElement, crossReferencer));
result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElement_670(modelElement, crossReferencer));
+ result.addAll(getIncomingFeatureModelFacetLinks_Constraint_Context_8500(modelElement, crossReferencer));
return result;
}
@@ -703,6 +709,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
result.addAll(getIncomingTypeModelFacetLinks_Transition_7000(modelElement, crossReferencer));
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_667(modelElement, crossReferencer));
result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElement_670(modelElement, crossReferencer));
+ result.addAll(getIncomingFeatureModelFacetLinks_Constraint_Context_8500(modelElement, crossReferencer));
return result;
}
@@ -910,6 +917,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_667(modelElement, crossReferencer));
result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElement_670(modelElement, crossReferencer));
+ result.addAll(getIncomingFeatureModelFacetLinks_Constraint_Context_8500(modelElement, crossReferencer));
return result;
}
@@ -1089,6 +1097,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
Constraint modelElement = (Constraint)view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElement_670(modelElement));
+ result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_Context_8500(modelElement));
return result;
}
@@ -1249,6 +1258,20 @@ public class UMLDiagramUpdater implements DiagramUpdater {
/**
* @generated
*/
+ protected Collection<UMLLinkDescriptor> getIncomingFeatureModelFacetLinks_Constraint_Context_8500(Namespace target, CrossReferenceAdapter crossReferencer) {
+ LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
+ Collection<EStructuralFeature.Setting> settings = crossReferencer.getInverseReferences(target);
+ for(EStructuralFeature.Setting setting : settings) {
+ if(setting.getEStructuralFeature() == UMLPackage.eINSTANCE.getConstraint_Context()) {
+ result.add(new UMLLinkDescriptor(setting.getEObject(), target, UMLElementTypes.ConstraintContext_8500, ContextLinkEditPart.VISUAL_ID));
+ }
+ }
+ return result;
+ }
+
+ /**
+ * @generated
+ */
protected Collection<UMLLinkDescriptor> getOutgoingTypeModelFacetLinks_Transition_7000(Vertex source) {
Region container = null;
// Find container element for the link.
@@ -1305,4 +1328,17 @@ public class UMLDiagramUpdater implements DiagramUpdater {
}
return result;
}
+
+ /**
+ * @generated
+ */
+ protected Collection<UMLLinkDescriptor> getOutgoingFeatureModelFacetLinks_Constraint_Context_8500(Constraint source) {
+ LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
+ Namespace destination = source.getContext();
+ if(destination == null) {
+ return result;
+ }
+ result.add(new UMLLinkDescriptor(source, destination, UMLElementTypes.ConstraintContext_8500, ContextLinkEditPart.VISUAL_ID));
+ return result;
+ }
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/part/UMLPaletteFactory.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/part/UMLPaletteFactory.java
index e51515d6b4e..6bd876421d7 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/part/UMLPaletteFactory.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/part/UMLPaletteFactory.java
@@ -122,6 +122,11 @@ public class UMLPaletteFactory extends PaletteFactory.Adapter {
/**
* @generated
*/
+ private final static String CREATECONTEXTLINK3CREATIONTOOL = "createContextLink3CreationTool";//$NON-NLS-1$
+
+ /**
+ * @generated
+ */
public UMLPaletteFactory() {
}
@@ -183,6 +188,9 @@ public class UMLPaletteFactory extends PaletteFactory.Adapter {
if(toolId.equals(CREATECOMMENTLINKCREATIONTOOL)) {
return createCommentlinkCreationTool();
}
+ if(toolId.equals(CREATECONTEXTLINK3CREATIONTOOL)) {
+ return createContextLink3CreationTool();
+ }
// default return: null
return null;
}
@@ -375,4 +383,14 @@ public class UMLPaletteFactory extends PaletteFactory.Adapter {
Tool tool = new AspectUnspecifiedTypeConnectionTool(types);
return tool;
}
+
+ /**
+ * @generated
+ */
+ private Tool createContextLink3CreationTool() {
+ List<IElementType> types = new ArrayList<IElementType>(1);
+ types.add(UMLElementTypes.ConstraintContext_8500);
+ Tool tool = new AspectUnspecifiedTypeConnectionTool(types);
+ return tool;
+ }
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/part/UMLVisualIDRegistry.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/part/UMLVisualIDRegistry.java
index ef6cf56a9ee..68362c1fe61 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/part/UMLVisualIDRegistry.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/part/UMLVisualIDRegistry.java
@@ -26,6 +26,8 @@ import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ConnectionPointRe
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ConstraintBodyEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ConstraintEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ConstraintNameLabelEditPart;
+import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ContextLinkAppliedStereotypeEditPart;
+import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ContextLinkEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.DoActivityStateBehaviorStateEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.EntryStateBehaviorEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ExitStateBehaviorEditPart;
@@ -549,6 +551,11 @@ public class UMLVisualIDRegistry {
return true;
}
break;
+ case ContextLinkEditPart.VISUAL_ID:
+ if(ContextLinkAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ break;
}
return false;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/providers/ElementInitializers.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/providers/ElementInitializers.java
index 8efc2819dd3..38143a15148 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/providers/ElementInitializers.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/providers/ElementInitializers.java
@@ -1,596 +1,596 @@
-/**
- * Copyright (c) 2014 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:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.statemachine.providers;
-
-import org.eclipse.papyrus.uml.diagram.statemachine.custom.expressions.UMLAbstractExpression;
-import org.eclipse.papyrus.uml.diagram.statemachine.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.uml.tools.utils.NamedElementUtil;
-import org.eclipse.uml2.uml.Comment;
-import org.eclipse.uml2.uml.ConnectionPointReference;
-import org.eclipse.uml2.uml.Constraint;
-import org.eclipse.uml2.uml.FinalState;
-import org.eclipse.uml2.uml.LiteralString;
-import org.eclipse.uml2.uml.Pseudostate;
-import org.eclipse.uml2.uml.PseudostateKind;
-import org.eclipse.uml2.uml.Region;
-import org.eclipse.uml2.uml.State;
-import org.eclipse.uml2.uml.StateMachine;
-import org.eclipse.uml2.uml.Transition;
-import org.eclipse.uml2.uml.UMLFactory;
-import org.eclipse.uml2.uml.UMLPackage;
-import org.eclipse.uml2.uml.ValueSpecification;
-
-/**
- * @generated
- */
-public class ElementInitializers {
-
- protected ElementInitializers() {
- // use #getInstance to access cached instance
- }
-
- /**
- * @generated
- */
- public void init_StateMachine_2000(StateMachine instance) {
- try {
- Object value_0 = name_StateMachine_2000(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
- }
- Region newInstance_1_0 = UMLFactory.eINSTANCE.createRegion();
- instance.getRegions().add(newInstance_1_0);
- Object value_1_0_0 = name_region_StateMachine_2000(newInstance_1_0);
- if(value_1_0_0 != null) {
- newInstance_1_0.setName((String)value_1_0_0);
- }
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_Region_3000(Region instance) {
- try {
- Object value_0 = name_Region_3000(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
- }
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_FinalState_5000(FinalState instance) {
- try {
- Object value_0 = name_FinalState_5000(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
- }
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_State_6000(State instance) {
- try {
- Object value_0 = name_State_6000(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
- }
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_Pseudostate_8000(Pseudostate instance) {
- try {
- Object value_0 = kind_Pseudostate_8000(instance);
- if(value_0 != null) {
- value_0 = UMLAbstractExpression.performCast(value_0, UMLPackage.eINSTANCE.getPseudostateKind());
- instance.setKind((PseudostateKind)value_0);
- }
- Object value_1 = name_Pseudostate_8000(instance);
- if(value_1 != null) {
- instance.setName((String)value_1);
- }
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_Pseudostate_9000(Pseudostate instance) {
- try {
- Object value_0 = kind_Pseudostate_9000(instance);
- if(value_0 != null) {
- value_0 = UMLAbstractExpression.performCast(value_0, UMLPackage.eINSTANCE.getPseudostateKind());
- instance.setKind((PseudostateKind)value_0);
- }
- Object value_1 = name_Pseudostate_9000(instance);
- if(value_1 != null) {
- instance.setName((String)value_1);
- }
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_Pseudostate_10000(Pseudostate instance) {
- try {
- Object value_0 = kind_Pseudostate_10000(instance);
- if(value_0 != null) {
- value_0 = UMLAbstractExpression.performCast(value_0, UMLPackage.eINSTANCE.getPseudostateKind());
- instance.setKind((PseudostateKind)value_0);
- }
- Object value_1 = name_Pseudostate_10000(instance);
- if(value_1 != null) {
- instance.setName((String)value_1);
- }
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_Pseudostate_11000(Pseudostate instance) {
- try {
- Object value_0 = kind_Pseudostate_11000(instance);
- if(value_0 != null) {
- value_0 = UMLAbstractExpression.performCast(value_0, UMLPackage.eINSTANCE.getPseudostateKind());
- instance.setKind((PseudostateKind)value_0);
- }
- Object value_1 = name_Pseudostate_11000(instance);
- if(value_1 != null) {
- instance.setName((String)value_1);
- }
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_Pseudostate_12000(Pseudostate instance) {
- try {
- Object value_0 = kind_Pseudostate_12000(instance);
- if(value_0 != null) {
- value_0 = UMLAbstractExpression.performCast(value_0, UMLPackage.eINSTANCE.getPseudostateKind());
- instance.setKind((PseudostateKind)value_0);
- }
- Object value_1 = name_Pseudostate_12000(instance);
- if(value_1 != null) {
- instance.setName((String)value_1);
- }
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_Pseudostate_13000(Pseudostate instance) {
- try {
- Object value_0 = kind_Pseudostate_13000(instance);
- if(value_0 != null) {
- value_0 = UMLAbstractExpression.performCast(value_0, UMLPackage.eINSTANCE.getPseudostateKind());
- instance.setKind((PseudostateKind)value_0);
- }
- Object value_1 = name_Pseudostate_13000(instance);
- if(value_1 != null) {
- instance.setName((String)value_1);
- }
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_Pseudostate_14000(Pseudostate instance) {
- try {
- Object value_0 = kind_Pseudostate_14000(instance);
- if(value_0 != null) {
- value_0 = UMLAbstractExpression.performCast(value_0, UMLPackage.eINSTANCE.getPseudostateKind());
- instance.setKind((PseudostateKind)value_0);
- }
- Object value_1 = name_Pseudostate_14000(instance);
- if(value_1 != null) {
- instance.setName((String)value_1);
- }
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_Pseudostate_15000(Pseudostate instance) {
- try {
- Object value_0 = kind_Pseudostate_15000(instance);
- if(value_0 != null) {
- value_0 = UMLAbstractExpression.performCast(value_0, UMLPackage.eINSTANCE.getPseudostateKind());
- instance.setKind((PseudostateKind)value_0);
- }
- Object value_1 = name_Pseudostate_15000(instance);
- if(value_1 != null) {
- instance.setName((String)value_1);
- }
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_Pseudostate_16000(Pseudostate instance) {
- try {
- Object value_0 = kind_Pseudostate_16000(instance);
- if(value_0 != null) {
- value_0 = UMLAbstractExpression.performCast(value_0, UMLPackage.eINSTANCE.getPseudostateKind());
- instance.setKind((PseudostateKind)value_0);
- }
- Object value_1 = name_Pseudostate_16000(instance);
- if(value_1 != null) {
- instance.setName((String)value_1);
- }
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_Pseudostate_17000(Pseudostate instance) {
- try {
- Object value_0 = kind_Pseudostate_17000(instance);
- if(value_0 != null) {
- value_0 = UMLAbstractExpression.performCast(value_0, UMLPackage.eINSTANCE.getPseudostateKind());
- instance.setKind((PseudostateKind)value_0);
- }
- Object value_1 = name_Pseudostate_17000(instance);
- if(value_1 != null) {
- instance.setName((String)value_1);
- }
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_ConnectionPointReference_18000(ConnectionPointReference instance) {
- try {
- Object value_0 = name_ConnectionPointReference_18000(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
- }
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_Comment_666(Comment instance) {
- try {
- Object value_0 = body_Comment_666(instance);
- if(value_0 != null) {
- instance.setBody((String)value_0);
- }
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_Constraint_668(Constraint instance) {
- try {
- Object value_0 = name_Constraint_668(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
- }
- Object value_1 = specification_Constraint_668(instance);
- if(value_1 != null) {
- instance.setSpecification((ValueSpecification)value_1);
- }
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_Transition_680(Transition instance) {
- try {
- Object value_0 = name_Transition_680(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
- }
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_Transition_7000(Transition instance) {
- try {
- Object value_0 = name_Transition_7000(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
- }
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- private String name_StateMachine_2000(StateMachine it) {
- return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents());
- }
-
- /**
- * @generated
- */
- private String name_region_StateMachine_2000(Region it) {
- return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents());
- }
-
- /**
- * @generated
- */
- private String name_Region_3000(Region it) {
- return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents());
- }
-
- /**
- * @generated
- */
- private String name_FinalState_5000(FinalState it) {
- return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents());
- }
-
- /**
- * @generated
- */
- private String name_State_6000(State it) {
- return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents());
- }
-
- /**
- * @generated
- */
- private PseudostateKind kind_Pseudostate_8000(Pseudostate it) {
- return PseudostateKind.INITIAL_LITERAL;
- }
-
- /**
- * @generated
- */
- private String name_Pseudostate_8000(Pseudostate it) {
- return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents());
- }
-
- /**
- * @generated
- */
- private PseudostateKind kind_Pseudostate_9000(Pseudostate it) {
- return PseudostateKind.JOIN_LITERAL;
- }
-
- /**
- * @generated
- */
- private String name_Pseudostate_9000(Pseudostate it) {
- return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents());
- }
-
- /**
- * @generated
- */
- private PseudostateKind kind_Pseudostate_10000(Pseudostate it) {
- return PseudostateKind.FORK_LITERAL;
- }
-
- /**
- * @generated
- */
- private String name_Pseudostate_10000(Pseudostate it) {
- return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents());
- }
-
- /**
- * @generated
- */
- private PseudostateKind kind_Pseudostate_11000(Pseudostate it) {
- return PseudostateKind.CHOICE_LITERAL;
- }
-
- /**
- * @generated
- */
- private String name_Pseudostate_11000(Pseudostate it) {
- return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents());
- }
-
- /**
- * @generated
- */
- private PseudostateKind kind_Pseudostate_12000(Pseudostate it) {
- return PseudostateKind.JUNCTION_LITERAL;
- }
-
- /**
- * @generated
- */
- private String name_Pseudostate_12000(Pseudostate it) {
- return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents());
- }
-
- /**
- * @generated
- */
- private PseudostateKind kind_Pseudostate_13000(Pseudostate it) {
- return PseudostateKind.SHALLOW_HISTORY_LITERAL;
- }
-
- /**
- * @generated
- */
- private String name_Pseudostate_13000(Pseudostate it) {
- return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents());
- }
-
- /**
- * @generated
- */
- private PseudostateKind kind_Pseudostate_14000(Pseudostate it) {
- return PseudostateKind.DEEP_HISTORY_LITERAL;
- }
-
- /**
- * @generated
- */
- private String name_Pseudostate_14000(Pseudostate it) {
- return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents());
- }
-
- /**
- * @generated
- */
- private PseudostateKind kind_Pseudostate_15000(Pseudostate it) {
- return PseudostateKind.TERMINATE_LITERAL;
- }
-
- /**
- * @generated
- */
- private String name_Pseudostate_15000(Pseudostate it) {
- return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents());
- }
-
- /**
- * @generated
- */
- private PseudostateKind kind_Pseudostate_16000(Pseudostate it) {
- return PseudostateKind.ENTRY_POINT_LITERAL;
- }
-
- /**
- * @generated
- */
- private String name_Pseudostate_16000(Pseudostate it) {
- return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents());
- }
-
- /**
- * @generated
- */
- private PseudostateKind kind_Pseudostate_17000(Pseudostate it) {
- return PseudostateKind.EXIT_POINT_LITERAL;
- }
-
- /**
- * @generated
- */
- private String name_Pseudostate_17000(Pseudostate it) {
- return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents());
- }
-
- /**
- * @generated
- */
- private String name_ConnectionPointReference_18000(ConnectionPointReference it) {
- return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents());
- }
-
- /**
- * @generated
- */
- private String body_Comment_666(Comment it) {
- return "";
- }
-
- /**
- * @generated
- */
- private String name_Constraint_668(Constraint it) {
- return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents());
- }
-
- /**
- * @generated
- */
- private ValueSpecification specification_Constraint_668(Constraint it) {
- LiteralString literalString = UMLFactory.eINSTANCE.createLiteralString();
- literalString.setValue("");
- return literalString;
- }
-
- /**
- * @generated
- */
- private String name_Transition_680(Transition it) {
- return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents());
- }
-
- /**
- * @generated
- */
- private String name_Transition_7000(Transition it) {
- return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents());
- }
-
- /**
- * @generated
- */
- public static ElementInitializers getInstance() {
- ElementInitializers cached = UMLDiagramEditorPlugin.getInstance().getElementInitializers();
- if(cached == null) {
- UMLDiagramEditorPlugin.getInstance().setElementInitializers(cached = new ElementInitializers());
- }
- return cached;
- }
-}
+/**
+ * Copyright (c) 2014 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:
+ * CEA LIST - Initial API and implementation
+ */
+package org.eclipse.papyrus.uml.diagram.statemachine.providers;
+
+import org.eclipse.papyrus.uml.diagram.statemachine.custom.expressions.UMLAbstractExpression;
+import org.eclipse.papyrus.uml.diagram.statemachine.part.UMLDiagramEditorPlugin;
+import org.eclipse.papyrus.uml.tools.utils.NamedElementUtil;
+import org.eclipse.uml2.uml.Comment;
+import org.eclipse.uml2.uml.ConnectionPointReference;
+import org.eclipse.uml2.uml.Constraint;
+import org.eclipse.uml2.uml.FinalState;
+import org.eclipse.uml2.uml.LiteralString;
+import org.eclipse.uml2.uml.Pseudostate;
+import org.eclipse.uml2.uml.PseudostateKind;
+import org.eclipse.uml2.uml.Region;
+import org.eclipse.uml2.uml.State;
+import org.eclipse.uml2.uml.StateMachine;
+import org.eclipse.uml2.uml.Transition;
+import org.eclipse.uml2.uml.UMLFactory;
+import org.eclipse.uml2.uml.UMLPackage;
+import org.eclipse.uml2.uml.ValueSpecification;
+
+/**
+ * @generated
+ */
+public class ElementInitializers {
+
+ protected ElementInitializers() {
+ // use #getInstance to access cached instance
+ }
+
+ /**
+ * @generated
+ */
+ public void init_StateMachine_2000(StateMachine instance) {
+ try {
+ Object value_0 = name_StateMachine_2000(instance);
+ if(value_0 != null) {
+ instance.setName((String)value_0);
+ }
+ Region newInstance_1_0 = UMLFactory.eINSTANCE.createRegion();
+ instance.getRegions().add(newInstance_1_0);
+ Object value_1_0_0 = name_region_StateMachine_2000(newInstance_1_0);
+ if(value_1_0_0 != null) {
+ newInstance_1_0.setName((String)value_1_0_0);
+ }
+ } catch (RuntimeException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void init_Region_3000(Region instance) {
+ try {
+ Object value_0 = name_Region_3000(instance);
+ if(value_0 != null) {
+ instance.setName((String)value_0);
+ }
+ } catch (RuntimeException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void init_FinalState_5000(FinalState instance) {
+ try {
+ Object value_0 = name_FinalState_5000(instance);
+ if(value_0 != null) {
+ instance.setName((String)value_0);
+ }
+ } catch (RuntimeException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void init_State_6000(State instance) {
+ try {
+ Object value_0 = name_State_6000(instance);
+ if(value_0 != null) {
+ instance.setName((String)value_0);
+ }
+ } catch (RuntimeException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void init_Pseudostate_8000(Pseudostate instance) {
+ try {
+ Object value_0 = kind_Pseudostate_8000(instance);
+ if(value_0 != null) {
+ value_0 = UMLAbstractExpression.performCast(value_0, UMLPackage.eINSTANCE.getPseudostateKind());
+ instance.setKind((PseudostateKind)value_0);
+ }
+ Object value_1 = name_Pseudostate_8000(instance);
+ if(value_1 != null) {
+ instance.setName((String)value_1);
+ }
+ } catch (RuntimeException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void init_Pseudostate_9000(Pseudostate instance) {
+ try {
+ Object value_0 = kind_Pseudostate_9000(instance);
+ if(value_0 != null) {
+ value_0 = UMLAbstractExpression.performCast(value_0, UMLPackage.eINSTANCE.getPseudostateKind());
+ instance.setKind((PseudostateKind)value_0);
+ }
+ Object value_1 = name_Pseudostate_9000(instance);
+ if(value_1 != null) {
+ instance.setName((String)value_1);
+ }
+ } catch (RuntimeException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void init_Pseudostate_10000(Pseudostate instance) {
+ try {
+ Object value_0 = kind_Pseudostate_10000(instance);
+ if(value_0 != null) {
+ value_0 = UMLAbstractExpression.performCast(value_0, UMLPackage.eINSTANCE.getPseudostateKind());
+ instance.setKind((PseudostateKind)value_0);
+ }
+ Object value_1 = name_Pseudostate_10000(instance);
+ if(value_1 != null) {
+ instance.setName((String)value_1);
+ }
+ } catch (RuntimeException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void init_Pseudostate_11000(Pseudostate instance) {
+ try {
+ Object value_0 = kind_Pseudostate_11000(instance);
+ if(value_0 != null) {
+ value_0 = UMLAbstractExpression.performCast(value_0, UMLPackage.eINSTANCE.getPseudostateKind());
+ instance.setKind((PseudostateKind)value_0);
+ }
+ Object value_1 = name_Pseudostate_11000(instance);
+ if(value_1 != null) {
+ instance.setName((String)value_1);
+ }
+ } catch (RuntimeException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void init_Pseudostate_12000(Pseudostate instance) {
+ try {
+ Object value_0 = kind_Pseudostate_12000(instance);
+ if(value_0 != null) {
+ value_0 = UMLAbstractExpression.performCast(value_0, UMLPackage.eINSTANCE.getPseudostateKind());
+ instance.setKind((PseudostateKind)value_0);
+ }
+ Object value_1 = name_Pseudostate_12000(instance);
+ if(value_1 != null) {
+ instance.setName((String)value_1);
+ }
+ } catch (RuntimeException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void init_Pseudostate_13000(Pseudostate instance) {
+ try {
+ Object value_0 = kind_Pseudostate_13000(instance);
+ if(value_0 != null) {
+ value_0 = UMLAbstractExpression.performCast(value_0, UMLPackage.eINSTANCE.getPseudostateKind());
+ instance.setKind((PseudostateKind)value_0);
+ }
+ Object value_1 = name_Pseudostate_13000(instance);
+ if(value_1 != null) {
+ instance.setName((String)value_1);
+ }
+ } catch (RuntimeException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void init_Pseudostate_14000(Pseudostate instance) {
+ try {
+ Object value_0 = kind_Pseudostate_14000(instance);
+ if(value_0 != null) {
+ value_0 = UMLAbstractExpression.performCast(value_0, UMLPackage.eINSTANCE.getPseudostateKind());
+ instance.setKind((PseudostateKind)value_0);
+ }
+ Object value_1 = name_Pseudostate_14000(instance);
+ if(value_1 != null) {
+ instance.setName((String)value_1);
+ }
+ } catch (RuntimeException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void init_Pseudostate_15000(Pseudostate instance) {
+ try {
+ Object value_0 = kind_Pseudostate_15000(instance);
+ if(value_0 != null) {
+ value_0 = UMLAbstractExpression.performCast(value_0, UMLPackage.eINSTANCE.getPseudostateKind());
+ instance.setKind((PseudostateKind)value_0);
+ }
+ Object value_1 = name_Pseudostate_15000(instance);
+ if(value_1 != null) {
+ instance.setName((String)value_1);
+ }
+ } catch (RuntimeException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void init_Pseudostate_16000(Pseudostate instance) {
+ try {
+ Object value_0 = kind_Pseudostate_16000(instance);
+ if(value_0 != null) {
+ value_0 = UMLAbstractExpression.performCast(value_0, UMLPackage.eINSTANCE.getPseudostateKind());
+ instance.setKind((PseudostateKind)value_0);
+ }
+ Object value_1 = name_Pseudostate_16000(instance);
+ if(value_1 != null) {
+ instance.setName((String)value_1);
+ }
+ } catch (RuntimeException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void init_Pseudostate_17000(Pseudostate instance) {
+ try {
+ Object value_0 = kind_Pseudostate_17000(instance);
+ if(value_0 != null) {
+ value_0 = UMLAbstractExpression.performCast(value_0, UMLPackage.eINSTANCE.getPseudostateKind());
+ instance.setKind((PseudostateKind)value_0);
+ }
+ Object value_1 = name_Pseudostate_17000(instance);
+ if(value_1 != null) {
+ instance.setName((String)value_1);
+ }
+ } catch (RuntimeException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void init_ConnectionPointReference_18000(ConnectionPointReference instance) {
+ try {
+ Object value_0 = name_ConnectionPointReference_18000(instance);
+ if(value_0 != null) {
+ instance.setName((String)value_0);
+ }
+ } catch (RuntimeException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void init_Comment_666(Comment instance) {
+ try {
+ Object value_0 = body_Comment_666(instance);
+ if(value_0 != null) {
+ instance.setBody((String)value_0);
+ }
+ } catch (RuntimeException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void init_Constraint_668(Constraint instance) {
+ try {
+ Object value_0 = name_Constraint_668(instance);
+ if(value_0 != null) {
+ instance.setName((String)value_0);
+ }
+ Object value_1 = specification_Constraint_668(instance);
+ if(value_1 != null) {
+ instance.setSpecification((ValueSpecification)value_1);
+ }
+ } catch (RuntimeException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void init_Transition_680(Transition instance) {
+ try {
+ Object value_0 = name_Transition_680(instance);
+ if(value_0 != null) {
+ instance.setName((String)value_0);
+ }
+ } catch (RuntimeException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void init_Transition_7000(Transition instance) {
+ try {
+ Object value_0 = name_Transition_7000(instance);
+ if(value_0 != null) {
+ instance.setName((String)value_0);
+ }
+ } catch (RuntimeException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private String name_StateMachine_2000(StateMachine it) {
+ return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents());
+ }
+
+ /**
+ * @generated
+ */
+ private String name_region_StateMachine_2000(Region it) {
+ return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents());
+ }
+
+ /**
+ * @generated
+ */
+ private String name_Region_3000(Region it) {
+ return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents());
+ }
+
+ /**
+ * @generated
+ */
+ private String name_FinalState_5000(FinalState it) {
+ return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents());
+ }
+
+ /**
+ * @generated
+ */
+ private String name_State_6000(State it) {
+ return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents());
+ }
+
+ /**
+ * @generated
+ */
+ private PseudostateKind kind_Pseudostate_8000(Pseudostate it) {
+ return PseudostateKind.INITIAL_LITERAL;
+ }
+
+ /**
+ * @generated
+ */
+ private String name_Pseudostate_8000(Pseudostate it) {
+ return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents());
+ }
+
+ /**
+ * @generated
+ */
+ private PseudostateKind kind_Pseudostate_9000(Pseudostate it) {
+ return PseudostateKind.JOIN_LITERAL;
+ }
+
+ /**
+ * @generated
+ */
+ private String name_Pseudostate_9000(Pseudostate it) {
+ return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents());
+ }
+
+ /**
+ * @generated
+ */
+ private PseudostateKind kind_Pseudostate_10000(Pseudostate it) {
+ return PseudostateKind.FORK_LITERAL;
+ }
+
+ /**
+ * @generated
+ */
+ private String name_Pseudostate_10000(Pseudostate it) {
+ return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents());
+ }
+
+ /**
+ * @generated
+ */
+ private PseudostateKind kind_Pseudostate_11000(Pseudostate it) {
+ return PseudostateKind.CHOICE_LITERAL;
+ }
+
+ /**
+ * @generated
+ */
+ private String name_Pseudostate_11000(Pseudostate it) {
+ return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents());
+ }
+
+ /**
+ * @generated
+ */
+ private PseudostateKind kind_Pseudostate_12000(Pseudostate it) {
+ return PseudostateKind.JUNCTION_LITERAL;
+ }
+
+ /**
+ * @generated
+ */
+ private String name_Pseudostate_12000(Pseudostate it) {
+ return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents());
+ }
+
+ /**
+ * @generated
+ */
+ private PseudostateKind kind_Pseudostate_13000(Pseudostate it) {
+ return PseudostateKind.SHALLOW_HISTORY_LITERAL;
+ }
+
+ /**
+ * @generated
+ */
+ private String name_Pseudostate_13000(Pseudostate it) {
+ return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents());
+ }
+
+ /**
+ * @generated
+ */
+ private PseudostateKind kind_Pseudostate_14000(Pseudostate it) {
+ return PseudostateKind.DEEP_HISTORY_LITERAL;
+ }
+
+ /**
+ * @generated
+ */
+ private String name_Pseudostate_14000(Pseudostate it) {
+ return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents());
+ }
+
+ /**
+ * @generated
+ */
+ private PseudostateKind kind_Pseudostate_15000(Pseudostate it) {
+ return PseudostateKind.TERMINATE_LITERAL;
+ }
+
+ /**
+ * @generated
+ */
+ private String name_Pseudostate_15000(Pseudostate it) {
+ return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents());
+ }
+
+ /**
+ * @generated
+ */
+ private PseudostateKind kind_Pseudostate_16000(Pseudostate it) {
+ return PseudostateKind.ENTRY_POINT_LITERAL;
+ }
+
+ /**
+ * @generated
+ */
+ private String name_Pseudostate_16000(Pseudostate it) {
+ return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents());
+ }
+
+ /**
+ * @generated
+ */
+ private PseudostateKind kind_Pseudostate_17000(Pseudostate it) {
+ return PseudostateKind.EXIT_POINT_LITERAL;
+ }
+
+ /**
+ * @generated
+ */
+ private String name_Pseudostate_17000(Pseudostate it) {
+ return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents());
+ }
+
+ /**
+ * @generated
+ */
+ private String name_ConnectionPointReference_18000(ConnectionPointReference it) {
+ return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents());
+ }
+
+ /**
+ * @generated
+ */
+ private String body_Comment_666(Comment it) {
+ return "";
+ }
+
+ /**
+ * @generated
+ */
+ private String name_Constraint_668(Constraint it) {
+ return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents());
+ }
+
+ /**
+ * @generated
+ */
+ private ValueSpecification specification_Constraint_668(Constraint it) {
+ LiteralString literalString = UMLFactory.eINSTANCE.createLiteralString();
+ literalString.setValue("");
+ return literalString;
+ }
+
+ /**
+ * @generated
+ */
+ private String name_Transition_680(Transition it) {
+ return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents());
+ }
+
+ /**
+ * @generated
+ */
+ private String name_Transition_7000(Transition it) {
+ return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents());
+ }
+
+ /**
+ * @generated
+ */
+ public static ElementInitializers getInstance() {
+ ElementInitializers cached = UMLDiagramEditorPlugin.getInstance().getElementInitializers();
+ if(cached == null) {
+ UMLDiagramEditorPlugin.getInstance().setElementInitializers(cached = new ElementInitializers());
+ }
+ return cached;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/providers/UMLElementTypes.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/providers/UMLElementTypes.java
index 40132c6635c..7a7cd327bbf 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/providers/UMLElementTypes.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/providers/UMLElementTypes.java
@@ -28,6 +28,7 @@ import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.CommentEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ConnectionPointReferenceEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ConstraintConstrainedElementEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ConstraintEditPart;
+import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ContextLinkEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.DoActivityStateBehaviorStateEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.EntryStateBehaviorEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ExitStateBehaviorEditPart;
@@ -212,6 +213,11 @@ public class UMLElementTypes {
/**
* @generated
*/
+ public static final IElementType ConstraintContext_8500 = getElementType("org.eclipse.papyrus.uml.diagram.statemachine.ConstraintContext_8500"); //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
public static ImageDescriptor getImageDescriptor(ENamedElement element) {
return elementTypeImages.getImageDescriptor(element);
}
@@ -272,6 +278,7 @@ public class UMLElementTypes {
elements.put(Generalization_19000, UMLPackage.eINSTANCE.getGeneralization());
elements.put(CommentAnnotatedElement_667, UMLPackage.eINSTANCE.getComment_AnnotatedElement());
elements.put(ConstraintConstrainedElement_670, UMLPackage.eINSTANCE.getConstraint_ConstrainedElement());
+ elements.put(ConstraintContext_8500, UMLPackage.eINSTANCE.getConstraint_Context());
}
return (ENamedElement)elements.get(type);
}
@@ -315,6 +322,7 @@ public class UMLElementTypes {
KNOWN_ELEMENT_TYPES.add(Generalization_19000);
KNOWN_ELEMENT_TYPES.add(CommentAnnotatedElement_667);
KNOWN_ELEMENT_TYPES.add(ConstraintConstrainedElement_670);
+ KNOWN_ELEMENT_TYPES.add(ConstraintContext_8500);
}
return KNOWN_ELEMENT_TYPES.contains(elementType);
}
@@ -376,6 +384,8 @@ public class UMLElementTypes {
return CommentAnnotatedElement_667;
case ConstraintConstrainedElementEditPart.VISUAL_ID:
return ConstraintConstrainedElement_670;
+ case ContextLinkEditPart.VISUAL_ID:
+ return ConstraintContext_8500;
}
return null;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/providers/UMLParserProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/providers/UMLParserProvider.java
index 1d9255b3985..85ca649874a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/providers/UMLParserProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/providers/UMLParserProvider.java
@@ -36,6 +36,7 @@ import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ConnectionPointRe
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ConnectionPointReferenceStereotypeEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ConstraintBodyEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ConstraintNameLabelEditPart;
+import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ContextLinkAppliedStereotypeEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.DoActivityStateBehaviorStateEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.EntryStateBehaviorEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ExitStateBehaviorEditPart;
@@ -672,6 +673,26 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
/**
* @generated
*/
+ private IParser constraintContextName_8501Parser;
+
+ /**
+ * @generated
+ */
+ private IParser getConstraintContextName_8501Parser() {
+ if(constraintContextName_8501Parser == null) {
+ EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ MessageFormatParser parser = new MessageFormatParser(features);
+ parser.setViewPattern("<<{0}>>"); //$NON-NLS-1$
+ parser.setEditorPattern("<<{0}>>"); //$NON-NLS-1$
+ parser.setEditPattern("<<{0}>>"); //$NON-NLS-1$
+ constraintContextName_8501Parser = parser;
+ }
+ return constraintContextName_8501Parser;
+ }
+
+ /**
+ * @generated
+ */
protected IParser getParser(int visualID) {
switch(visualID) {
case StateMachineNameEditPart.VISUAL_ID:
@@ -748,6 +769,8 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
return getTransitionName_7003Parser();
case GeneralizationStereotypeEditPart.VISUAL_ID:
return getGeneralizationIsSubstitutable_19002Parser();
+ case ContextLinkAppliedStereotypeEditPart.VISUAL_ID:
+ return getConstraintContextName_8501Parser();
}
return null;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/providers/UMLViewProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/providers/UMLViewProvider.java
index ecd054207aa..d7ea417a889 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/providers/UMLViewProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/providers/UMLViewProvider.java
@@ -67,6 +67,8 @@ import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ConstraintBodyEdi
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ConstraintConstrainedElementEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ConstraintEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ConstraintNameLabelEditPart;
+import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ContextLinkAppliedStereotypeEditPart;
+import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ContextLinkEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.DoActivityStateBehaviorStateEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.EntryStateBehaviorEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ExitStateBehaviorEditPart;
@@ -151,10 +153,10 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
*/
protected boolean provides(CreateViewForKindOperation op) {
/*
- * if (op.getViewKind() == Node.class)
- * return getNodeViewClass(op.getSemanticAdapter(), op.getContainerView(), op.getSemanticHint()) != null;
- * if (op.getViewKind() == Edge.class)
- * return getEdgeViewClass(op.getSemanticAdapter(), op.getContainerView(), op.getSemanticHint()) != null;
+ if (op.getViewKind() == Node.class)
+ return getNodeViewClass(op.getSemanticAdapter(), op.getContainerView(), op.getSemanticHint()) != null;
+ if (op.getViewKind() == Edge.class)
+ return getEdgeViewClass(op.getSemanticAdapter(), op.getContainerView(), op.getSemanticHint()) != null;
*/
// check Diagram Type should be the class diagram
String modelID = UMLVisualIDRegistry.getModelID(op.getContainerView());
@@ -387,6 +389,8 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
return createCommentAnnotatedElement_667(containerView, index, persisted, preferencesHint);
case ConstraintConstrainedElementEditPart.VISUAL_ID:
return createConstraintConstrainedElement_670(containerView, index, persisted, preferencesHint);
+ case ContextLinkEditPart.VISUAL_ID:
+ return createConstraintContext_8500(containerView, index, persisted, preferencesHint);
}
// can never happen, provided #provides(CreateEdgeViewOperation) is correct
return null;
@@ -951,6 +955,32 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
/**
* @generated
*/
+ public Edge createConstraintContext_8500(View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
+ Connector edge = NotationFactory.eINSTANCE.createConnector();
+ edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
+ RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
+ List<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
+ points.add(new RelativeBendpoint());
+ points.add(new RelativeBendpoint());
+ bendpoints.setPoints(points);
+ edge.setBendpoints(bendpoints);
+ ViewUtil.insertChildView(containerView, edge, index, persisted);
+ edge.setType(UMLVisualIDRegistry.getType(ContextLinkEditPart.VISUAL_ID));
+ edge.setElement(null);
+ // initializePreferences
+ final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
+ //if (routing != null) {
+ // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
+ //}
+ Node label8501 = createLabel(edge, UMLVisualIDRegistry.getType(ContextLinkAppliedStereotypeEditPart.VISUAL_ID));
+ label8501.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
+ return edge;
+ }
+
+ /**
+ * @generated
+ */
protected void stampShortcut(View containerView, Node target) {
if(!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/sheet/UMLPropertySection.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/sheet/UMLPropertySection.java
index f034614fe51..e7068f059a4 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/sheet/UMLPropertySection.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/sheet/UMLPropertySection.java
@@ -26,7 +26,7 @@ public class UMLPropertySection extends DefaultPropertySection implements IPrope
*/
@Override
protected Object transformSelection(Object selected) {
- selected = /* super. */transformSelectionToDomain(selected);
+ selected = /*super.*/transformSelectionToDomain(selected);
return selected;
}
}

Back to the top