summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBoutheina Bannour2013-11-19 04:05:05 (EST)
committerCamille Letavernier2013-11-19 04:05:05 (EST)
commitdd74ed7f607930f23ae4118370e6e0cd50ed773b (patch)
treeb8dc7ece3ddd9b12d708d59376077d64a94c05c2
parent7e13e569f33087fc665c6bcab0978a96e0027839 (diff)
downloadorg.eclipse.papyrus-dd74ed7f607930f23ae4118370e6e0cd50ed773b.zip
org.eclipse.papyrus-dd74ed7f607930f23ae4118370e6e0cd50ed773b.tar.gz
org.eclipse.papyrus-dd74ed7f607930f23ae4118370e6e0cd50ed773b.tar.bz2
404254: [All Diagrams] Papyrus shall provide a "Context link" for
constraints https://bugs.eclipse.org/bugs/show_bug.cgi?id=404254 Add the "Context link" to Sequence Diagram
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/META-INF/MANIFEST.MF7
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomContextLinkCreateCommand.java97
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/advice/ConstraintHelperAdvice.java123
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/advice/NamespaceHelperAdvice.java110
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CustomAppliedStereotypeContextLinkLabelDisplayEditPolicy.java54
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomConstraintItemSemanticEditPolicy.java7
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomInteractionContextLinkSemanticEditPolicy.java32
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomInteractionOperandContextLinkSemanticEditPolicy.java97
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomInteractionOperandItemSemanticEditPolicy.java11
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/CustomContextLinkFigure.java51
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/providers/CustomNamespaceEditPolicyProvider.java74
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/messages.properties2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/model/sequenceDiagram.gmfgen73
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/plugin.properties1
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/plugin.xml37
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/ContextLinkCreateCommand.java91
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/ContextLinkReorientCommand.java147
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CommentBodyEditPart.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/Constraint2EditPart.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ConstraintContextAppliedStereotypeEditPart.java712
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ConstraintEditPart.java12
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ConstraintNameEditPart.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ContextLinkEditPart.java99
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ContinuationNameEditPart.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationConstraintEditPart.java12
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationConstraintInMessageEditPart.java12
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationConstraintInMessageLabelEditPart.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationObservationLabelEditPart.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GeneralOrderingAppliedStereotypeEditPart.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionEditPart.java10
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionNameEditPart.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionOperandEditPart.java10
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionUseName2EditPart.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionUseNameEditPart.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/LifelineNameEditPart.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageAsyncAppliedStereotypeEditPart.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageCreateAppliedStereotypeEditPart.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageDeleteAppliedStereotypeEditPart.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageFoundAppliedStereotypeEditPart.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageLostAppliedStereotypeEditPart.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName2EditPart.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName3EditPart.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName4EditPart.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName5EditPart.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName6EditPart.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName7EditPart.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageNameEditPart.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageReplyAppliedStereotypeEditPart.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageSyncAppliedStereotypeEditPart.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/PackageEditPart.java55
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/StateInvariantNameEditPart.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/TimeConstraintEditPart.java12
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/UMLEditPartFactory.java4
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ConstraintItemSemanticEditPolicy.java14
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ContextLinkItemSemanticEditPolicy.java26
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/DurationConstraintInMessageItemSemanticEditPolicy.java14
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/DurationConstraintItemSemanticEditPolicy.java14
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionItemSemanticEditPolicy.java14
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionOperandItemSemanticEditPolicy.java14
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/TimeConstraintItemSemanticEditPolicy.java14
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/UMLBaseItemSemanticEditPolicy.java23
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLNavigatorSorter.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/parsers/AbstractParser.java416
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/parsers/MessageFormatParser.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/LoadResourceAction.java17
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/Messages.java25
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/ModelElementSelectionPage.java117
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLDiagramEditorUtil.java23
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLDiagramUpdater.java39
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLNewDiagramFileWizard.java4
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLPaletteFactory.java18
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLElementTypes.java113
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLIconProvider.java22
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLParserProvider.java18
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLViewProvider.java36
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/sheet/UMLPropertySection.java94
76 files changed, 2249 insertions, 861 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/META-INF/MANIFEST.MF b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/META-INF/MANIFEST.MF
index 7b7355b..f24d85e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/META-INF/MANIFEST.MF
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/META-INF/MANIFEST.MF
@@ -69,15 +69,12 @@ Require-Bundle: org.eclipse.core.expressions,
Bundle-Vendor: %providerName
Eclipse-LazyStart: true
Bundle-Version: 0.10.1.qualifier
-Bundle-Activator: org.eclipse.papyrus.uml.diagram.sequence.part.UMLDia
- gramEditorPlugin
+Bundle-Activator: org.eclipse.papyrus.uml.diagram.sequence.part.UMLDiagramEditorPlugin
Bundle-ManifestVersion: 2
-Bundle-SymbolicName: org.eclipse.papyrus.uml.diagram.sequence;singleto
- n:=true
+Bundle-SymbolicName: org.eclipse.papyrus.uml.diagram.sequence; singleton:=true
Import-Package: org.eclipse.core.databinding.observable,
org.eclipse.papyrus.infra.emf.databinding,
org.eclipse.papyrus.infra.tools.databinding,
org.eclipse.papyrus.uml.tools.databinding,
org.eclipse.papyrus.views.properties.contexts,
org.eclipse.papyrus.views.properties.modelelement
-
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomContextLinkCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomContextLinkCreateCommand.java
new file mode 100644
index 0000000..7dd82ef
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CustomContextLinkCreateCommand.java
@@ -0,0 +1,97 @@
+/*****************************************************************************
+ * 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.sequence.command;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature.Setting;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ContextLinkCreateCommand;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ContextLinkEditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
+import org.eclipse.uml2.common.util.CacheAdapter;
+import org.eclipse.uml2.uml.Constraint;
+import org.eclipse.uml2.uml.Namespace;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * use to construct the instance specification link between two instance
+ *
+ */
+public class CustomContextLinkCreateCommand extends ContextLinkCreateCommand {
+
+ public CustomContextLinkCreateCommand(CreateRelationshipRequest request, EObject source, EObject target) {
+ super(request, source, target);
+ }
+
+ private View findView(EObject element) {
+ if(element == null) {
+ return null;
+ }
+ Collection<Setting> settings = CacheAdapter.getInstance().getNonNavigableInverseReferences(element);
+ for(Setting ref : settings) {
+ if(NotationPackage.eINSTANCE.getView_Element().equals(ref.getEStructuralFeature())) {
+ View view = (View)ref.getEObject();
+ if(view != null) {
+ return view;
+ }
+ }
+ }
+ return null;
+ }
+
+ @Override
+ 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
+ }
+ if(getSource() != null) {
+ if(getSource().getContext() != null && target != null) {
+ if(getSource() instanceof Constraint) {
+ View viewConstraint = findView((Constraint)getSource());
+ List sourceConnections = ViewUtil.getSourceConnections(viewConstraint); //get all outgoing connections from constraint view
+ for(Object connector : sourceConnections) {
+ if(!(connector instanceof Edge)) {
+ continue;
+ }
+ Edge edge = (Edge)connector;
+ EObject targetElem = edge.getTarget().getElement();
+ if(targetElem instanceof Namespace) {
+ if(("" + ContextLinkEditPart.VISUAL_ID).equals(edge.getType()))
+ return false; //case of the connector representing a context link
+ }
+ }
+ }
+ }
+ }
+ if(getTarget() != null && (getTarget().getOwnedRules().contains(getTarget()))) {
+ return false;
+ }
+ return true;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/advice/ConstraintHelperAdvice.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/advice/ConstraintHelperAdvice.java
new file mode 100644
index 0000000..b0d9577
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/advice/ConstraintHelperAdvice.java
@@ -0,0 +1,123 @@
+/*****************************************************************************
+ * 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.sequence.edit.helpers.advice;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Vector;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.EStructuralFeature.Setting;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
+import org.eclipse.gmf.runtime.notation.Connector;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ContextLinkEditPart;
+import org.eclipse.uml2.common.util.CacheAdapter;
+import org.eclipse.uml2.uml.Constraint;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Namespace;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * <pre>
+ * This HelperAdvice completes {@contextLink Constraint} edit commands with diagram specific
+ * commands in order to remove context link
+ * in case a {@context Constraint} is modified.
+ * </pre>
+ */
+public class ConstraintHelperAdvice extends AbstractEditHelperAdvice {
+
+ @Override
+ protected ICommand getAfterSetCommand(SetRequest request) {
+ EObject element = request.getElementToEdit();
+ View view = findView(element);
+ if(view != null) {
+ if(element instanceof Constraint) {
+ EStructuralFeature feature = request.getFeature();
+ final Object value = request.getValue();
+ Vector<Edge> edgesToDestroy = new Vector<Edge>();
+ Element targetContextElement = null;
+ if(UMLPackage.eINSTANCE.getConstraint_Context().equals(feature)) {
+ Namespace constraintContext = ((Constraint)element).getContext();
+ if(constraintContext == value) {
+ // if the new value to set is the already context value
+ // then do noting
+ return null;
+ }
+ targetContextElement = constraintContext;
+ if(targetContextElement != null) {
+ View target = findView(targetContextElement);
+ List sourceConnections = ViewUtil.getSourceConnections(view);
+ for(Object connector : sourceConnections) {
+ if(!(connector instanceof Connector)) {
+ continue;
+ }
+ Edge edge = (Edge)connector;
+ if(("" + ContextLinkEditPart.VISUAL_ID).equals(edge.getType())) {
+ if(target.getElement() == edge.getTarget().getElement()) {
+ edgesToDestroy.add(edge);
+ }
+ }
+ }
+ }
+ if(!edgesToDestroy.isEmpty()) {
+ CompositeCommand command = new CompositeCommand("Clear context links");
+ for(Iterator iterator = edgesToDestroy.iterator(); iterator.hasNext();) {
+ Edge edgeToDestroy = (Edge)iterator.next();
+ TransactionalEditingDomain editingDomain = request.getEditingDomain();
+ DestroyElementRequest destroy = new DestroyElementRequest(editingDomain, edgeToDestroy, false);
+ Object eHelperContext = destroy.getEditHelperContext();
+ IElementType context = ElementTypeRegistry.getInstance().getElementType(eHelperContext);
+ if(context != null) {
+ ICommand result = context.getEditCommand(destroy);
+ if(result != null) {
+ command.add(result);
+ }
+ }
+ }
+ return command;
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ private View findView(EObject element) {
+ if(element == null) {
+ return null;
+ }
+ Collection<Setting> settings = CacheAdapter.getInstance().getNonNavigableInverseReferences(element);
+ for(Setting ref : settings) {
+ if(NotationPackage.eINSTANCE.getView_Element().equals(ref.getEStructuralFeature())) {
+ View view = (View)ref.getEObject();
+ if(view != null) {
+ return view;
+ }
+ }
+ }
+ return null;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/advice/NamespaceHelperAdvice.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/advice/NamespaceHelperAdvice.java
new file mode 100644
index 0000000..7966a4c
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/helpers/advice/NamespaceHelperAdvice.java
@@ -0,0 +1,110 @@
+/*****************************************************************************
+ * 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.sequence.edit.helpers.advice;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature.Setting;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.MoveRequest;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.uml2.common.util.CacheAdapter;
+import org.eclipse.uml2.uml.Constraint;
+import org.eclipse.uml2.uml.Namespace;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * <pre>
+ * This HelperAdvice completes {@ownedRule Namespace} edit commands with diagram specific
+ * commands in order to remove context link
+ * in case a {@ownedRule Namespace} is modified.
+ * </pre>
+ */
+public class NamespaceHelperAdvice extends AbstractEditHelperAdvice {
+
+ @Override
+ protected ICommand getAfterMoveCommand(MoveRequest request) {
+ EObject element = request.getTargetContainer();
+ if(element instanceof Namespace) {
+ // EStructuralFeature feature = request.getTargetFeature(element);
+ Map elemsToMove = request.getElementsToMove();
+ Edge edgeToDestroy = null;
+ for(Iterator value = elemsToMove.keySet().iterator(); value.hasNext();) {
+ Object object = (Object)value.next();
+ if(object instanceof Constraint) {
+ if(UMLPackage.eINSTANCE.getNamespace_OwnedRule().equals(elemsToMove.get(object))) {
+ View viewConstraint = findView((Constraint)object);
+ List sourceConnections = ViewUtil.getSourceConnections(viewConstraint);
+ for(Object connector : sourceConnections) {
+ if(!(connector instanceof Edge)) {
+ continue;
+ }
+ Edge edge = (Edge)connector;
+ EObject targetElem = edge.getTarget().getElement();
+ if(targetElem instanceof Namespace) {
+ if(((Namespace)targetElem).getOwnedRules().contains((Constraint)object)) {
+ edgeToDestroy = edge;
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+ if(edgeToDestroy != null) {
+ TransactionalEditingDomain editingDomain = request.getEditingDomain();
+ CompositeCommand command = new CompositeCommand("Clear owned rule link");
+ DestroyElementRequest destroy = new DestroyElementRequest(editingDomain, edgeToDestroy, false);
+ Object eHelperContext = destroy.getEditHelperContext();
+ IElementType context = ElementTypeRegistry.getInstance().getElementType(eHelperContext);
+ if(context != null) {
+ ICommand result = context.getEditCommand(destroy);
+ if(result != null) {
+ command.add(result);
+ }
+ }
+ return command;
+ }
+ }
+ return null;
+ }
+
+ private View findView(EObject element) {
+ if(element == null) {
+ return null;
+ }
+ Collection<Setting> settings = CacheAdapter.getInstance().getNonNavigableInverseReferences(element);
+ for(Setting ref : settings) {
+ if(NotationPackage.eINSTANCE.getView_Element().equals(ref.getEStructuralFeature())) {
+ View view = (View)ref.getEObject();
+ if(view != null) {
+ return view;
+ }
+ }
+ }
+ return null;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CustomAppliedStereotypeContextLinkLabelDisplayEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/CustomAppliedStereotypeContextLinkLabelDisplayEditPolicy.java
new file mode 100644
index 0000000..cf0d610
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/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.sequence.edit.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.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomConstraintItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomConstraintItemSemanticEditPolicy.java
index 83c5fec..dc48f8b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomConstraintItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomConstraintItemSemanticEditPolicy.java
@@ -29,6 +29,7 @@ import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.commands.wrappers.EMFtoGMFCommandWrapper;
import org.eclipse.papyrus.uml.diagram.sequence.command.CustomCommentAnnotatedElementReorientCommand;
import org.eclipse.papyrus.uml.diagram.sequence.command.CustomConstraintConstrainedElementReorientCommand;
+import org.eclipse.papyrus.uml.diagram.sequence.command.CustomContextLinkCreateCommand;
import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2CreateCommand;
import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage2ReorientCommand;
import org.eclipse.papyrus.uml.diagram.sequence.command.CustomMessage3CreateCommand;
@@ -126,6 +127,9 @@ public class CustomConstraintItemSemanticEditPolicy extends ConstraintItemSemant
if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
+ if(UMLElementTypes.ConstraintContext_8500 == req.getElementType()) {
+ return getGEFWrapper(new CustomContextLinkCreateCommand(req, req.getSource(), req.getTarget()));
+ }
return null;
}
@@ -161,6 +165,9 @@ public class CustomConstraintItemSemanticEditPolicy extends ConstraintItemSemant
if(UMLElementTypes.ConstraintConstrainedElement_4011 == req.getElementType()) {
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
+ if(UMLElementTypes.ConstraintContext_8500 == req.getElementType()) {
+ return getGEFWrapper(new CustomContextLinkCreateCommand(req, req.getSource(), req.getTarget()));
+ }
return null;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomInteractionContextLinkSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomInteractionContextLinkSemanticEditPolicy.java
new file mode 100644
index 0000000..c9eadac
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomInteractionContextLinkSemanticEditPolicy.java
@@ -0,0 +1,32 @@
+/*****************************************************************************
+ * 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.sequence.edit.policies.semantic;
+
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.papyrus.uml.diagram.sequence.command.CustomContextLinkCreateCommand;
+import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
+
+/**
+ * This class is used to manage the the creation of a contextLink
+ */
+public class CustomInteractionContextLinkSemanticEditPolicy extends CustomInteractionItemSemanticEditPolicy {
+
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ConstraintContext_8500 == req.getElementType()) {
+ return getGEFWrapper(new CustomContextLinkCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return super.getCompleteCreateRelationshipCommand(req);
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomInteractionOperandContextLinkSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomInteractionOperandContextLinkSemanticEditPolicy.java
new file mode 100644
index 0000000..cdb0beb
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomInteractionOperandContextLinkSemanticEditPolicy.java
@@ -0,0 +1,97 @@
+/*****************************************************************************
+ * 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.sequence.edit.policies.semantic;
+
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.ConnectionEditPart;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
+import org.eclipse.gef.requests.DropRequest;
+import org.eclipse.gef.requests.ReconnectRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateUnspecifiedTypeConnectionRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.papyrus.uml.diagram.sequence.command.CustomContextLinkCreateCommand;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.helpers.AnchorHelper;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CombinedFragmentEditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ContextLinkEditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CustomLifelineEditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionEditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionOperandEditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.MessageEditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CustomLifelineEditPart.CustomLifelineFigure;
+import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
+import org.hamcrest.core.IsInstanceOf;
+
+/**
+ * This class is used to manage the the creation of a contextLink
+ */
+public class CustomInteractionOperandContextLinkSemanticEditPolicy extends CustomInteractionOperandItemSemanticEditPolicy {
+
+ protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if(UMLElementTypes.ConstraintContext_8500 == req.getElementType()) {
+ return getGEFWrapper(new CustomContextLinkCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+ return super.getCompleteCreateRelationshipCommand(req);
+ }
+
+ @Override
+ public EditPart getTargetEditPart(Request request) {
+ if(request instanceof CreateUnspecifiedTypeConnectionRequest) {
+ CreateUnspecifiedTypeConnectionRequest createRequest = (CreateUnspecifiedTypeConnectionRequest)request;
+ List<?> relationshipTypes = createRequest.getElementTypes();
+ for(Object obj : relationshipTypes) {
+ if(UMLElementTypes.ConstraintContext_8500.equals(obj)) {
+ Point location = ((DropRequest)request).getLocation();
+ EditPart host = getHost();
+ if(isEnterAnchorArea(host, location)) {
+ return host;
+ }
+ }
+ }
+ }
+ if(request instanceof ReconnectRequest) {
+ ReconnectRequest reconnectRequest = (ReconnectRequest)request;
+ ConnectionEditPart connectionEditPart = reconnectRequest.getConnectionEditPart();
+ if(connectionEditPart instanceof ContextLinkEditPart) {
+ Point location = ((DropRequest)request).getLocation();
+ EditPart host = getHost();
+ if(isEnterAnchorArea(host, location)) {
+ return host;
+ }
+ }
+ }
+ return super.getTargetEditPart(request);
+ }
+
+ private boolean isEnterAnchorArea(EditPart editPart, Point location) {
+ Point p = location.getCopy();
+ if(editPart instanceof InteractionEditPart || editPart instanceof CombinedFragmentEditPart || editPart instanceof InteractionOperandEditPart) {
+ IFigure figure = ((AbstractGraphicalEditPart)editPart).getFigure();
+ figure.translateToRelative(p);
+ // if mouse location is far from border, do not handle connection event
+ Rectangle innerRetangle = figure.getBounds().getCopy().shrink(10, 10);
+ if(innerRetangle.contains(p)) {
+ return false;
+ }
+ }
+ return true;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomInteractionOperandItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomInteractionOperandItemSemanticEditPolicy.java
index ded2371..39a1c45 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomInteractionOperandItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/semantic/CustomInteractionOperandItemSemanticEditPolicy.java
@@ -13,11 +13,14 @@
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic;
+import org.eclipse.draw2d.geometry.Point;
import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gef.ConnectionEditPart;
import org.eclipse.gef.EditPart;
import org.eclipse.gef.Request;
import org.eclipse.gef.commands.Command;
import org.eclipse.gef.commands.UnexecutableCommand;
+import org.eclipse.gef.requests.DropRequest;
import org.eclipse.gef.requests.ReconnectRequest;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
import org.eclipse.gmf.runtime.common.core.command.ICompositeCommand;
@@ -54,6 +57,7 @@ import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedEl
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentAnnotatedElementEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintConstrainedElementEditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ContextLinkEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.Message2EditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.Message3EditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.Message4EditPart;
@@ -96,6 +100,13 @@ public class CustomInteractionOperandItemSemanticEditPolicy extends InteractionO
@Override
public Command getCommand(Request request) {
if(request instanceof ReconnectRequest) {
+ ReconnectRequest reconnectRequest = (ReconnectRequest)request;
+ ConnectionEditPart connectionEditPart = reconnectRequest.getConnectionEditPart();
+ if(connectionEditPart instanceof ContextLinkEditPart) {
+ return super.getCommand(request);
+ }
+ }
+ if(request instanceof ReconnectRequest) {
EditPart combinedFragment = getHost().getParent().getParent();
((ReconnectRequest)request).setTargetEditPart(combinedFragment);
return combinedFragment.getCommand(request);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/CustomContextLinkFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/CustomContextLinkFigure.java
new file mode 100644
index 0000000..efaf5ab
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/CustomContextLinkFigure.java
@@ -0,0 +1,51 @@
+/*****************************************************************************
+ * 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.sequence.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);
+ }
+
+ protected void setStyle() {
+ 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.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/providers/CustomNamespaceEditPolicyProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/providers/CustomNamespaceEditPolicyProvider.java
new file mode 100644
index 0000000..f8f6fdd
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/providers/CustomNamespaceEditPolicyProvider.java
@@ -0,0 +1,74 @@
+/*****************************************************************************
+ * 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 (boutheina.bannour@cea.fr) - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.sequence.providers;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gmf.runtime.common.core.service.AbstractProvider;
+import org.eclipse.gmf.runtime.common.core.service.IOperation;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IPrimaryEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.diagram.ui.services.editpolicy.CreateEditPoliciesOperation;
+import org.eclipse.gmf.runtime.diagram.ui.services.editpolicy.IEditPolicyProvider;
+import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
+import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
+import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForEObject;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionEditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.InteractionOperandEditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic.CustomInteractionContextLinkSemanticEditPolicy;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic.CustomInteractionOperandContextLinkSemanticEditPolicy;
+import org.eclipse.uml2.uml.Namespace;
+
+/**
+ * An edit policy provider to install
+ *
+ * @author Boutheina Bannour
+ *
+ */
+public class CustomNamespaceEditPolicyProvider extends AbstractProvider implements IEditPolicyProvider {
+
+ public boolean provides(IOperation operation) {
+ CreateEditPoliciesOperation epOperation = (CreateEditPoliciesOperation)operation;
+ EditPart editPart = epOperation.getEditPart();
+ if(editPart == null) {
+ return false;
+ }
+ EObject eElement = EMFHelper.getEObject(editPart);
+ if(!(eElement instanceof Namespace)) {
+ return false;
+ }
+ try {
+ // check whether the element is a papyrus element.
+ ServicesRegistry registry = ServiceUtilsForEObject.getInstance().getServiceRegistry(eElement);
+ if(registry == null) {
+ return false;
+ }
+ } catch (Exception ex) {
+ return false;
+ }
+ // primary edit part is the toplevel (main) editpart
+ return (editPart instanceof IPrimaryEditPart);
+ }
+
+ public void createEditPolicies(EditPart editPart) {
+ // install policy for InteractionEditPart
+ if(editPart instanceof InteractionEditPart) {
+ editPart.installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomInteractionContextLinkSemanticEditPolicy());
+ }
+ // install policy for InteractionOperandEditPart
+ if(editPart instanceof InteractionOperandEditPart) {
+ editPart.installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomInteractionOperandContextLinkSemanticEditPolicy());
+ }
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/messages.properties b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/messages.properties
index 9a82a0c..1f19ffa 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/messages.properties
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/messages.properties
@@ -182,3 +182,5 @@ createConstraintlink10CreationTool_title=Constraint link
createConstraintlink10CreationTool_desc=Create a constraint link
NavigatorGroupName_DestructionOccurrenceSpecification_3022_incominglinks=incoming links
NavigatorGroupName_DestructionOccurrenceSpecification_3022_outgoinglinks=outgoing links
+createContextLink11CreationTool_title=ContextLink
+createContextLink11CreationTool_desc=Creation of a context link for a Constraint
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/model/sequenceDiagram.gmfgen b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/model/sequenceDiagram.gmfgen
index ec8714b..151dd19 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/model/sequenceDiagram.gmfgen
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/model/sequenceDiagram.gmfgen
@@ -235,6 +235,10 @@
xsi:type="gmfgen:CustomBehaviour"
key="EditPolicy.GRAPHICAL_NODE_ROLE"
editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.sequence.edit.policies.SequenceGraphicalNodeEditPolicy"/>
+ <behaviour
+ xsi:type="gmfgen:CustomBehaviour"
+ key="org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.SEMANTIC_ROLE"
+ editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic.CustomInteractionOperandContextLinkSemanticEditPolicy"/>
<modelFacet>
<metaClass
href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/InteractionOperand"/>
@@ -1387,6 +1391,10 @@
xsi:type="gmfgen:CustomBehaviour"
key="org.eclipse.papyrus.uml.diagram.common.editpolicies.ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY"
editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.ShowHideCompartmentEditPolicy"/>
+ <behaviour
+ xsi:type="gmfgen:CustomBehaviour"
+ key="org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.SEMANTIC_ROLE"
+ editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic.CustomInteractionContextLinkSemanticEditPolicy"/>
<modelFacet>
<metaClass
href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Interaction"/>
@@ -2265,6 +2273,58 @@
parser="/0/@labelParsers/@implementations.8"/>
</labels>
</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.sequence.figures.CustomContextLinkFigure"/>
+ <behaviour
+ xsi:type="gmfgen:CustomBehaviour"
+ key="AppliedStereotypeLinkLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY"
+ editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.sequence.edit.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="ConstraintContextAppliedStereotypeEditPart"
+ itemSemanticEditPolicyClassName="ConstraintContextAppliedStereotypeItemSemanticEditPolicy"
+ 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">
+ <attributes
+ xsi:type="gmfgen:LabelOffsetAttributes"
+ y="60"/>
+ </viewmap>
+ <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.8"
+ 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="7001"
editPartClassName="InteractionInteractionCompartmentEditPart"
@@ -2514,6 +2574,14 @@
largeIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Constraint.gif"
smallIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Constraint.gif"
genLinks="/0/@diagram/@links.8"/>
+ <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"
+ createMethodName="createContextLink11CreationTool"
+ genLinks="/0/@diagram/@links.10"/>
</groups>
</palette>
<preferencePages
@@ -7400,12 +7468,15 @@
qualifiedName="org.eclipse.papyrus.uml.diagram.sequence.parser.custom.TimeObservationParser"/>
<implementations
xsi:type="gmfgen:CustomParser"
- uses="/0/@diagram/@links.2/@labels.1/@modelFacet /0/@diagram/@childNodes.12/@labels.1/@modelFacet /0/@diagram/@links.9/@labels.0/@modelFacet /0/@diagram/@links.1/@labels.1/@modelFacet /0/@diagram/@childNodes.17/@labels.1/@modelFacet /0/@diagram/@childNodes.10/@labels.1/@modelFacet /0/@diagram/@childNodes.16/@labels.1/@modelFacet /0/@diagram/@links.0/@labels.1/@modelFacet /0/@diagram/@childNodes.11/@labels.1/@modelFacet /0/@diagram/@links.6/@labels.1/@modelFacet /0/@diagram/@links.5/@labels.1/@modelFacet /0/@diagram/@links.3/@labels.1/@modelFacet /0/@diagram/@links.4/@labels.1/@modelFacet"
+ uses="/0/@diagram/@links.2/@labels.1/@modelFacet /0/@diagram/@childNodes.12/@labels.1/@modelFacet /0/@diagram/@links.9/@labels.0/@modelFacet /0/@diagram/@links.1/@labels.1/@modelFacet /0/@diagram/@childNodes.17/@labels.1/@modelFacet /0/@diagram/@childNodes.10/@labels.1/@modelFacet /0/@diagram/@childNodes.16/@labels.1/@modelFacet /0/@diagram/@links.0/@labels.1/@modelFacet /0/@diagram/@childNodes.11/@labels.1/@modelFacet /0/@diagram/@links.6/@labels.1/@modelFacet /0/@diagram/@links.5/@labels.1/@modelFacet /0/@diagram/@links.3/@labels.1/@modelFacet /0/@diagram/@links.4/@labels.1/@modelFacet /0/@diagram/@links.10/@labels.0/@modelFacet"
qualifiedName="org.eclipse.papyrus.uml.diagram.common.parser.stereotype.AppliedStereotypeParser"/>
<implementations
xsi:type="gmfgen:CustomParser"
uses="/0/@diagram/@childNodes.14/@labels.1/@modelFacet"
qualifiedName="org.eclipse.papyrus.uml.diagram.common.parser.ConstraintParser"/>
+ <implementations
+ xsi:type="gmfgen:CustomParser"
+ qualifiedName="org.eclipse.papyrus.diagram.common.parser.stereotype.AppliedStereotypeParser"/>
</labelParsers>
<contextMenus
context="/0/@diagram">
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/plugin.properties b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/plugin.properties
index a9fbb9f..19fa709 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/plugin.properties
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/plugin.properties
@@ -76,3 +76,4 @@ prefpage.org.eclipse.uml2.uml.diagram.appearance=Appearance
prefpage.org.eclipse.uml2.uml.diagram.connections=Connections
metatype.name.GeneralOrdering_4012=GeneralOrdering
metatype.name.DestructionOccurrenceSpecification_3022=DestructionOccurrenceSpecification
+metatype.name.ConstraintContext_8500=Undefined
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/plugin.xml b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/plugin.xml
index 74f8bd9..41ee2ce 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/plugin.xml
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/plugin.xml
@@ -202,7 +202,7 @@
<Priority name="Lowest"/>
<context viewClass="org.eclipse.gmf.runtime.notation.Diagram" semanticHints="PapyrusUMLSequenceDiagram"/>
<context viewClass="org.eclipse.gmf.runtime.notation.Node" semanticHints="2001,3007,3004,3005,3002,3016,3001,3006,3003,3017,3018,3019,3020,3021,3022,3008,3009,3023,3024"/>
- <context viewClass="org.eclipse.gmf.runtime.notation.Edge" semanticHints="4003,4004,4005,4006,4007,4008,4009,4010,4011,4012"/>
+ <context viewClass="org.eclipse.gmf.runtime.notation.Edge" semanticHints="4003,4004,4005,4006,4007,4008,4009,4010,4011,4012,8500"/>
</viewProvider>
</extension>
@@ -217,7 +217,7 @@
<method name="getType()" value="2001,3007,3004,3005,3002,3016,3001,3006,3003,3017,3018,3019,3020,3021,3022,3008,3009,3023,3024"/>
</object>
<object class="org.eclipse.gmf.runtime.notation.Edge" id="generated-links">
- <method name="getType()" value="4003,4004,4005,4006,4007,4008,4009,4010,4011,4012"/>
+ <method name="getType()" value="4003,4004,4005,4006,4007,4008,4009,4010,4011,4012,8500"/>
</object>
<object class="org.eclipse.gmf.runtime.notation.Node" id="generated-labels">
<method name="getType()" value="5001,5003,5004,5007,5002,5008,5009,5013,5010,5014,5011,5015,5005,5012,5006,5018,5019,5016,5017"/>
@@ -563,10 +563,20 @@
<param name="semanticHint" value="4012"/>
</metamodelType>
</metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/4.0.0/UML">
+ <specializationType
+ id="org.eclipse.papyrus.uml.diagram.sequence.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.sequence.TypeContext">
<enablement>
<test
@@ -575,6 +585,8 @@
</enablement>
</clientContext>
<binding context="org.eclipse.papyrus.uml.diagram.sequence.TypeContext">
+
+
<elementType ref="org.eclipse.papyrus.uml.diagram.sequence.Package_1000"/>
<elementType ref="org.eclipse.papyrus.uml.diagram.sequence.Interaction_2001"/>
<elementType ref="org.eclipse.papyrus.uml.diagram.sequence.ConsiderIgnoreFragment_3007"/>
@@ -605,6 +617,7 @@
<elementType ref="org.eclipse.papyrus.uml.diagram.sequence.CommentAnnotatedElement_4010"/>
<elementType ref="org.eclipse.papyrus.uml.diagram.sequence.ConstraintConstrainedElement_4011"/>
<elementType ref="org.eclipse.papyrus.uml.diagram.sequence.GeneralOrdering_4012"/>
+ <elementType ref="org.eclipse.papyrus.uml.diagram.sequence.ConstraintContext_8500"/>
<advice ref="org.eclipse.gmf.runtime.diagram.core.advice.notationDepdendents"/>
</binding>
</extension>
@@ -1217,6 +1230,16 @@
path=""
small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Constraint.gif">
</entry>
+ <entry
+ defineOnly="true"
+ description="Creation of a context link for a Constraint"
+ id="createContextLink11CreationTool"
+ 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>
@@ -1367,6 +1390,10 @@
id="createConstraintlink10CreationTool"
path="/createEdges2Group">
</predefinedEntry>
+ <predefinedEntry
+ id="createContextLink11CreationTool"
+ path="/createEdges2Group">
+ </predefinedEntry>
</contribution>
@@ -1489,6 +1516,12 @@
name="Lowest">
</Priority>
</editpolicyProvider>
+ <editpolicyProvider
+ class="org.eclipse.papyrus.uml.diagram.sequence.providers.CustomNamespaceEditPolicyProvider">
+ <Priority
+ name="Lowest">
+ </Priority>
+ </editpolicyProvider>
</extension>
<extension
point="org.eclipse.gmf.runtime.emf.type.core.elementTypes">
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/ContextLinkCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/ContextLinkCreateCommand.java
new file mode 100644
index 0000000..719b0e1
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/ContextLinkCreateCommand.java
@@ -0,0 +1,91 @@
+package org.eclipse.papyrus.uml.diagram.sequence.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.sequence.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.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/ContextLinkReorientCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/ContextLinkReorientCommand.java
new file mode 100644
index 0000000..deb9423
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/commands/ContextLinkReorientCommand.java
@@ -0,0 +1,147 @@
+package org.eclipse.papyrus.uml.diagram.sequence.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.sequence.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.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CommentBodyEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CommentBodyEditPart.java
index 58d693a..3b6b5f0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CommentBodyEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CommentBodyEditPart.java
@@ -45,6 +45,7 @@ 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.DefaultNodeLabelDragPolicy;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.jface.viewers.ICellEditorValidator;
@@ -134,7 +135,7 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new PackageEditPart.NodeLabelDragPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DefaultNodeLabelDragPolicy());
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/Constraint2EditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/Constraint2EditPart.java
index 3a07a12..a55a8a5 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/Constraint2EditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/Constraint2EditPart.java
@@ -32,6 +32,7 @@ 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.DefaultNodeLabelDragPolicy;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.jface.viewers.ICellEditorValidator;
@@ -121,7 +122,7 @@ public class Constraint2EditPart extends PapyrusCompartmentEditPart implements I
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new PackageEditPart.NodeLabelDragPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DefaultNodeLabelDragPolicy());
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ConstraintContextAppliedStereotypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ConstraintContextAppliedStereotypeEditPart.java
new file mode 100644
index 0000000..289c2b3
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ConstraintContextAppliedStereotypeEditPart.java
@@ -0,0 +1,712 @@
+package org.eclipse.papyrus.uml.diagram.sequence.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.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.PapyrusLabelEditPart;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
+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.sequence.edit.policies.UMLTextSelectionEditPolicy;
+import org.eclipse.papyrus.uml.diagram.sequence.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
+import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLParserProvider;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.Feature;
+
+/**
+ * @generated
+ */
+public class ConstraintContextAppliedStereotypeEditPart extends PapyrusLabelEditPart implements ITextAwareEditPart {
+
+ /**
+ * @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.sequence.edit.parts.ConstraintContextAppliedStereotypeEditPart.VISUAL_ID), new Point(0, 60));
+ }
+
+ /**
+ * @generated
+ */
+ public ConstraintContextAppliedStereotypeEditPart(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 org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) {
+ return ((org.eclipse.gmf.runtime.draw2d.ui.figures.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 org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) {
+ ((org.eclipse.gmf.runtime.draw2d.ui.figures.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 org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) {
+ return ((org.eclipse.gmf.runtime.draw2d.ui.figures.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 org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) {
+ ((org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel)figure).setIcon(icon);
+ } else if(figure instanceof ILabelFigure) {
+ ((ILabelFigure)figure).setIcon(icon);
+ } else {
+ ((Label)figure).setIcon(icon);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel 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
+ */
+ 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() {
+
+ 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.sequence.edit.parts.ConstraintContextAppliedStereotypeEditPart.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() {
+ 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) {
+ performDefaultDirectEditorEdit(theRequest);
+ } else {
+ configuration.preEditAction(resolveSemanticElement());
+ Dialog dialog = null;
+ 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:
+ // 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();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * @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) {
+ setLabelTextHelper(getFigure(), getLabelText());
+ setLabelIconHelper(getFigure(), getLabelIcon());
+ }
+ 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 org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) {
+ ((org.eclipse.gmf.runtime.draw2d.ui.figures.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 org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) {
+ ((org.eclipse.gmf.runtime.draw2d.ui.figures.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 != 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.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ConstraintEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ConstraintEditPart.java
index 6652335..4c7b2dd 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ConstraintEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ConstraintEditPart.java
@@ -289,7 +289,7 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
* @generated
*/
public List<IElementType> getMARelTypesOnSource() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(8);
+ ArrayList<IElementType> types = new ArrayList<IElementType>(9);
types.add(UMLElementTypes.Message_4003);
types.add(UMLElementTypes.Message_4004);
types.add(UMLElementTypes.Message_4005);
@@ -298,6 +298,7 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
types.add(UMLElementTypes.Message_4008);
types.add(UMLElementTypes.Message_4009);
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
+ types.add(UMLElementTypes.ConstraintContext_8500);
return types;
}
@@ -762,6 +763,12 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
if(targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
+ if(targetEditPart instanceof InteractionEditPart) {
+ types.add(UMLElementTypes.ConstraintContext_8500);
+ }
+ if(targetEditPart instanceof InteractionOperandEditPart) {
+ types.add(UMLElementTypes.ConstraintContext_8500);
+ }
return types;
}
@@ -930,6 +937,9 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
+ } else if(relationshipType == UMLElementTypes.ConstraintContext_8500) {
+ types.add(UMLElementTypes.Interaction_2001);
+ types.add(UMLElementTypes.InteractionOperand_3005);
}
return types;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ConstraintNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ConstraintNameEditPart.java
index 242e54d..e87b247 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ConstraintNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ConstraintNameEditPart.java
@@ -45,6 +45,7 @@ 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.DefaultNodeLabelDragPolicy;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.jface.viewers.ICellEditorValidator;
@@ -133,7 +134,7 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new PackageEditPart.NodeLabelDragPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DefaultNodeLabelDragPolicy());
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ContextLinkEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ContextLinkEditPart.java
new file mode 100644
index 0000000..bd735ac
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ContextLinkEditPart.java
@@ -0,0 +1,99 @@
+package org.eclipse.papyrus.uml.diagram.sequence.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.sequence.edit.policies.ContextLinkItemSemanticEditPolicy;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.CustomAppliedStereotypeContextLinkLabelDisplayEditPolicy;
+import org.eclipse.papyrus.uml.diagram.sequence.figures.CustomContextLinkFigure;
+
+/**
+ * @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 ConstraintContextAppliedStereotypeEditPart) {
+ ((ConstraintContextAppliedStereotypeEditPart)childEditPart).setLabel(getPrimaryShape().getAppliedStereotypeLabel());
+ return true;
+ }
+ 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 ConstraintContextAppliedStereotypeEditPart) {
+ 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.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ContinuationNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ContinuationNameEditPart.java
index b413533..5e763cc 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ContinuationNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/ContinuationNameEditPart.java
@@ -46,6 +46,7 @@ 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.DefaultNodeLabelDragPolicy;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.jface.viewers.ICellEditorValidator;
@@ -138,7 +139,7 @@ public class ContinuationNameEditPart extends PapyrusCompartmentEditPart impleme
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new PackageEditPart.NodeLabelDragPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DefaultNodeLabelDragPolicy());
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationConstraintEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationConstraintEditPart.java
index 74e4d48..cb16655 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationConstraintEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationConstraintEditPart.java
@@ -259,7 +259,7 @@ public class DurationConstraintEditPart extends BorderedBorderItemEditPart {
* @generated
*/
public List<IElementType> getMARelTypesOnSource() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(8);
+ ArrayList<IElementType> types = new ArrayList<IElementType>(9);
types.add(UMLElementTypes.Message_4003);
types.add(UMLElementTypes.Message_4004);
types.add(UMLElementTypes.Message_4005);
@@ -268,6 +268,7 @@ public class DurationConstraintEditPart extends BorderedBorderItemEditPart {
types.add(UMLElementTypes.Message_4008);
types.add(UMLElementTypes.Message_4009);
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
+ types.add(UMLElementTypes.ConstraintContext_8500);
return types;
}
@@ -732,6 +733,12 @@ public class DurationConstraintEditPart extends BorderedBorderItemEditPart {
if(targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
+ if(targetEditPart instanceof InteractionEditPart) {
+ types.add(UMLElementTypes.ConstraintContext_8500);
+ }
+ if(targetEditPart instanceof InteractionOperandEditPart) {
+ types.add(UMLElementTypes.ConstraintContext_8500);
+ }
return types;
}
@@ -900,6 +907,9 @@ public class DurationConstraintEditPart extends BorderedBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
+ } else if(relationshipType == UMLElementTypes.ConstraintContext_8500) {
+ types.add(UMLElementTypes.Interaction_2001);
+ types.add(UMLElementTypes.InteractionOperand_3005);
}
return types;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationConstraintInMessageEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationConstraintInMessageEditPart.java
index bd3b49f..9554674 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationConstraintInMessageEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationConstraintInMessageEditPart.java
@@ -315,7 +315,7 @@ public class DurationConstraintInMessageEditPart extends AbstractBorderedShapeEd
* @generated
*/
public List<IElementType> getMARelTypesOnSource() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(8);
+ ArrayList<IElementType> types = new ArrayList<IElementType>(9);
types.add(UMLElementTypes.Message_4003);
types.add(UMLElementTypes.Message_4004);
types.add(UMLElementTypes.Message_4005);
@@ -324,6 +324,7 @@ public class DurationConstraintInMessageEditPart extends AbstractBorderedShapeEd
types.add(UMLElementTypes.Message_4008);
types.add(UMLElementTypes.Message_4009);
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
+ types.add(UMLElementTypes.ConstraintContext_8500);
return types;
}
@@ -788,6 +789,12 @@ public class DurationConstraintInMessageEditPart extends AbstractBorderedShapeEd
if(targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
+ if(targetEditPart instanceof InteractionEditPart) {
+ types.add(UMLElementTypes.ConstraintContext_8500);
+ }
+ if(targetEditPart instanceof InteractionOperandEditPart) {
+ types.add(UMLElementTypes.ConstraintContext_8500);
+ }
return types;
}
@@ -956,6 +963,9 @@ public class DurationConstraintInMessageEditPart extends AbstractBorderedShapeEd
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
+ } else if(relationshipType == UMLElementTypes.ConstraintContext_8500) {
+ types.add(UMLElementTypes.Interaction_2001);
+ types.add(UMLElementTypes.InteractionOperand_3005);
}
return types;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationConstraintInMessageLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationConstraintInMessageLabelEditPart.java
index 23fcd1d..f146ede 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationConstraintInMessageLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationConstraintInMessageLabelEditPart.java
@@ -45,6 +45,7 @@ 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.DefaultNodeLabelDragPolicy;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.jface.viewers.ICellEditorValidator;
@@ -133,7 +134,7 @@ public class DurationConstraintInMessageLabelEditPart extends PapyrusCompartment
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new PackageEditPart.NodeLabelDragPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DefaultNodeLabelDragPolicy());
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationObservationLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationObservationLabelEditPart.java
index 211c1e9..ef12132 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationObservationLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/DurationObservationLabelEditPart.java
@@ -45,6 +45,7 @@ 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.DefaultNodeLabelDragPolicy;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.jface.viewers.ICellEditorValidator;
@@ -133,7 +134,7 @@ public class DurationObservationLabelEditPart extends PapyrusCompartmentEditPart
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new PackageEditPart.NodeLabelDragPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DefaultNodeLabelDragPolicy());
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GeneralOrderingAppliedStereotypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GeneralOrderingAppliedStereotypeEditPart.java
index c252a9d..9d2e64f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GeneralOrderingAppliedStereotypeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/GeneralOrderingAppliedStereotypeEditPart.java
@@ -34,6 +34,7 @@ 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;
@@ -131,7 +132,7 @@ public class GeneralOrderingAppliedStereotypeEditPart extends PapyrusLabelEditPa
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new PackageEditPart.LinkLabelDragPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DefaultLinkLabelDragPolicy());
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionEditPart.java
index 324707f..d459a51 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionEditPart.java
@@ -49,6 +49,7 @@ import org.eclipse.papyrus.uml.diagram.common.figure.node.InteractionRectangleFi
import org.eclipse.papyrus.uml.diagram.common.helper.PreferenceInitializerForElementHelper;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.InteractionItemSemanticEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.SequenceGraphicalNodeEditPolicy;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic.CustomInteractionContextLinkSemanticEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.part.UMLDiagramEditorPlugin;
import org.eclipse.papyrus.uml.diagram.sequence.part.UMLVisualIDRegistry;
import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
@@ -94,6 +95,7 @@ public class InteractionEditPart extends ShapeNodeEditPart {
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new SequenceGraphicalNodeEditPolicy());
installEditPolicy(ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY, new ShowHideCompartmentEditPolicy());
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomInteractionContextLinkSemanticEditPolicy());
// XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
// removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
}
@@ -864,7 +866,7 @@ public class InteractionEditPart extends ShapeNodeEditPart {
* @generated
*/
public List<IElementType> getMARelTypesOnTarget() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(9);
+ ArrayList<IElementType> types = new ArrayList<IElementType>(10);
types.add(UMLElementTypes.Message_4003);
types.add(UMLElementTypes.Message_4004);
types.add(UMLElementTypes.Message_4005);
@@ -874,6 +876,7 @@ public class InteractionEditPart extends ShapeNodeEditPart {
types.add(UMLElementTypes.Message_4009);
types.add(UMLElementTypes.CommentAnnotatedElement_4010);
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
+ types.add(UMLElementTypes.ConstraintContext_8500);
return types;
}
@@ -1029,6 +1032,11 @@ public class InteractionEditPart extends ShapeNodeEditPart {
types.add(UMLElementTypes.DurationConstraint_3021);
types.add(UMLElementTypes.Constraint_3008);
types.add(UMLElementTypes.DurationConstraint_3023);
+ } else if(relationshipType == UMLElementTypes.ConstraintContext_8500) {
+ types.add(UMLElementTypes.TimeConstraint_3019);
+ types.add(UMLElementTypes.DurationConstraint_3021);
+ types.add(UMLElementTypes.Constraint_3008);
+ types.add(UMLElementTypes.DurationConstraint_3023);
}
return types;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionNameEditPart.java
index 5bec100..6bd2a07 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionNameEditPart.java
@@ -45,6 +45,7 @@ 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.DefaultNodeLabelDragPolicy;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.jface.viewers.ICellEditorValidator;
@@ -133,7 +134,7 @@ public class InteractionNameEditPart extends PapyrusCompartmentEditPart implemen
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new PackageEditPart.NodeLabelDragPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DefaultNodeLabelDragPolicy());
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionOperandEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionOperandEditPart.java
index 43bb3ad..3da937a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionOperandEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionOperandEditPart.java
@@ -56,6 +56,7 @@ import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.InteractionOperand
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.InteractionOperandItemSemanticEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.InteractionOperandLayoutEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.SequenceGraphicalNodeEditPolicy;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.policies.semantic.CustomInteractionOperandContextLinkSemanticEditPolicy;
import org.eclipse.papyrus.uml.diagram.sequence.figures.InteractionOperandFigure;
import org.eclipse.papyrus.uml.diagram.sequence.part.UMLDiagramEditorPlugin;
import org.eclipse.papyrus.uml.diagram.sequence.part.UMLVisualIDRegistry;
@@ -110,6 +111,7 @@ public class InteractionOperandEditPart extends AbstractBorderedShapeEditPart {
installEditPolicy(EditPolicy.COMPONENT_ROLE, new InteractionOperandComponentEditPolicy());
installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CombinedFragmentCreationEditPolicy());
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new SequenceGraphicalNodeEditPolicy());
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomInteractionOperandContextLinkSemanticEditPolicy());
// XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
// removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
}
@@ -902,7 +904,7 @@ public class InteractionOperandEditPart extends AbstractBorderedShapeEditPart {
* @generated
*/
public List<IElementType> getMARelTypesOnTarget() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(9);
+ ArrayList<IElementType> types = new ArrayList<IElementType>(10);
types.add(UMLElementTypes.Message_4003);
types.add(UMLElementTypes.Message_4004);
types.add(UMLElementTypes.Message_4005);
@@ -912,6 +914,7 @@ public class InteractionOperandEditPart extends AbstractBorderedShapeEditPart {
types.add(UMLElementTypes.Message_4009);
types.add(UMLElementTypes.CommentAnnotatedElement_4010);
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
+ types.add(UMLElementTypes.ConstraintContext_8500);
return types;
}
@@ -1067,6 +1070,11 @@ public class InteractionOperandEditPart extends AbstractBorderedShapeEditPart {
types.add(UMLElementTypes.DurationConstraint_3021);
types.add(UMLElementTypes.Constraint_3008);
types.add(UMLElementTypes.DurationConstraint_3023);
+ } else if(relationshipType == UMLElementTypes.ConstraintContext_8500) {
+ types.add(UMLElementTypes.TimeConstraint_3019);
+ types.add(UMLElementTypes.DurationConstraint_3021);
+ types.add(UMLElementTypes.Constraint_3008);
+ types.add(UMLElementTypes.DurationConstraint_3023);
}
return types;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionUseName2EditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionUseName2EditPart.java
index 6ded0f5..e6a593f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionUseName2EditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionUseName2EditPart.java
@@ -45,6 +45,7 @@ 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.DefaultNodeLabelDragPolicy;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.jface.viewers.ICellEditorValidator;
@@ -133,7 +134,7 @@ public class InteractionUseName2EditPart extends PapyrusCompartmentEditPart impl
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new PackageEditPart.NodeLabelDragPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DefaultNodeLabelDragPolicy());
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionUseNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionUseNameEditPart.java
index 8c0ae21..6358608 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionUseNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/InteractionUseNameEditPart.java
@@ -45,6 +45,7 @@ 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.DefaultNodeLabelDragPolicy;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.jface.viewers.ICellEditorValidator;
@@ -133,7 +134,7 @@ public class InteractionUseNameEditPart extends PapyrusCompartmentEditPart imple
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new PackageEditPart.NodeLabelDragPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DefaultNodeLabelDragPolicy());
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/LifelineNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/LifelineNameEditPart.java
index 3c71ccd..3964f94 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/LifelineNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/LifelineNameEditPart.java
@@ -45,6 +45,7 @@ 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.DefaultNodeLabelDragPolicy;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.jface.viewers.ICellEditorValidator;
@@ -133,7 +134,7 @@ public class LifelineNameEditPart extends PapyrusCompartmentEditPart implements
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new PackageEditPart.NodeLabelDragPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DefaultNodeLabelDragPolicy());
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageAsyncAppliedStereotypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageAsyncAppliedStereotypeEditPart.java
index 343ded7..5082d60 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageAsyncAppliedStereotypeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageAsyncAppliedStereotypeEditPart.java
@@ -46,6 +46,7 @@ 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;
@@ -140,7 +141,7 @@ public class MessageAsyncAppliedStereotypeEditPart extends PapyrusLabelEditPart
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new PackageEditPart.LinkLabelDragPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DefaultLinkLabelDragPolicy());
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageCreateAppliedStereotypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageCreateAppliedStereotypeEditPart.java
index 313ebfb..50b0280 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageCreateAppliedStereotypeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageCreateAppliedStereotypeEditPart.java
@@ -46,6 +46,7 @@ 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;
@@ -140,7 +141,7 @@ public class MessageCreateAppliedStereotypeEditPart extends PapyrusLabelEditPart
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new PackageEditPart.LinkLabelDragPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DefaultLinkLabelDragPolicy());
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageDeleteAppliedStereotypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageDeleteAppliedStereotypeEditPart.java
index 2b8b49d..ca8fa17 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageDeleteAppliedStereotypeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageDeleteAppliedStereotypeEditPart.java
@@ -46,6 +46,7 @@ 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;
@@ -140,7 +141,7 @@ public class MessageDeleteAppliedStereotypeEditPart extends PapyrusLabelEditPart
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new PackageEditPart.LinkLabelDragPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DefaultLinkLabelDragPolicy());
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageFoundAppliedStereotypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageFoundAppliedStereotypeEditPart.java
index 9ef010d..812eca5 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageFoundAppliedStereotypeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageFoundAppliedStereotypeEditPart.java
@@ -47,6 +47,7 @@ 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;
@@ -144,7 +145,7 @@ public class MessageFoundAppliedStereotypeEditPart extends PapyrusLabelEditPart
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new PackageEditPart.LinkLabelDragPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DefaultLinkLabelDragPolicy());
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageLostAppliedStereotypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageLostAppliedStereotypeEditPart.java
index c0c79f1..fbb096e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageLostAppliedStereotypeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageLostAppliedStereotypeEditPart.java
@@ -46,6 +46,7 @@ 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;
@@ -140,7 +141,7 @@ public class MessageLostAppliedStereotypeEditPart extends PapyrusLabelEditPart i
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new PackageEditPart.LinkLabelDragPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DefaultLinkLabelDragPolicy());
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName2EditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName2EditPart.java
index 6c741eb..c3d11b6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName2EditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName2EditPart.java
@@ -46,6 +46,7 @@ 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;
@@ -140,7 +141,7 @@ public class MessageName2EditPart extends PapyrusLabelEditPart implements ITextA
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new PackageEditPart.LinkLabelDragPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DefaultLinkLabelDragPolicy());
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName3EditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName3EditPart.java
index de687c0..7880dbe 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName3EditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName3EditPart.java
@@ -46,6 +46,7 @@ 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;
@@ -140,7 +141,7 @@ public class MessageName3EditPart extends PapyrusLabelEditPart implements ITextA
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new PackageEditPart.LinkLabelDragPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DefaultLinkLabelDragPolicy());
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName4EditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName4EditPart.java
index 491c3e0..8612e09 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName4EditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName4EditPart.java
@@ -46,6 +46,7 @@ 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;
@@ -140,7 +141,7 @@ public class MessageName4EditPart extends PapyrusLabelEditPart implements ITextA
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new PackageEditPart.LinkLabelDragPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DefaultLinkLabelDragPolicy());
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName5EditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName5EditPart.java
index 66db44e..4c7b398 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName5EditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName5EditPart.java
@@ -46,6 +46,7 @@ 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;
@@ -140,7 +141,7 @@ public class MessageName5EditPart extends PapyrusLabelEditPart implements ITextA
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new PackageEditPart.LinkLabelDragPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DefaultLinkLabelDragPolicy());
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName6EditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName6EditPart.java
index b53c542..575776f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName6EditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName6EditPart.java
@@ -46,6 +46,7 @@ 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;
@@ -140,7 +141,7 @@ public class MessageName6EditPart extends PapyrusLabelEditPart implements ITextA
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new PackageEditPart.LinkLabelDragPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DefaultLinkLabelDragPolicy());
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName7EditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName7EditPart.java
index 1a37a59..09f809c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName7EditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageName7EditPart.java
@@ -46,6 +46,7 @@ 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;
@@ -140,7 +141,7 @@ public class MessageName7EditPart extends PapyrusLabelEditPart implements ITextA
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new PackageEditPart.LinkLabelDragPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DefaultLinkLabelDragPolicy());
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageNameEditPart.java
index 30820d6..3760a20 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageNameEditPart.java
@@ -46,6 +46,7 @@ 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;
@@ -140,7 +141,7 @@ public class MessageNameEditPart extends PapyrusLabelEditPart implements ITextAw
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new PackageEditPart.LinkLabelDragPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DefaultLinkLabelDragPolicy());
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageReplyAppliedStereotypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageReplyAppliedStereotypeEditPart.java
index 1b5bef4..1a98efa 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageReplyAppliedStereotypeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageReplyAppliedStereotypeEditPart.java
@@ -46,6 +46,7 @@ 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;
@@ -140,7 +141,7 @@ public class MessageReplyAppliedStereotypeEditPart extends PapyrusLabelEditPart
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new PackageEditPart.LinkLabelDragPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DefaultLinkLabelDragPolicy());
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageSyncAppliedStereotypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageSyncAppliedStereotypeEditPart.java
index 416052a..755a443 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageSyncAppliedStereotypeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageSyncAppliedStereotypeEditPart.java
@@ -46,6 +46,7 @@ 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;
@@ -140,7 +141,7 @@ public class MessageSyncAppliedStereotypeEditPart extends PapyrusLabelEditPart i
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new PackageEditPart.LinkLabelDragPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DefaultLinkLabelDragPolicy());
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/PackageEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/PackageEditPart.java
index ef01c66..b595a7a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/PackageEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/PackageEditPart.java
@@ -13,16 +13,7 @@
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.sequence.edit.parts;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
-import org.eclipse.gef.handles.MoveHandle;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableLabelEditPolicy;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusDiagramEditPart;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.DuplicatePasteEditPolicy;
@@ -69,50 +60,4 @@ public class PackageEditPart extends PapyrusDiagramEditPart {
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
// removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.POPUPBAR_ROLE);
}
-
- /**
- * @generated
- */
- /* package-local */static class NodeLabelDragPolicy extends NonResizableEditPolicy {
-
- /**
- * @generated
- */
- @SuppressWarnings("rawtypes")
- protected List createSelectionHandles() {
- MoveHandle h = new MoveHandle((GraphicalEditPart)getHost());
- h.setBorder(null);
- return Collections.singletonList(h);
- }
-
- /**
- * @generated
- */
- public Command getCommand(Request request) {
- return null;
- }
-
- /**
- * @generated
- */
- public boolean understandsRequest(Request request) {
- return false;
- }
- }
-
- /**
- * @generated
- */
- /* package-local */static class LinkLabelDragPolicy extends NonResizableLabelEditPolicy {
-
- /**
- * @generated
- */
- @SuppressWarnings("rawtypes")
- protected List createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
- mh.setBorder(null);
- return Collections.singletonList(mh);
- }
- }
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/StateInvariantNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/StateInvariantNameEditPart.java
index 9dc72af..0246676 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/StateInvariantNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/StateInvariantNameEditPart.java
@@ -46,6 +46,7 @@ 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.DefaultNodeLabelDragPolicy;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.jface.viewers.ICellEditorValidator;
@@ -138,7 +139,7 @@ public class StateInvariantNameEditPart extends PapyrusCompartmentEditPart imple
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new PackageEditPart.NodeLabelDragPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DefaultNodeLabelDragPolicy());
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/TimeConstraintEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/TimeConstraintEditPart.java
index 02dd873..ab5e775 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/TimeConstraintEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/TimeConstraintEditPart.java
@@ -255,7 +255,7 @@ public class TimeConstraintEditPart extends BorderedBorderItemEditPart {
* @generated
*/
public List<IElementType> getMARelTypesOnSource() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(8);
+ ArrayList<IElementType> types = new ArrayList<IElementType>(9);
types.add(UMLElementTypes.Message_4003);
types.add(UMLElementTypes.Message_4004);
types.add(UMLElementTypes.Message_4005);
@@ -264,6 +264,7 @@ public class TimeConstraintEditPart extends BorderedBorderItemEditPart {
types.add(UMLElementTypes.Message_4008);
types.add(UMLElementTypes.Message_4009);
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
+ types.add(UMLElementTypes.ConstraintContext_8500);
return types;
}
@@ -728,6 +729,12 @@ public class TimeConstraintEditPart extends BorderedBorderItemEditPart {
if(targetEditPart instanceof DurationObservationEditPart) {
types.add(UMLElementTypes.ConstraintConstrainedElement_4011);
}
+ if(targetEditPart instanceof InteractionEditPart) {
+ types.add(UMLElementTypes.ConstraintContext_8500);
+ }
+ if(targetEditPart instanceof InteractionOperandEditPart) {
+ types.add(UMLElementTypes.ConstraintContext_8500);
+ }
return types;
}
@@ -896,6 +903,9 @@ public class TimeConstraintEditPart extends BorderedBorderItemEditPart {
types.add(UMLElementTypes.Comment_3009);
types.add(UMLElementTypes.DurationConstraint_3023);
types.add(UMLElementTypes.DurationObservation_3024);
+ } else if(relationshipType == UMLElementTypes.ConstraintContext_8500) {
+ types.add(UMLElementTypes.Interaction_2001);
+ types.add(UMLElementTypes.InteractionOperand_3005);
}
return types;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/UMLEditPartFactory.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/UMLEditPartFactory.java
index eca24de..21172f1 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/UMLEditPartFactory.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/UMLEditPartFactory.java
@@ -174,6 +174,10 @@ public class UMLEditPartFactory implements EditPartFactory {
return new GeneralOrderingEditPart(view);
case GeneralOrderingAppliedStereotypeEditPart.VISUAL_ID:
return new GeneralOrderingAppliedStereotypeEditPart(view);
+ case ContextLinkEditPart.VISUAL_ID:
+ return new ContextLinkEditPart(view);
+ case ConstraintContextAppliedStereotypeEditPart.VISUAL_ID:
+ return new ConstraintContextAppliedStereotypeEditPart(view);
}
}
return createUnrecognizedEditPart(context, model);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ConstraintItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ConstraintItemSemanticEditPolicy.java
index 65c1653..a74d10c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ConstraintItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ConstraintItemSemanticEditPolicy.java
@@ -34,6 +34,8 @@ import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedEl
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementReorientCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementReorientCommand;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ContextLinkCreateCommand;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ContextLinkReorientCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.Message2CreateCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.Message2ReorientCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.Message3CreateCommand;
@@ -50,6 +52,7 @@ import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.MessageCreateComma
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.MessageReorientCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentAnnotatedElementEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintConstrainedElementEditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ContextLinkEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.Message2EditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.Message3EditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.Message4EditPart;
@@ -172,6 +175,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;
}
@@ -249,6 +258,9 @@ public class ConstraintItemSemanticEditPolicy extends UMLBaseItemSemanticEditPol
}
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
+ if(UMLElementTypes.ConstraintContext_8500 == baseElementType) {
+ return null;
+ }
return null;
}
@@ -290,6 +302,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.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ContextLinkItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ContextLinkItemSemanticEditPolicy.java
new file mode 100644
index 0000000..568129b
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/ContextLinkItemSemanticEditPolicy.java
@@ -0,0 +1,26 @@
+package org.eclipse.papyrus.uml.diagram.sequence.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.sequence.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.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/DurationConstraintInMessageItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/DurationConstraintInMessageItemSemanticEditPolicy.java
index 55d7152..c9208bc 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/DurationConstraintInMessageItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/DurationConstraintInMessageItemSemanticEditPolicy.java
@@ -34,6 +34,8 @@ import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedEl
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementReorientCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementReorientCommand;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ContextLinkCreateCommand;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ContextLinkReorientCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.Message2CreateCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.Message2ReorientCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.Message3CreateCommand;
@@ -50,6 +52,7 @@ import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.MessageCreateComma
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.MessageReorientCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentAnnotatedElementEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintConstrainedElementEditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ContextLinkEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.Message2EditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.Message3EditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.Message4EditPart;
@@ -172,6 +175,12 @@ public class DurationConstraintInMessageItemSemanticEditPolicy extends UMLBaseIt
}
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;
}
@@ -249,6 +258,9 @@ public class DurationConstraintInMessageItemSemanticEditPolicy extends UMLBaseIt
}
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
+ if(UMLElementTypes.ConstraintContext_8500 == baseElementType) {
+ return null;
+ }
return null;
}
@@ -290,6 +302,8 @@ public class DurationConstraintInMessageItemSemanticEditPolicy extends UMLBaseIt
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.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/DurationConstraintItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/DurationConstraintItemSemanticEditPolicy.java
index a97a7e8..6a8f513 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/DurationConstraintItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/DurationConstraintItemSemanticEditPolicy.java
@@ -34,6 +34,8 @@ import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedEl
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementReorientCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementReorientCommand;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ContextLinkCreateCommand;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ContextLinkReorientCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.Message2CreateCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.Message2ReorientCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.Message3CreateCommand;
@@ -50,6 +52,7 @@ import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.MessageCreateComma
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.MessageReorientCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentAnnotatedElementEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintConstrainedElementEditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ContextLinkEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.Message2EditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.Message3EditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.Message4EditPart;
@@ -172,6 +175,12 @@ public class DurationConstraintItemSemanticEditPolicy extends UMLBaseItemSemanti
}
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;
}
@@ -249,6 +258,9 @@ public class DurationConstraintItemSemanticEditPolicy extends UMLBaseItemSemanti
}
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
+ if(UMLElementTypes.ConstraintContext_8500 == baseElementType) {
+ return null;
+ }
return null;
}
@@ -290,6 +302,8 @@ public class DurationConstraintItemSemanticEditPolicy extends UMLBaseItemSemanti
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.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionItemSemanticEditPolicy.java
index b2a86bb..fba2221 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionItemSemanticEditPolicy.java
@@ -32,6 +32,8 @@ import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedEl
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementReorientCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementReorientCommand;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ContextLinkCreateCommand;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ContextLinkReorientCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.DurationConstraintInMessageCreateCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.DurationObservationCreateCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.Message2CreateCommand;
@@ -50,6 +52,7 @@ import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.MessageCreateComma
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.MessageReorientCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentAnnotatedElementEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintConstrainedElementEditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ContextLinkEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.Message2EditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.Message3EditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.Message4EditPart;
@@ -198,6 +201,9 @@ public class InteractionItemSemanticEditPolicy extends UMLBaseItemSemanticEditPo
if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
return null;
}
+ if(UMLElementTypes.ConstraintContext_8500 == baseElementType) {
+ return null;
+ }
return null;
}
@@ -275,6 +281,12 @@ public class InteractionItemSemanticEditPolicy extends UMLBaseItemSemanticEditPo
}
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;
}
@@ -316,6 +328,8 @@ public class InteractionItemSemanticEditPolicy extends UMLBaseItemSemanticEditPo
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.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionOperandItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionOperandItemSemanticEditPolicy.java
index 28eb89a..8658fcb 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionOperandItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/InteractionOperandItemSemanticEditPolicy.java
@@ -34,6 +34,8 @@ import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedEl
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConsiderIgnoreFragmentCreateCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementReorientCommand;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ContextLinkCreateCommand;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ContextLinkReorientCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ContinuationCreateCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.InteractionUseCreateCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.Message2CreateCommand;
@@ -52,6 +54,7 @@ import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.MessageCreateComma
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.MessageReorientCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentAnnotatedElementEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintConstrainedElementEditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ContextLinkEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.Message2EditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.Message3EditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.Message4EditPart;
@@ -212,6 +215,9 @@ public class InteractionOperandItemSemanticEditPolicy extends UMLBaseItemSemanti
if(UMLElementTypes.ConstraintConstrainedElement_4011 == baseElementType) {
return null;
}
+ if(UMLElementTypes.ConstraintContext_8500 == baseElementType) {
+ return null;
+ }
return null;
}
@@ -289,6 +295,12 @@ public class InteractionOperandItemSemanticEditPolicy extends UMLBaseItemSemanti
}
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;
}
@@ -330,6 +342,8 @@ public class InteractionOperandItemSemanticEditPolicy extends UMLBaseItemSemanti
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.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/TimeConstraintItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/TimeConstraintItemSemanticEditPolicy.java
index 2f4db9b..fc36329 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/TimeConstraintItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/TimeConstraintItemSemanticEditPolicy.java
@@ -34,6 +34,8 @@ import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedEl
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementReorientCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementReorientCommand;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ContextLinkCreateCommand;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ContextLinkReorientCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.Message2CreateCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.Message2ReorientCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.Message3CreateCommand;
@@ -50,6 +52,7 @@ import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.MessageCreateComma
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.MessageReorientCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentAnnotatedElementEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintConstrainedElementEditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ContextLinkEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.Message2EditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.Message3EditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.Message4EditPart;
@@ -172,6 +175,12 @@ public class TimeConstraintItemSemanticEditPolicy extends UMLBaseItemSemanticEdi
}
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;
}
@@ -249,6 +258,9 @@ public class TimeConstraintItemSemanticEditPolicy extends UMLBaseItemSemanticEdi
}
return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
}
+ if(UMLElementTypes.ConstraintContext_8500 == baseElementType) {
+ return null;
+ }
return null;
}
@@ -290,6 +302,8 @@ public class TimeConstraintItemSemanticEditPolicy extends UMLBaseItemSemanticEdi
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.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/UMLBaseItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/UMLBaseItemSemanticEditPolicy.java
index 721796a..4eea96a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/UMLBaseItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/UMLBaseItemSemanticEditPolicy.java
@@ -63,6 +63,7 @@ import org.eclipse.uml2.uml.GeneralOrdering;
import org.eclipse.uml2.uml.Interaction;
import org.eclipse.uml2.uml.InteractionFragment;
import org.eclipse.uml2.uml.Message;
+import org.eclipse.uml2.uml.Namespace;
import org.eclipse.uml2.uml.OccurrenceSpecification;
import org.eclipse.uml2.uml.UMLPackage;
@@ -477,6 +478,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 canExistMessage_4003(Interaction container, Message linkInstance, Element source, Element target) {
try {
if(source == null) {
@@ -704,5 +720,12 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
public boolean canExistGeneralOrdering_4012(InteractionFragment container, GeneralOrdering linkInstance, OccurrenceSpecification source, OccurrenceSpecification 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.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLNavigatorSorter.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLNavigatorSorter.java
index bfa9c4f..5f5d688 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLNavigatorSorter.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/navigator/UMLNavigatorSorter.java
@@ -24,7 +24,7 @@ public class UMLNavigatorSorter extends ViewerSorter {
/**
* @generated
*/
- private static final int GROUP_CATEGORY = 7006;
+ private static final int GROUP_CATEGORY = 8502;
/**
* @generated
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/parsers/AbstractParser.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/parsers/AbstractParser.java
index 92be267..c3bd376 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/parsers/AbstractParser.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/parsers/AbstractParser.java
@@ -13,419 +13,3 @@
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.sequence.parsers;
-import java.util.Arrays;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.EDataType;
-import org.eclipse.emf.ecore.EEnum;
-import org.eclipse.emf.ecore.EEnumLiteral;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
-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.emf.commands.core.command.CompositeTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.type.core.commands.SetValueCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.papyrus.uml.diagram.sequence.part.Messages;
-import org.eclipse.papyrus.uml.diagram.sequence.part.UMLDiagramEditorPlugin;
-
-/**
- * @generated
- */
-public abstract class AbstractParser implements IParser {
-
- /**
- * @generated
- */
- protected final EAttribute[] features;
-
- /**
- * @generated
- */
- protected final EAttribute[] editableFeatures;
-
- /**
- * @generated
- */
- private String viewPattern;
-
- /**
- * @generated
- */
- private String editorPattern;
-
- /**
- * @generated
- */
- private String editPattern;
-
- /**
- * @generated
- */
- public AbstractParser(EAttribute[] features) {
- if(features == null || Arrays.asList(features).contains(null)) {
- throw new IllegalArgumentException();
- }
- this.editableFeatures = this.features = features;
- }
-
- /**
- * @generated
- */
- public AbstractParser(EAttribute[] features, EAttribute[] editableFeatures) {
- if(features == null || Arrays.asList(features).contains(null)) {
- throw new IllegalArgumentException();
- }
- this.features = features;
- if(editableFeatures == null || Arrays.asList(editableFeatures).contains(null)) {
- throw new IllegalArgumentException();
- }
- this.editableFeatures = editableFeatures;
- }
-
- /**
- * @generated
- */
- public String getViewPattern() {
- return viewPattern;
- }
-
- /**
- * @generated
- */
- public void setViewPattern(String viewPattern) {
- this.viewPattern = viewPattern;
- }
-
- /**
- * @generated
- */
- public String getEditorPattern() {
- return editorPattern;
- }
-
- /**
- * @generated
- */
- public void setEditorPattern(String editorPattern) {
- this.editorPattern = editorPattern;
- }
-
- /**
- * @generated
- */
- public String getEditPattern() {
- return editPattern;
- }
-
- /**
- * @generated
- */
- public void setEditPattern(String editPattern) {
- this.editPattern = editPattern;
- }
-
- /**
- * @generated
- */
- public boolean isAffectingEvent(Object event, int flags) {
- if(event instanceof Notification) {
- return isAffectingFeature(((Notification)event).getFeature());
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected boolean isAffectingFeature(Object feature) {
- for(int i = 0; i < features.length; i++) {
- if(features[i] == feature) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor(IAdaptable element) {
- return null;
- }
-
- /**
- * @generated
- */
- protected Object[] getValues(EObject element) {
- Object[] values = new Object[features.length];
- for(int i = 0; i < features.length; i++) {
- values[i] = getValue(element, features[i]);
- }
- return values;
- }
-
- /**
- * @generated
- */
- protected Object[] getEditableValues(EObject element) {
- Object[] values = new Object[editableFeatures.length];
- for(int i = 0; i < editableFeatures.length; i++) {
- values[i] = getValue(element, editableFeatures[i]);
- }
- return values;
- }
-
- /**
- * @generated
- */
- protected Object getValue(EObject element, EAttribute feature) {
- Object value = element.eGet(feature);
- Class iClass = feature.getEAttributeType().getInstanceClass();
- if(String.class.equals(iClass)) {
- if(value == null) {
- value = ""; //$NON-NLS-1$
- }
- }
- return value;
- }
-
- /**
- * @generated
- */
- protected ICommand getParseCommand(IAdaptable adapter, Object[] values, int flags) {
- if(values == null || validateNewValues(values).getCode() != IParserEditStatus.EDITABLE) {
- return UnexecutableCommand.INSTANCE;
- }
- EObject element = (EObject)adapter.getAdapter(EObject.class);
- TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(element);
- if(editingDomain == null) {
- return UnexecutableCommand.INSTANCE;
- }
- CompositeTransactionalCommand command = new CompositeTransactionalCommand(editingDomain, "Set Values"); //$NON-NLS-1$
- for(int i = 0; i < values.length; i++) {
- command.compose(getModificationCommand(element, editableFeatures[i], values[i]));
- }
- return command;
- }
-
- /**
- * @generated
- */
- protected ICommand getModificationCommand(EObject element, EAttribute feature, Object value) {
- value = getValidNewValue(feature, value);
- if(value instanceof InvalidValue) {
- return UnexecutableCommand.INSTANCE;
- }
- SetRequest request = new SetRequest(element, feature, value);
- return new SetValueCommand(request);
- }
-
- /**
- * @generated
- */
- protected IParserEditStatus validateNewValues(Object[] values) {
- if(values.length != editableFeatures.length) {
- return ParserEditStatus.UNEDITABLE_STATUS;
- }
- for(int i = 0; i < values.length; i++) {
- Object value = getValidNewValue(editableFeatures[i], values[i]);
- if(value instanceof InvalidValue) {
- return new ParserEditStatus(UMLDiagramEditorPlugin.ID, IParserEditStatus.UNEDITABLE, value.toString());
- }
- }
- return ParserEditStatus.EDITABLE_STATUS;
- }
-
- /**
- * @generated
- */
- protected Object getValidNewValue(EAttribute feature, Object value) {
- EClassifier type = feature.getEType();
- if(type instanceof EDataType) {
- Class iClass = type.getInstanceClass();
- if(Boolean.TYPE.equals(iClass)) {
- if(value instanceof Boolean) {
- // ok
- } else if(value instanceof String) {
- value = Boolean.valueOf((String)value);
- } else {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueType, iClass.getName()));
- }
- } else if(Character.TYPE.equals(iClass)) {
- if(value instanceof Character) {
- // ok
- } else if(value instanceof String) {
- String s = (String)value;
- if(s.length() == 0) {
- value = null;
- } else {
- value = new Character(s.charAt(0));
- }
- } else {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueType, iClass.getName()));
- }
- } else if(Byte.TYPE.equals(iClass)) {
- if(value instanceof Byte) {
- // ok
- } else if(value instanceof Number) {
- value = new Byte(((Number)value).byteValue());
- } else if(value instanceof String) {
- String s = (String)value;
- if(s.length() == 0) {
- value = null;
- } else {
- try {
- value = Byte.valueOf(s);
- } catch (NumberFormatException nfe) {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_WrongStringConversion, iClass.getName()));
- }
- }
- } else {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueType, iClass.getName()));
- }
- } else if(Short.TYPE.equals(iClass)) {
- if(value instanceof Short) {
- // ok
- } else if(value instanceof Number) {
- value = new Short(((Number)value).shortValue());
- } else if(value instanceof String) {
- String s = (String)value;
- if(s.length() == 0) {
- value = null;
- } else {
- try {
- value = Short.valueOf(s);
- } catch (NumberFormatException nfe) {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_WrongStringConversion, iClass.getName()));
- }
- }
- } else {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueType, iClass.getName()));
- }
- } else if(Integer.TYPE.equals(iClass)) {
- if(value instanceof Integer) {
- // ok
- } else if(value instanceof Number) {
- value = new Integer(((Number)value).intValue());
- } else if(value instanceof String) {
- String s = (String)value;
- if(s.length() == 0) {
- value = null;
- } else {
- try {
- value = Integer.valueOf(s);
- } catch (NumberFormatException nfe) {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_WrongStringConversion, iClass.getName()));
- }
- }
- } else {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueType, iClass.getName()));
- }
- } else if(Long.TYPE.equals(iClass)) {
- if(value instanceof Long) {
- // ok
- } else if(value instanceof Number) {
- value = new Long(((Number)value).longValue());
- } else if(value instanceof String) {
- String s = (String)value;
- if(s.length() == 0) {
- value = null;
- } else {
- try {
- value = Long.valueOf(s);
- } catch (NumberFormatException nfe) {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_WrongStringConversion, iClass.getName()));
- }
- }
- } else {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueType, iClass.getName()));
- }
- } else if(Float.TYPE.equals(iClass)) {
- if(value instanceof Float) {
- // ok
- } else if(value instanceof Number) {
- value = new Float(((Number)value).floatValue());
- } else if(value instanceof String) {
- String s = (String)value;
- if(s.length() == 0) {
- value = null;
- } else {
- try {
- value = Float.valueOf(s);
- } catch (NumberFormatException nfe) {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_WrongStringConversion, iClass.getName()));
- }
- }
- } else {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueType, iClass.getName()));
- }
- } else if(Double.TYPE.equals(iClass)) {
- if(value instanceof Double) {
- // ok
- } else if(value instanceof Number) {
- value = new Double(((Number)value).doubleValue());
- } else if(value instanceof String) {
- String s = (String)value;
- if(s.length() == 0) {
- value = null;
- } else {
- try {
- value = Double.valueOf(s);
- } catch (NumberFormatException nfe) {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_WrongStringConversion, iClass.getName()));
- }
- }
- } else {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueType, iClass.getName()));
- }
- } else if(type instanceof EEnum) {
- if(value instanceof String) {
- EEnumLiteral literal = ((EEnum)type).getEEnumLiteralByLiteral((String)value);
- if(literal == null) {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnknownLiteral, value));
- } else {
- value = literal.getInstance();
- }
- } else {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueType, String.class.getName()));
- }
- }
- }
- return value;
- }
-
- /**
- * @generated
- */
- protected class InvalidValue {
-
- /**
- * @generated
- */
- private String description;
-
- /**
- * @generated
- */
- public InvalidValue(String description) {
- this.description = description;
- }
-
- /**
- * @generated
- */
- public String toString() {
- return description;
- }
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/parsers/MessageFormatParser.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/parsers/MessageFormatParser.java
index 62cb128..25c25c0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/parsers/MessageFormatParser.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/parsers/MessageFormatParser.java
@@ -23,6 +23,7 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.gmf.tooling.runtime.parsers.AbstractAttributeParser;
import org.eclipse.osgi.util.NLS;
import org.eclipse.papyrus.uml.diagram.sequence.part.Messages;
import org.eclipse.papyrus.uml.diagram.sequence.part.UMLDiagramEditorPlugin;
@@ -30,7 +31,7 @@ import org.eclipse.papyrus.uml.diagram.sequence.part.UMLDiagramEditorPlugin;
/**
* @generated
*/
-public class MessageFormatParser extends AbstractParser {
+public class MessageFormatParser extends AbstractAttributeParser {
/**
* @generated
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/LoadResourceAction.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/LoadResourceAction.java
index 572d213..32321ef 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/LoadResourceAction.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/LoadResourceAction.java
@@ -13,30 +13,19 @@
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.sequence.part;
-import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.handlers.HandlerUtil;
+import org.eclipse.gmf.tooling.runtime.actions.DefaultLoadResourceAction;
/**
* @generated
*/
-public class LoadResourceAction extends AbstractHandler {
+public class LoadResourceAction extends DefaultLoadResourceAction {
/**
* @generated
*/
public Object execute(ExecutionEvent event) throws ExecutionException {
- IEditorPart diagramEditor = HandlerUtil.getActiveEditorChecked(event);
- Shell shell = diagramEditor.getEditorSite().getShell();
- assert diagramEditor instanceof DiagramEditor;
- TransactionalEditingDomain editingDomain = ((DiagramEditor)diagramEditor).getEditingDomain();
- org.eclipse.emf.edit.ui.action.LoadResourceAction.LoadResourceDialog loadResourceDialog = new org.eclipse.emf.edit.ui.action.LoadResourceAction.LoadResourceDialog(shell, editingDomain);
- loadResourceDialog.open();
- return null;
+ return super.execute(event);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/Messages.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/Messages.java
index a60c006..1a12e86 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/Messages.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/Messages.java
@@ -536,6 +536,16 @@ public class Messages extends NLS {
/**
* @generated
*/
+ public static String createContextLink11CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String createContextLink11CreationTool_desc;
+
+ /**
+ * @generated
+ */
public static String InteractionInteractionCompartmentEditPart_title;
/**
@@ -911,21 +921,6 @@ public class Messages extends NLS {
/**
* @generated
*/
- public static String AbstractParser_UnexpectedValueType;
-
- /**
- * @generated
- */
- public static String AbstractParser_WrongStringConversion;
-
- /**
- * @generated
- */
- public static String AbstractParser_UnknownLiteral;
-
- /**
- * @generated
- */
public static String MessageFormatParser_InvalidInputError;
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/ModelElementSelectionPage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/ModelElementSelectionPage.java
index 3656c62..d906f79 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/ModelElementSelectionPage.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/ModelElementSelectionPage.java
@@ -13,102 +13,20 @@
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.sequence.part;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.util.FeatureMap;
-import org.eclipse.emf.edit.provider.IWrapperItemProvider;
-import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
-import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
+import org.eclipse.gmf.tooling.runtime.part.DefaultModelElementSelectionPage;
/**
* Wizard page that allows to select element from model.
*
* @generated
*/
-public class ModelElementSelectionPage extends WizardPage {
-
- /**
- * @generated
- */
- protected EObject selectedModelElement;
-
- /**
- * @generated
- */
- private TreeViewer modelViewer;
+public class ModelElementSelectionPage extends DefaultModelElementSelectionPage {
/**
* @generated
*/
public ModelElementSelectionPage(String pageName) {
- super(pageName);
- }
-
- /**
- * @generated
- */
- public EObject getModelElement() {
- return selectedModelElement;
- }
-
- /**
- * @generated
- */
- public void setModelElement(EObject modelElement) {
- selectedModelElement = modelElement;
- if(modelViewer != null) {
- if(selectedModelElement != null) {
- modelViewer.setInput(selectedModelElement.eResource());
- modelViewer.setSelection(new StructuredSelection(selectedModelElement));
- } else {
- modelViewer.setInput(null);
- }
- setPageComplete(validatePage());
- }
- }
-
- /**
- * @generated
- */
- public void createControl(Composite parent) {
- initializeDialogUnits(parent);
- Composite plate = new Composite(parent, SWT.NONE);
- plate.setLayoutData(new GridData(GridData.FILL_BOTH));
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- plate.setLayout(layout);
- setControl(plate);
- Label label = new Label(plate, SWT.NONE);
- label.setText(getSelectionTitle());
- label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
- modelViewer = new TreeViewer(plate, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
- GridData layoutData = new GridData(GridData.FILL_BOTH);
- layoutData.heightHint = 300;
- layoutData.widthHint = 300;
- modelViewer.getTree().setLayoutData(layoutData);
- modelViewer.setContentProvider(new AdapterFactoryContentProvider(UMLDiagramEditorPlugin.getInstance().getItemProvidersAdapterFactory()));
- modelViewer.setLabelProvider(new AdapterFactoryLabelProvider(UMLDiagramEditorPlugin.getInstance().getItemProvidersAdapterFactory()));
- if(selectedModelElement != null) {
- modelViewer.setInput(selectedModelElement.eResource());
- modelViewer.setSelection(new StructuredSelection(selectedModelElement));
- }
- modelViewer.addSelectionChangedListener(new ISelectionChangedListener() {
-
- public void selectionChanged(SelectionChangedEvent event) {
- ModelElementSelectionPage.this.updateSelection((IStructuredSelection)event.getSelection());
- }
- });
- setPageComplete(validatePage());
+ super(UMLDiagramEditorPlugin.getInstance().getItemProvidersAdapterFactory(), pageName);
}
/**
@@ -119,33 +37,4 @@ public class ModelElementSelectionPage extends WizardPage {
protected String getSelectionTitle() {
return Messages.ModelElementSelectionPageMessage;
}
-
- /**
- * @generated
- */
- protected void updateSelection(IStructuredSelection selection) {
- selectedModelElement = null;
- if(selection.size() == 1) {
- Object selectedElement = selection.getFirstElement();
- if(selectedElement instanceof IWrapperItemProvider) {
- selectedElement = ((IWrapperItemProvider)selectedElement).getValue();
- }
- if(selectedElement instanceof FeatureMap.Entry) {
- selectedElement = ((FeatureMap.Entry)selectedElement).getValue();
- }
- if(selectedElement instanceof EObject) {
- selectedModelElement = (EObject)selectedElement;
- }
- }
- setPageComplete(validatePage());
- }
-
- /**
- * Override to provide specific validation of the selected model element.
- *
- * @generated
- */
- protected boolean validatePage() {
- return true;
- }
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLDiagramEditorUtil.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLDiagramEditorUtil.java
index 21a705e..569a423 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLDiagramEditorUtil.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLDiagramEditorUtil.java
@@ -53,6 +53,7 @@ import org.eclipse.gmf.runtime.emf.core.GMFEditingDomainFactory;
import org.eclipse.gmf.runtime.emf.core.util.EMFCoreUtil;
import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.gmf.tooling.runtime.part.DefaultDiagramEditorUtil;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.jface.wizard.WizardDialog;
@@ -111,27 +112,7 @@ public class UMLDiagramEditorUtil {
* @generated
*/
public static String getUniqueFileName(IPath containerFullPath, String fileName, String extension) {
- if(containerFullPath == null) {
- containerFullPath = new Path(""); //$NON-NLS-1$
- }
- if(fileName == null || fileName.trim().length() == 0) {
- fileName = "default"; //$NON-NLS-1$
- }
- IPath filePath = containerFullPath.append(fileName);
- if(extension != null && !extension.equals(filePath.getFileExtension())) {
- filePath = filePath.addFileExtension(extension);
- }
- extension = filePath.getFileExtension();
- fileName = filePath.removeFileExtension().lastSegment();
- int i = 1;
- while(ResourcesPlugin.getWorkspace().getRoot().exists(filePath)) {
- i++;
- filePath = containerFullPath.append(fileName + i);
- if(extension != null) {
- filePath = filePath.addFileExtension(extension);
- }
- }
- return filePath.lastSegment();
+ return DefaultDiagramEditorUtil.getUniqueFileName(containerFullPath, fileName, extension, DefaultDiagramEditorUtil.EXISTS_IN_WORKSPACE);
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLDiagramUpdater.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLDiagramUpdater.java
index ea2aedc..a3b26f9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLDiagramUpdater.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLDiagramUpdater.java
@@ -38,6 +38,7 @@ import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConsiderIgnoreFragmentEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintConstrainedElementEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintEditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ContextLinkEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ContinuationEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DestructionOccurrenceSpecificationEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationConstraintEditPart;
@@ -79,6 +80,7 @@ import org.eclipse.uml2.uml.InteractionOperand;
import org.eclipse.uml2.uml.InteractionUse;
import org.eclipse.uml2.uml.Lifeline;
import org.eclipse.uml2.uml.Message;
+import org.eclipse.uml2.uml.Namespace;
import org.eclipse.uml2.uml.OccurrenceSpecification;
import org.eclipse.uml2.uml.Package;
import org.eclipse.uml2.uml.PackageableElement;
@@ -607,6 +609,7 @@ public class UMLDiagramUpdater {
TimeConstraint modelElement = (TimeConstraint)view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElement_4011(modelElement));
+ result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_Context_8500(modelElement));
return result;
}
@@ -624,6 +627,7 @@ public class UMLDiagramUpdater {
DurationConstraint modelElement = (DurationConstraint)view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElement_4011(modelElement));
+ result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_Context_8500(modelElement));
return result;
}
@@ -694,6 +698,7 @@ public class UMLDiagramUpdater {
Constraint modelElement = (Constraint)view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElement_4011(modelElement));
+ result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_Context_8500(modelElement));
return result;
}
@@ -714,6 +719,7 @@ public class UMLDiagramUpdater {
DurationConstraint modelElement = (DurationConstraint)view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElement_4011(modelElement));
+ result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_Context_8500(modelElement));
return result;
}
@@ -806,6 +812,7 @@ public class UMLDiagramUpdater {
result.addAll(getIncomingTypeModelFacetLinks_Message_4009(modelElement, crossReferences));
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4010(modelElement, crossReferences));
result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElement_4011(modelElement, crossReferences));
+ result.addAll(getIncomingFeatureModelFacetLinks_Constraint_Context_8500(modelElement, crossReferences));
return result;
}
@@ -1035,6 +1042,7 @@ public class UMLDiagramUpdater {
result.addAll(getIncomingTypeModelFacetLinks_Message_4009(modelElement, crossReferences));
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4010(modelElement, crossReferences));
result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElement_4011(modelElement, crossReferences));
+ result.addAll(getIncomingFeatureModelFacetLinks_Constraint_Context_8500(modelElement, crossReferences));
return result;
}
@@ -1398,6 +1406,7 @@ public class UMLDiagramUpdater {
result.addAll(getOutgoingTypeModelFacetLinks_Message_4008(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_Message_4009(modelElement));
result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElement_4011(modelElement));
+ result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_Context_8500(modelElement));
return result;
}
@@ -1431,6 +1440,7 @@ public class UMLDiagramUpdater {
result.addAll(getOutgoingTypeModelFacetLinks_Message_4008(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_Message_4009(modelElement));
result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElement_4011(modelElement));
+ result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_Context_8500(modelElement));
return result;
}
@@ -1545,6 +1555,7 @@ public class UMLDiagramUpdater {
result.addAll(getOutgoingTypeModelFacetLinks_Message_4008(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_Message_4009(modelElement));
result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElement_4011(modelElement));
+ result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_Context_8500(modelElement));
return result;
}
@@ -1579,6 +1590,7 @@ public class UMLDiagramUpdater {
result.addAll(getOutgoingTypeModelFacetLinks_Message_4008(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_Message_4009(modelElement));
result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElement_4011(modelElement));
+ result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_Context_8500(modelElement));
return result;
}
@@ -2136,6 +2148,20 @@ public class UMLDiagramUpdater {
/**
* @generated
*/
+ private static Collection<UMLLinkDescriptor> getIncomingFeatureModelFacetLinks_Constraint_Context_8500(Namespace target, Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences) {
+ LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
+ Collection<EStructuralFeature.Setting> settings = crossReferences.get(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
+ */
private static Collection<UMLLinkDescriptor> getOutgoingTypeModelFacetLinks_Message_4003(Element source) {
Interaction container = null;
// Find container element for the link.
@@ -2483,6 +2509,19 @@ public class UMLDiagramUpdater {
/**
* @generated
*/
+ private static 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;
+ }
+
+ /**
+ * @generated
+ */
public static final DiagramUpdater TYPED_INSTANCE = new DiagramUpdater() {
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLNewDiagramFileWizard.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLNewDiagramFileWizard.java
index 356acf3..2ea2122 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLNewDiagramFileWizard.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLNewDiagramFileWizard.java
@@ -159,11 +159,11 @@ public class UMLNewDiagramFileWizard extends Wizard {
* @generated
*/
protected boolean validatePage() {
- if(selectedModelElement == null) {
+ if(getModelElement() == null) {
setErrorMessage(Messages.UMLNewDiagramFileWizard_RootSelectionPageNoSelectionMessage);
return false;
}
- boolean result = ViewService.getInstance().provides(new CreateDiagramViewOperation(new EObjectAdapter(selectedModelElement), PackageEditPart.MODEL_ID, UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT));
+ boolean result = ViewService.getInstance().provides(new CreateDiagramViewOperation(new EObjectAdapter(getModelElement()), PackageEditPart.MODEL_ID, UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT));
setErrorMessage(result ? null : Messages.UMLNewDiagramFileWizard_RootSelectionPageInvalidSelectionMessage);
return result;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLPaletteFactory.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLPaletteFactory.java
index 2162797..2bb685f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLPaletteFactory.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/part/UMLPaletteFactory.java
@@ -161,6 +161,11 @@ public class UMLPaletteFactory extends PaletteFactory.Adapter {
/**
* @generated
*/
+ private final static String CREATECONTEXTLINK11CREATIONTOOL = "createContextLink11CreationTool"; //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
public UMLPaletteFactory() {
}
@@ -247,6 +252,9 @@ public class UMLPaletteFactory extends PaletteFactory.Adapter {
if(toolId.equals(CREATECONSTRAINTLINK10CREATIONTOOL)) {
return createConstraintlink10CreationTool();
}
+ if(toolId.equals(CREATECONTEXTLINK11CREATIONTOOL)) {
+ return createContextLink11CreationTool();
+ }
// default return: null
return null;
}
@@ -520,4 +528,14 @@ public class UMLPaletteFactory extends PaletteFactory.Adapter {
Tool tool = new AspectUnspecifiedTypeConnectionTool(types);
return tool;
}
+
+ /**
+ * @generated
+ */
+ private Tool createContextLink11CreationTool() {
+ 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.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLElementTypes.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLElementTypes.java
index fded2c5..8d2072a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLElementTypes.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLElementTypes.java
@@ -19,14 +19,12 @@ import java.util.Map;
import java.util.Set;
import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EClassifier;
import org.eclipse.emf.ecore.ENamedElement;
-import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.tooling.runtime.providers.DiagramElementTypeImages;
+import org.eclipse.gmf.tooling.runtime.providers.DiagramElementTypes;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ActionExecutionSpecificationEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.BehaviorExecutionSpecificationEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CombinedFragment2EditPart;
@@ -36,6 +34,7 @@ import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConsiderIgnoreFragmentEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintConstrainedElementEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintEditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ContextLinkEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ContinuationEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DestructionOccurrenceSpecificationEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationConstraintEditPart;
@@ -80,7 +79,7 @@ public class UMLElementTypes {
/**
* @generated
*/
- private static ImageRegistry imageRegistry;
+ private static DiagramElementTypeImages elementTypeImages = new DiagramElementTypeImages(UMLDiagramEditorPlugin.getInstance().getItemProvidersAdapterFactory());
/**
* @generated
@@ -240,97 +239,34 @@ public class UMLElementTypes {
/**
* @generated
*/
- private static ImageRegistry getImageRegistry() {
- if(imageRegistry == null) {
- imageRegistry = new ImageRegistry();
- }
- return imageRegistry;
- }
-
- /**
- * @generated
- */
- private static String getImageRegistryKey(ENamedElement element) {
- return element.getName();
- }
-
- /**
- * @generated
- */
- private static ImageDescriptor getProvidedImageDescriptor(ENamedElement element) {
- if(element instanceof EStructuralFeature) {
- EStructuralFeature feature = ((EStructuralFeature)element);
- EClass eContainingClass = feature.getEContainingClass();
- EClassifier eType = feature.getEType();
- if(eContainingClass != null && !eContainingClass.isAbstract()) {
- element = eContainingClass;
- } else if(eType instanceof EClass && !((EClass)eType).isAbstract()) {
- element = eType;
- }
- }
- if(element instanceof EClass) {
- EClass eClass = (EClass)element;
- if(!eClass.isAbstract()) {
- return UMLDiagramEditorPlugin.getInstance().getItemImageDescriptor(eClass.getEPackage().getEFactoryInstance().create(eClass));
- }
- }
- // TODO : support structural features
- return null;
- }
+ public static final IElementType ConstraintContext_8500 = getElementType("org.eclipse.papyrus.uml.diagram.sequence.ConstraintContext_8500"); //$NON-NLS-1$
/**
* @generated
*/
public static ImageDescriptor getImageDescriptor(ENamedElement element) {
- String key = getImageRegistryKey(element);
- ImageDescriptor imageDescriptor = getImageRegistry().getDescriptor(key);
- if(imageDescriptor == null) {
- imageDescriptor = getProvidedImageDescriptor(element);
- if(imageDescriptor == null) {
- imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
- }
- getImageRegistry().put(key, imageDescriptor);
- }
- return imageDescriptor;
+ return elementTypeImages.getImageDescriptor(element);
}
/**
* @generated
*/
public static Image getImage(ENamedElement element) {
- String key = getImageRegistryKey(element);
- Image image = getImageRegistry().get(key);
- if(image == null) {
- ImageDescriptor imageDescriptor = getProvidedImageDescriptor(element);
- if(imageDescriptor == null) {
- imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
- }
- getImageRegistry().put(key, imageDescriptor);
- image = getImageRegistry().get(key);
- }
- return image;
+ return elementTypeImages.getImage(element);
}
/**
* @generated
*/
public static ImageDescriptor getImageDescriptor(IAdaptable hint) {
- ENamedElement element = getElement(hint);
- if(element == null) {
- return null;
- }
- return getImageDescriptor(element);
+ return getImageDescriptor(getElement(hint));
}
/**
* @generated
*/
public static Image getImage(IAdaptable hint) {
- ENamedElement element = getElement(hint);
- if(element == null) {
- return null;
- }
- return getImage(element);
+ return getImage(getElement(hint));
}
/**
@@ -372,6 +308,7 @@ public class UMLElementTypes {
elements.put(CommentAnnotatedElement_4010, UMLPackage.eINSTANCE.getComment_AnnotatedElement());
elements.put(ConstraintConstrainedElement_4011, UMLPackage.eINSTANCE.getConstraint_ConstrainedElement());
elements.put(GeneralOrdering_4012, UMLPackage.eINSTANCE.getGeneralOrdering());
+ elements.put(ConstraintContext_8500, UMLPackage.eINSTANCE.getConstraint_Context());
}
return (ENamedElement)elements.get(type);
}
@@ -419,6 +356,7 @@ public class UMLElementTypes {
KNOWN_ELEMENT_TYPES.add(CommentAnnotatedElement_4010);
KNOWN_ELEMENT_TYPES.add(ConstraintConstrainedElement_4011);
KNOWN_ELEMENT_TYPES.add(GeneralOrdering_4012);
+ KNOWN_ELEMENT_TYPES.add(ConstraintContext_8500);
}
return KNOWN_ELEMENT_TYPES.contains(elementType);
}
@@ -488,7 +426,36 @@ public class UMLElementTypes {
return ConstraintConstrainedElement_4011;
case GeneralOrderingEditPart.VISUAL_ID:
return GeneralOrdering_4012;
+ case ContextLinkEditPart.VISUAL_ID:
+ return ConstraintContext_8500;
}
return null;
}
+
+ /**
+ * @generated
+ */
+ public static final DiagramElementTypes TYPED_INSTANCE = new DiagramElementTypes(elementTypeImages) {
+
+ /**
+ * @generated
+ */
+ public boolean isKnownElementType(IElementType elementType) {
+ return org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes.isKnownElementType(elementType);
+ }
+
+ /**
+ * @generated
+ */
+ public IElementType getElementTypeForVisualId(int visualID) {
+ return org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes.getElementType(visualID);
+ }
+
+ /**
+ * @generated
+ */
+ public ENamedElement getDefiningNamedElement(IAdaptable elementTypeAdapter) {
+ return org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes.getElement(elementTypeAdapter);
+ }
+ };
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLIconProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLIconProvider.java
index 8b6a7d3..720761e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLIconProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLIconProvider.java
@@ -13,32 +13,18 @@
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.sequence.providers;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.gmf.runtime.common.core.service.AbstractProvider;
-import org.eclipse.gmf.runtime.common.core.service.IOperation;
-import org.eclipse.gmf.runtime.common.ui.services.icon.GetIconOperation;
import org.eclipse.gmf.runtime.common.ui.services.icon.IIconProvider;
-import org.eclipse.swt.graphics.Image;
+import org.eclipse.gmf.tooling.runtime.providers.DefaultElementTypeIconProvider;
/**
* @generated
*/
-public class UMLIconProvider extends AbstractProvider implements IIconProvider {
+public class UMLIconProvider extends DefaultElementTypeIconProvider implements IIconProvider {
/**
* @generated
*/
- public Image getIcon(IAdaptable hint, int flags) {
- return UMLElementTypes.getImage(hint);
- }
-
- /**
- * @generated
- */
- public boolean provides(IOperation operation) {
- if(operation instanceof GetIconOperation) {
- return ((GetIconOperation)operation).execute(this) != null;
- }
- return false;
+ public UMLIconProvider() {
+ super(UMLElementTypes.TYPED_INSTANCE);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLParserProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLParserProvider.java
index 1bd083c..9b63118 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLParserProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLParserProvider.java
@@ -30,6 +30,7 @@ import org.eclipse.papyrus.uml.diagram.common.parser.ConstraintParser;
import org.eclipse.papyrus.uml.diagram.common.parser.stereotype.AppliedStereotypeParser;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentBodyEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.Constraint2EditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintContextAppliedStereotypeEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintNameEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ContinuationNameEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DurationConstraintAppliedStereotypeEditPart;
@@ -606,6 +607,21 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
/**
* @generated
*/
+ private AppliedStereotypeParser constraintContextName_8501Parser;
+
+ /**
+ * @generated
+ */
+ private IParser getConstraintContextName_8501Parser() {
+ if(constraintContextName_8501Parser == null) {
+ constraintContextName_8501Parser = new AppliedStereotypeParser();
+ }
+ return constraintContextName_8501Parser;
+ }
+
+ /**
+ * @generated
+ */
protected IParser getParser(int visualID) {
switch(visualID) {
case InteractionNameEditPart.VISUAL_ID:
@@ -676,6 +692,8 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
return getMessageLabel_6014Parser();
case GeneralOrderingAppliedStereotypeEditPart.VISUAL_ID:
return getGeneralOrderingLabel_6015Parser();
+ case ConstraintContextAppliedStereotypeEditPart.VISUAL_ID:
+ return getConstraintContextName_8501Parser();
}
return null;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLViewProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLViewProvider.java
index 75ec377..66c88db 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLViewProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/providers/UMLViewProvider.java
@@ -68,8 +68,10 @@ import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CommentEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConsiderIgnoreFragmentEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.Constraint2EditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintConstrainedElementEditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintContextAppliedStereotypeEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ConstraintNameEditPart;
+import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ContextLinkEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ContinuationEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.ContinuationNameEditPart;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.DestructionOccurrenceSpecificationEditPart;
@@ -394,6 +396,8 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
return createConstraintConstrainedElement_4011(containerView, index, persisted, preferencesHint);
case GeneralOrderingEditPart.VISUAL_ID:
return createGeneralOrdering_4012(getSemanticElement(semanticAdapter), 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;
@@ -1129,6 +1133,38 @@ 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();
+ ArrayList<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();
+ PreferenceInitializerForElementHelper.initForegroundFromPrefs(edge, prefStore, "Undefined");
+ PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "Undefined");
+ //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);
+ //}
+ PreferenceInitializerForElementHelper.initRountingFromPrefs(edge, prefStore, "Undefined");
+ Node label8501 = createLabel(edge, UMLVisualIDRegistry.getType(ConstraintContextAppliedStereotypeEditPart.VISUAL_ID));
+ label8501.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
+ Location location8501 = (Location)label8501.getLayoutConstraint();
+ location8501.setX(0);
+ location8501.setY(60);
+ 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.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/sheet/UMLPropertySection.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/sheet/UMLPropertySection.java
index c2f6f80..1b3048e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/sheet/UMLPropertySection.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/sheet/UMLPropertySection.java
@@ -13,56 +13,13 @@
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.sequence.sheet;
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
-import org.eclipse.emf.edit.provider.IItemPropertySource;
-import org.eclipse.emf.edit.ui.provider.PropertySource;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.diagram.ui.properties.sections.AdvancedPropertySection;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.gmf.tooling.runtime.sheet.DefaultPropertySection;
import org.eclipse.ui.views.properties.IPropertySourceProvider;
/**
* @generated
*/
-public class UMLPropertySection extends AdvancedPropertySection implements IPropertySourceProvider {
-
- /**
- * @generated
- */
- public IPropertySource getPropertySource(Object object) {
- if(object instanceof IPropertySource) {
- return (IPropertySource)object;
- }
- AdapterFactory af = getAdapterFactory(object);
- if(af != null) {
- IItemPropertySource ips = (IItemPropertySource)af.adapt(object, IItemPropertySource.class);
- if(ips != null) {
- return new PropertySource(object, ips);
- }
- }
- if(object instanceof IAdaptable) {
- return (IPropertySource)((IAdaptable)object).getAdapter(IPropertySource.class);
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected IPropertySourceProvider getPropertySourceProvider() {
- return this;
- }
+public class UMLPropertySection extends DefaultPropertySection implements IPropertySourceProvider {
/**
* Modify/unwrap selection.
@@ -70,52 +27,7 @@ public class UMLPropertySection extends AdvancedPropertySection implements IProp
* @generated
*/
protected Object transformSelection(Object selected) {
- if(selected instanceof EditPart) {
- Object model = ((EditPart)selected).getModel();
- return model instanceof View ? ((View)model).getElement() : null;
- }
- if(selected instanceof View) {
- return ((View)selected).getElement();
- }
- if(selected instanceof IAdaptable) {
- View view = (View)((IAdaptable)selected).getAdapter(View.class);
- if(view != null) {
- return view.getElement();
- }
- }
+ selected = /* super. */transformSelectionToDomain(selected);
return selected;
}
-
- /**
- * @generated
- */
- public void setInput(IWorkbenchPart part, ISelection selection) {
- if(selection.isEmpty() || false == selection instanceof StructuredSelection) {
- super.setInput(part, selection);
- return;
- }
- final StructuredSelection structuredSelection = ((StructuredSelection)selection);
- ArrayList transformedSelection = new ArrayList(structuredSelection.size());
- for(Iterator it = structuredSelection.iterator(); it.hasNext();) {
- Object r = transformSelection(it.next());
- if(r != null) {
- transformedSelection.add(r);
- }
- }
- super.setInput(part, new StructuredSelection(transformedSelection));
- }
-
- /**
- * @generated
- */
- protected AdapterFactory getAdapterFactory(Object object) {
- if(getEditingDomain() instanceof AdapterFactoryEditingDomain) {
- return ((AdapterFactoryEditingDomain)getEditingDomain()).getAdapterFactory();
- }
- TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(object);
- if(editingDomain != null) {
- return ((AdapterFactoryEditingDomain)editingDomain).getAdapterFactory();
- }
- return null;
- }
}