Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/ClassDiagramCreationCondition.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/CreateClassDiagramCommand.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/CreateClassDiagramWithNavigationHandler.java23
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/CAssociationClassCreateCommand.java33
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/CAssociationCreateCommand.java32
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/CClassifierTemplateParameterCreateCommand.java5
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/CConnectableElementTemplateParameterCreateCommand.java5
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/COperationTemplateParameterCreateCommand.java5
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/CTemplateParameterCreateCommand.java5
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/CreateAssociationClassSupplement.java9
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/CreateAssociationSupplement.java9
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/CustomContextLinkCreateCommand.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/PropertyCommandForAssociation.java5
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/helper/AssociationClassHelper.java7
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/helper/ClazzDiagramAssociationHelper.java9
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/helper/MultiAssociationHelper.java5
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CRedefinableTemplateSignatureTemplateParameterCompartmentItemSemanticEditPolicy.java9
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CTemplateSignatureTemplateParameterCompartmentItemSemanticEditPolicy.java7
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomAssociationBranchItemSemanticEditPolicy.java5
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomAssociationClassItemSemanticEditPolicy.java9
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomAssociationClassLinkItemSemanticEditPolicy.java9
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomAssociationItemSemanticEditPolicy.java13
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomAssociationNodeItemSemanticEditPolicy.java5
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomClassItemSemanticEditPolicy.java9
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomClassItemSemanticEditPolicyCN.java9
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomComponentItemSemanticEditPolicy.java9
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomComponentItemSemanticEditPolicyCN.java9
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomDataTypeItemSemanticEditPolicy.java9
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomDataTypeItemSemanticEditPolicyCN.java9
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomEnumerationItemSemanticEditPolicy.java9
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomEnumerationItemSemanticEditPolicyCN.java9
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomInformationItemItemSemanticEditPolicy.java5
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomInterfaceItemSemanticEditPolicy.java9
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomInterfaceItemSemanticEditPolicyCN.java9
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomPrimitiveTypeItemSemanticEditPolicy.java9
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomPrimitiveTypeItemSemanticEditPolicyCN.java9
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomSignalItemSemanticEditPolicy.java5
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomSignalItemSemanticEditPolicyCN.java5
38 files changed, 158 insertions, 182 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/ClassDiagramCreationCondition.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/ClassDiagramCreationCondition.java
index 5e2615fa05b..24c5fdf33a3 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/ClassDiagramCreationCondition.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/ClassDiagramCreationCondition.java
@@ -23,9 +23,6 @@ public class ClassDiagramCreationCondition extends PerspectiveContextDependence
* @return whether the diagram can be created.
*/
public boolean create(EObject selectedElement) {
- if(super.create(selectedElement)) {
- return selectedElement instanceof org.eclipse.uml2.uml.Package;
- }
return false;
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/CreateClassDiagramCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/CreateClassDiagramCommand.java
index 3f3c15c31c8..87fd9b973d5 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/CreateClassDiagramCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/CreateClassDiagramCommand.java
@@ -26,7 +26,7 @@ import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.ModelEditPart;
* @author <a href="mailto:jerome.benois@obeo.fr">Jerome Benois</a>
*/
public class CreateClassDiagramCommand extends AbstractPapyrusGmfCreateDiagramCommandHandler {
-
+
@Override
protected String getDefaultDiagramName() {
return "ClassDiagram";
@@ -48,3 +48,4 @@ public class CreateClassDiagramCommand extends AbstractPapyrusGmfCreateDiagramCo
return org.eclipse.papyrus.uml.diagram.clazz.part.UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT;
}
}
+
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/CreateClassDiagramWithNavigationHandler.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/CreateClassDiagramWithNavigationHandler.java
deleted file mode 100644
index 821ee063842..00000000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/CreateClassDiagramWithNavigationHandler.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos Origin.
- *
- *
- * 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:
- * Mathieu Velten (Atos Origin) mathieu.velten@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.clazz;
-
-import org.eclipse.papyrus.infra.gmfdiag.navigation.CreateDiagramWithNavigationHandler;
-
-public class CreateClassDiagramWithNavigationHandler extends CreateDiagramWithNavigationHandler {
-
- public CreateClassDiagramWithNavigationHandler() {
- super(new CreateClassDiagramCommand(), new ClassDiagramCreationCondition());
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/CAssociationClassCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/CAssociationClassCreateCommand.java
index 7f7698176f2..1e02641a34b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/CAssociationClassCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/CAssociationClassCreateCommand.java
@@ -20,7 +20,9 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.papyrus.uml.diagram.clazz.custom.helper.AssociationClassHelper;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.commands.AssociationClassLinkCreateCommand;
import org.eclipse.uml2.uml.AssociationClass;
import org.eclipse.uml2.uml.Package;
import org.eclipse.uml2.uml.Type;
@@ -28,32 +30,13 @@ import org.eclipse.uml2.uml.Type;
/**
* custom class to create an association
*/
-public class CAssociationClassCreateCommand extends org.eclipse.papyrus.uml.diagram.clazz.edit.commands.AssociationClassLinkCreateCommand {
+public class CAssociationClassCreateCommand extends AssociationClassLinkCreateCommand {
- // code copy from the super class!
- protected Package deduceContainer(EObject source, EObject target) {
- // Find container element for the new link.
- // Climb up by containment hierarchy starting from the source
- // and return the first element that is instance of the container class.
- for(EObject element = source; element != null; element = element.eContainer()) {
- if(element instanceof Package) {
- return (Package)element;
- }
- }
- return null;
- }
-
- protected Package container;
-
- protected EObject source;
-
- protected EObject target;
-
- public CAssociationClassCreateCommand(CreateRelationshipRequest request, EObject source, EObject target) {
+ private final Diagram diagram;
+
+ public CAssociationClassCreateCommand(CreateRelationshipRequest request, EObject source, EObject target, Diagram diagram) {
super(request, source, target);
- this.source = source;
- this.target = target;
- container = deduceContainer(source, target);
+ this.diagram = diagram;
}
/**
@@ -65,7 +48,7 @@ public class CAssociationClassCreateCommand extends org.eclipse.papyrus.uml.diag
throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
}
if(source instanceof Type && target instanceof Type && container instanceof Package) {
- AssociationClass newElement = (AssociationClass)AssociationClassHelper.createAssociationClass(getEditingDomain(), (Type)source, (Type)target, (Package)container);
+ AssociationClass newElement = (AssociationClass)AssociationClassHelper.createAssociationClass(getEditingDomain(), (Type)source, (Type)target, (Package)container, diagram);
((CreateElementRequest)getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/CAssociationCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/CAssociationCreateCommand.java
index b58e2182ade..e2da95aeac8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/CAssociationCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/CAssociationCreateCommand.java
@@ -20,6 +20,7 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.papyrus.uml.diagram.clazz.custom.helper.ClazzDiagramAssociationHelper;
import org.eclipse.uml2.uml.Association;
import org.eclipse.uml2.uml.Package;
@@ -29,31 +30,12 @@ import org.eclipse.uml2.uml.Type;
* custom class to create an association
*/
public class CAssociationCreateCommand extends org.eclipse.papyrus.uml.diagram.clazz.edit.commands.AssociationCreateCommand {
-
- // code copy from the super class!
- protected Package deduceContainer(EObject source, EObject target) {
- // Find container element for the new link.
- // Climb up by containment hierarchy starting from the source
- // and return the first element that is instance of the container class.
- for(EObject element = source; element != null; element = element.eContainer()) {
- if(element instanceof Package) {
- return (Package)element;
- }
- }
- return null;
- }
-
- protected Package container;
-
- protected EObject source;
-
- protected EObject target;
-
- public CAssociationCreateCommand(CreateRelationshipRequest request, EObject source, EObject target) {
+
+ private final Diagram diagram;
+
+ public CAssociationCreateCommand(CreateRelationshipRequest request, EObject source, EObject target, Diagram diagram) {
super(request, source, target);
- this.source = source;
- this.target = target;
- container = deduceContainer(source, target);
+ this.diagram = diagram;
}
/**
@@ -65,7 +47,7 @@ public class CAssociationCreateCommand extends org.eclipse.papyrus.uml.diagram.c
throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
}
if(source instanceof Type && target instanceof Type && container instanceof Package) {
- Association newElement = (Association)ClazzDiagramAssociationHelper.createAssociation(getEditingDomain(), (Type)source, (Type)target, (Package)container);
+ Association newElement = (Association)ClazzDiagramAssociationHelper.createAssociation(getEditingDomain(), (Type)source, (Type)target, (Package)container, diagram);
((CreateElementRequest)getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/CClassifierTemplateParameterCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/CClassifierTemplateParameterCreateCommand.java
index b6dd4c1aa96..2e54924efa7 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/CClassifierTemplateParameterCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/CClassifierTemplateParameterCreateCommand.java
@@ -17,6 +17,7 @@ import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.papyrus.uml.diagram.clazz.custom.ui.TemplateParameterConfigurationDialog;
import org.eclipse.papyrus.uml.diagram.clazz.edit.commands.ClassifierTemplateParameterCreateCommand;
import org.eclipse.swt.SWT;
@@ -28,8 +29,8 @@ import org.eclipse.uml2.uml.UMLPackage;
public class CClassifierTemplateParameterCreateCommand extends ClassifierTemplateParameterCreateCommand {
- public CClassifierTemplateParameterCreateCommand(CreateElementRequest req) {
- super(req);
+ public CClassifierTemplateParameterCreateCommand(CreateElementRequest req, Diagram diagram) {
+ super(req, diagram);
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/CConnectableElementTemplateParameterCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/CConnectableElementTemplateParameterCreateCommand.java
index 3334140757f..604036c486c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/CConnectableElementTemplateParameterCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/CConnectableElementTemplateParameterCreateCommand.java
@@ -17,6 +17,7 @@ import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.papyrus.uml.diagram.clazz.custom.ui.TemplateParameterConfigurationDialog;
import org.eclipse.papyrus.uml.diagram.clazz.edit.commands.ConnectableElementTemplateParameterCreateCommand;
import org.eclipse.swt.SWT;
@@ -28,8 +29,8 @@ import org.eclipse.uml2.uml.UMLPackage;
public class CConnectableElementTemplateParameterCreateCommand extends ConnectableElementTemplateParameterCreateCommand {
- public CConnectableElementTemplateParameterCreateCommand(CreateElementRequest req) {
- super(req);
+ public CConnectableElementTemplateParameterCreateCommand(CreateElementRequest req, Diagram diagram) {
+ super(req, diagram);
// TODO Auto-generated constructor stub
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/COperationTemplateParameterCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/COperationTemplateParameterCreateCommand.java
index c63641e8440..8b9e9eb5407 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/COperationTemplateParameterCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/COperationTemplateParameterCreateCommand.java
@@ -17,6 +17,7 @@ import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.papyrus.uml.diagram.clazz.custom.ui.TemplateParameterConfigurationDialog;
import org.eclipse.papyrus.uml.diagram.clazz.edit.commands.OperationTemplateParameterCreateCommand;
import org.eclipse.swt.SWT;
@@ -28,8 +29,8 @@ import org.eclipse.uml2.uml.UMLPackage;
public class COperationTemplateParameterCreateCommand extends OperationTemplateParameterCreateCommand {
- public COperationTemplateParameterCreateCommand(CreateElementRequest req) {
- super(req);
+ public COperationTemplateParameterCreateCommand(CreateElementRequest req, Diagram diagram) {
+ super(req, diagram);
// TODO Auto-generated constructor stub
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/CTemplateParameterCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/CTemplateParameterCreateCommand.java
index d2c6ab63291..b0f8b5fc9fc 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/CTemplateParameterCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/CTemplateParameterCreateCommand.java
@@ -20,6 +20,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.papyrus.uml.diagram.clazz.custom.ui.TemplateParameterConfigurationDialog;
import org.eclipse.papyrus.uml.diagram.clazz.edit.commands.TemplateParameterCreateCommand;
import org.eclipse.swt.SWT;
@@ -31,8 +32,8 @@ import org.eclipse.uml2.uml.UMLPackage;
public class CTemplateParameterCreateCommand extends TemplateParameterCreateCommand {
- public CTemplateParameterCreateCommand(CreateElementRequest req) {
- super(req);
+ public CTemplateParameterCreateCommand(CreateElementRequest req, Diagram diagram) {
+ super(req, diagram);
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/CreateAssociationClassSupplement.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/CreateAssociationClassSupplement.java
index 0f4ce11e9db..cf56476d6c4 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/CreateAssociationClassSupplement.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/CreateAssociationClassSupplement.java
@@ -23,6 +23,7 @@ import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.papyrus.uml.diagram.clazz.edit.commands.PropertyForComponentCreateCommand;
import org.eclipse.papyrus.uml.diagram.clazz.providers.ElementInitializers;
import org.eclipse.papyrus.uml.diagram.clazz.providers.UMLElementTypes;
@@ -52,8 +53,8 @@ public class CreateAssociationClassSupplement extends SupplementCommand {
* @param target
* the target of the association (Type)
*/
- public CreateAssociationClassSupplement(EObject container, EObject source, EObject target) {
- super(container, source, target);
+ public CreateAssociationClassSupplement(EObject container, EObject source, EObject target, Diagram diagram) {
+ super(container, source, target, diagram);
}
/**
@@ -82,7 +83,7 @@ public class CreateAssociationClassSupplement extends SupplementCommand {
AssociationClass association = UMLFactory.eINSTANCE.createAssociationClass();
// create target property
CreateElementRequest request = new CreateElementRequest(domain, getSource(), UMLElementTypes.Property_3002, UMLPackage.eINSTANCE.getStructuredClassifier_OwnedAttribute());
- EditElementCommand c = new PropertyForComponentCreateCommand(request);
+ EditElementCommand c = new PropertyForComponentCreateCommand(request, diagram);
try {
c.execute(new NullProgressMonitor(), null);
} catch (ExecutionException e) {
@@ -98,7 +99,7 @@ public class CreateAssociationClassSupplement extends SupplementCommand {
targetProperty.setUpper(1);
// create source property
request = new CreateElementRequest(domain, association, UMLElementTypes.Property_3002, UMLPackage.eINSTANCE.getAssociation_OwnedEnd());
- c = new PropertyCommandForAssociation(request);
+ c = new PropertyCommandForAssociation(request, diagram);
try {
c.execute(new NullProgressMonitor(), null);
} catch (ExecutionException e) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/CreateAssociationSupplement.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/CreateAssociationSupplement.java
index eca03b905ba..426c57ec2fc 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/CreateAssociationSupplement.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/CreateAssociationSupplement.java
@@ -22,6 +22,7 @@ import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.papyrus.uml.diagram.clazz.providers.ElementInitializers;
import org.eclipse.papyrus.uml.diagram.clazz.providers.UMLElementTypes;
import org.eclipse.papyrus.uml.diagram.common.commands.SupplementCommand;
@@ -49,8 +50,8 @@ public class CreateAssociationSupplement extends SupplementCommand {
* @param target
* the target of the association (Type)
*/
- public CreateAssociationSupplement(EObject container, EObject source, EObject target) {
- super(container, source, target);
+ public CreateAssociationSupplement(EObject container, EObject source, EObject target, Diagram diagram) {
+ super(container, source, target, diagram);
}
/**
@@ -79,7 +80,7 @@ public class CreateAssociationSupplement extends SupplementCommand {
Association association = UMLFactory.eINSTANCE.createAssociation();
// create target property
CreateElementRequest request = new CreateElementRequest(domain, association, UMLElementTypes.Property_3002, UMLPackage.eINSTANCE.getAssociation_OwnedEnd());
- EditElementCommand c = new PropertyCommandForAssociation(request);
+ EditElementCommand c = new PropertyCommandForAssociation(request, diagram);
try {
c.execute(new NullProgressMonitor(), null);
} catch (ExecutionException e) {
@@ -95,7 +96,7 @@ public class CreateAssociationSupplement extends SupplementCommand {
targetProperty.setUpper(1);
// create source property
request = new CreateElementRequest(domain, association, UMLElementTypes.Property_3002, UMLPackage.eINSTANCE.getAssociation_OwnedEnd());
- c = new PropertyCommandForAssociation(request);
+ c = new PropertyCommandForAssociation(request, diagram);
try {
c.execute(new NullProgressMonitor(), null);
} catch (ExecutionException e) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/CustomContextLinkCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/CustomContextLinkCreateCommand.java
index 0546ca454c4..874db1307ad 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/CustomContextLinkCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/CustomContextLinkCreateCommand.java
@@ -80,7 +80,7 @@ public class CustomContextLinkCreateCommand extends ContextLinkCreateCommand {
}
}
}
- if(resolveTargetNamespace() != null && (resolveTargetNamespace().getOwnedRules().contains(resolveTargetNamespace()))) {
+ if (getTarget() != null && (getTarget().getOwnedRules().contains(getTarget()))) {
return false;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/PropertyCommandForAssociation.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/PropertyCommandForAssociation.java
index 28152ba4e4d..ed794578867 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/PropertyCommandForAssociation.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/PropertyCommandForAssociation.java
@@ -20,6 +20,7 @@ import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.papyrus.uml.diagram.clazz.edit.commands.PropertyForComponentCreateCommand;
import org.eclipse.papyrus.uml.diagram.clazz.providers.ElementInitializers;
import org.eclipse.uml2.uml.Association;
@@ -39,8 +40,8 @@ public class PropertyCommandForAssociation extends PropertyForComponentCreateCom
* @param req
* the req to launch the command
*/
- public PropertyCommandForAssociation(CreateElementRequest req) {
- super(req);
+ public PropertyCommandForAssociation(CreateElementRequest req, Diagram diagram) {
+ super(req, diagram);
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/helper/AssociationClassHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/helper/AssociationClassHelper.java
index 35c2aed9e19..972ab9669b6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/helper/AssociationClassHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/helper/AssociationClassHelper.java
@@ -45,6 +45,7 @@ import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.gmf.runtime.notation.Node;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.AssociationClassViewCreateCommand;
@@ -68,11 +69,11 @@ import org.eclipse.uml2.uml.UMLPackage;
*/
public class AssociationClassHelper extends ElementHelper {
- public static EObject createAssociationClass(TransactionalEditingDomain domain, Type source, Type target, Package container) {
+ public static EObject createAssociationClass(TransactionalEditingDomain domain, Type source, Type target, Package container, Diagram diagram) {
AssociationClass association = UMLFactory.eINSTANCE.createAssociationClass();
// create target property
CreateElementRequest request = new CreateElementRequest(domain, source, UMLElementTypes.Property_3002, UMLPackage.eINSTANCE.getStructuredClassifier_OwnedAttribute());
- EditElementCommand c = new PropertyForComponentCreateCommand(request);
+ EditElementCommand c = new PropertyForComponentCreateCommand(request, diagram);
try {
c.execute(new NullProgressMonitor(), null);
} catch (ExecutionException e) {
@@ -88,7 +89,7 @@ public class AssociationClassHelper extends ElementHelper {
targetProperty.setUpper(1);
// create source property
request = new CreateElementRequest(domain, association, UMLElementTypes.Property_3002, UMLPackage.eINSTANCE.getAssociation_OwnedEnd());
- c = new PropertyCommandForAssociation(request);
+ c = new PropertyCommandForAssociation(request, diagram);
try {
c.execute(new NullProgressMonitor(), null);
} catch (ExecutionException e) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/helper/ClazzDiagramAssociationHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/helper/ClazzDiagramAssociationHelper.java
index 4ff07e65462..204b1612079 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/helper/ClazzDiagramAssociationHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/helper/ClazzDiagramAssociationHelper.java
@@ -21,6 +21,7 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.PropertyCommandForAssociation;
import org.eclipse.papyrus.uml.diagram.clazz.providers.ElementInitializers;
import org.eclipse.papyrus.uml.diagram.clazz.providers.UMLElementTypes;
@@ -38,13 +39,14 @@ import org.eclipse.uml2.uml.UMLPackage;
*/
public class ClazzDiagramAssociationHelper {
- public static EObject createAssociation(TransactionalEditingDomain domain, Type source, Type target, Package container) {
+ public static EObject createAssociation(TransactionalEditingDomain domain, Type source, Type target, Package container, Diagram diagram) {
Association association = UMLFactory.eINSTANCE.createAssociation();
String targetString = target.getName().substring(0, 1).toLowerCase() + target.getName().substring(1, target.getName().length());
String sourceString = source.getName().substring(0, 1).toLowerCase() + source.getName().substring(1, source.getName().length());
+
// create target property
CreateElementRequest request = new CreateElementRequest(domain, association, UMLElementTypes.Property_3002, UMLPackage.eINSTANCE.getAssociation_OwnedEnd());
- EditElementCommand c = new PropertyCommandForAssociation(request);
+ EditElementCommand c = new PropertyCommandForAssociation(request, diagram);
try {
c.execute(new NullProgressMonitor(), null);
} catch (ExecutionException e) {
@@ -63,9 +65,10 @@ public class ClazzDiagramAssociationHelper {
if(source instanceof StructuredClassifier) {
((StructuredClassifier)source).getOwnedAttributes().add(targetProperty);
}
+
// create source property
request = new CreateElementRequest(domain, association, UMLElementTypes.Property_3002, UMLPackage.eINSTANCE.getAssociation_OwnedEnd());
- c = new PropertyCommandForAssociation(request);
+ c = new PropertyCommandForAssociation(request, diagram);
try {
c.execute(new NullProgressMonitor(), null);
} catch (ExecutionException e) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/helper/MultiAssociationHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/helper/MultiAssociationHelper.java
index 4d49fb55794..254391c88c2 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/helper/MultiAssociationHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/helper/MultiAssociationHelper.java
@@ -51,6 +51,7 @@ import org.eclipse.gmf.runtime.notation.Edge;
import org.eclipse.gmf.runtime.notation.Node;
import org.eclipse.gmf.runtime.notation.NotationFactory;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.AssociationDiamonViewCreateCommand;
@@ -350,7 +351,7 @@ public class MultiAssociationHelper extends org.eclipse.papyrus.uml.diagram.comm
// 3.1 creation of the property
CreateElementRequest request = new CreateElementRequest(getEditingDomain(), association, UMLElementTypes.Property_3005, UMLPackage.eINSTANCE.getAssociation_OwnedEnd());
request.setParameter("type", newSemanticElement);
- EditElementCommand propertyCreateCommand = new PropertyCommandForAssociation(request);
+ EditElementCommand propertyCreateCommand = new PropertyCommandForAssociation(request, DiagramUtils.getDiagramFrom(sourceEditPart));
propertyCreateCommand.setReuseParentTransaction(true);
((CompoundCommand)command).add(new ICommandProxy(propertyCreateCommand));
// 3. Node creation at this position
@@ -424,7 +425,7 @@ public class MultiAssociationHelper extends org.eclipse.papyrus.uml.diagram.comm
// 0. add semantic
CreateElementRequest request = new CreateElementRequest(getEditingDomain(), association, UMLElementTypes.Property_3005, UMLPackage.eINSTANCE.getAssociation_OwnedEnd());
request.setParameter("type", newSemanticElement);
- EditElementCommand propertyCreateCommand = new PropertyCommandForAssociation(request);
+ EditElementCommand propertyCreateCommand = new PropertyCommandForAssociation(request, DiagramUtils.getDiagramFrom(targetEditPart));
((CompoundCommand)command).add(new ICommandProxy(propertyCreateCommand));
//System.err.println("0. add semantic, can execute?" + command.canExecute());
// 1. add the branch graphically
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CRedefinableTemplateSignatureTemplateParameterCompartmentItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CRedefinableTemplateSignatureTemplateParameterCompartmentItemSemanticEditPolicy.java
index 920906e4899..01ca20f156e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CRedefinableTemplateSignatureTemplateParameterCompartmentItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CRedefinableTemplateSignatureTemplateParameterCompartmentItemSemanticEditPolicy.java
@@ -14,6 +14,7 @@ package org.eclipse.papyrus.uml.diagram.clazz.custom.policies.itemsemantic;
import org.eclipse.gef.commands.Command;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.CClassifierTemplateParameterCreateCommand;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.CConnectableElementTemplateParameterCreateCommand;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.COperationTemplateParameterCreateCommand;
@@ -35,16 +36,16 @@ public class CRedefinableTemplateSignatureTemplateParameterCompartmentItemSemant
*/
protected Command getCreateCommand(CreateElementRequest req) {
if(UMLElementTypes.ClassifierTemplateParameter_3031 == req.getElementType()) {
- return getGEFWrapper(new CClassifierTemplateParameterCreateCommand(req));
+ return getGEFWrapper(new CClassifierTemplateParameterCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.ConnectableElementTemplateParameter_3034 == req.getElementType()) {
- return getGEFWrapper(new CConnectableElementTemplateParameterCreateCommand(req));
+ return getGEFWrapper(new CConnectableElementTemplateParameterCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.OperationTemplateParameter_3035 == req.getElementType()) {
- return getGEFWrapper(new COperationTemplateParameterCreateCommand(req));
+ return getGEFWrapper(new COperationTemplateParameterCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.TemplateParameter_3016 == req.getElementType()) {
- return getGEFWrapper(new CTemplateParameterCreateCommand(req));
+ return getGEFWrapper(new CTemplateParameterCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
return super.getCreateCommand(req);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CTemplateSignatureTemplateParameterCompartmentItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CTemplateSignatureTemplateParameterCompartmentItemSemanticEditPolicy.java
index 127f6d7def2..4171d07418d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CTemplateSignatureTemplateParameterCompartmentItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CTemplateSignatureTemplateParameterCompartmentItemSemanticEditPolicy.java
@@ -14,6 +14,7 @@ package org.eclipse.papyrus.uml.diagram.clazz.custom.policies.itemsemantic;
import org.eclipse.gef.commands.Command;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.CClassifierTemplateParameterCreateCommand;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.COperationTemplateParameterCreateCommand;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.CTemplateParameterCreateCommand;
@@ -34,13 +35,13 @@ public class CTemplateSignatureTemplateParameterCompartmentItemSemanticEditPolic
*/
protected Command getCreateCommand(CreateElementRequest req) {
if(UMLElementTypes.ClassifierTemplateParameter_3031 == req.getElementType()) {
- return getGEFWrapper(new CClassifierTemplateParameterCreateCommand(req));
+ return getGEFWrapper(new CClassifierTemplateParameterCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.OperationTemplateParameter_3035 == req.getElementType()) {
- return getGEFWrapper(new COperationTemplateParameterCreateCommand(req));
+ return getGEFWrapper(new COperationTemplateParameterCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.TemplateParameter_3016 == req.getElementType()) {
- return getGEFWrapper(new CTemplateParameterCreateCommand(req));
+ return getGEFWrapper(new CTemplateParameterCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
return super.getCreateCommand(req);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomAssociationBranchItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomAssociationBranchItemSemanticEditPolicy.java
index dea4b21ae7d..3006ab93750 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomAssociationBranchItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomAssociationBranchItemSemanticEditPolicy.java
@@ -17,6 +17,7 @@ import org.eclipse.gef.commands.Command;
import org.eclipse.gef.commands.UnexecutableCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.BranchDependenctReorientCommand;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationClassCreateCommand;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationReorientCommand;
@@ -38,10 +39,10 @@ public class CustomAssociationBranchItemSemanticEditPolicy extends AssociationBr
*/
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
if(UMLElementTypes.Association_4001 == req.getElementType()) {
- return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.AssociationClass_4017 == req.getElementType()) {
- return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.TemplateBinding_4015 == req.getElementType()) {
return UnexecutableCommand.INSTANCE;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomAssociationClassItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomAssociationClassItemSemanticEditPolicy.java
index df323772e2e..00d6c98592c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomAssociationClassItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomAssociationClassItemSemanticEditPolicy.java
@@ -17,6 +17,7 @@ import org.eclipse.gef.commands.Command;
import org.eclipse.gef.commands.UnexecutableCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.BranchDependenctReorientCommand;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationClassCreateCommand;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationReorientCommand;
@@ -36,10 +37,10 @@ public class CustomAssociationClassItemSemanticEditPolicy extends org.eclipse.pa
*/
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
if(UMLElementTypes.Association_4001 == req.getElementType()) {
- return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.AssociationClass_4017 == req.getElementType()) {
- return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.TemplateBinding_4015 == req.getElementType()) {
return UnexecutableCommand.INSTANCE;
@@ -65,10 +66,10 @@ public class CustomAssociationClassItemSemanticEditPolicy extends org.eclipse.pa
*/
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
if(UMLElementTypes.Association_4001 == req.getElementType()) {
- return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.AssociationClass_4017 == req.getElementType()) {
- return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
//forbid creation of association branch from it.
if(UMLElementTypes.Association_4019 == req.getElementType()) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomAssociationClassLinkItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomAssociationClassLinkItemSemanticEditPolicy.java
index 3ec21e61f38..9db627adf61 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomAssociationClassLinkItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomAssociationClassLinkItemSemanticEditPolicy.java
@@ -17,6 +17,7 @@ import org.eclipse.gef.commands.Command;
import org.eclipse.gef.commands.UnexecutableCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.BranchDependenctReorientCommand;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationClassCreateCommand;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationReorientCommand;
@@ -37,10 +38,10 @@ public class CustomAssociationClassLinkItemSemanticEditPolicy extends Associatio
*/
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
if(UMLElementTypes.Association_4001 == req.getElementType()) {
- return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.AssociationClass_4017 == req.getElementType()) {
- return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.TemplateBinding_4015 == req.getElementType()) {
return UnexecutableCommand.INSTANCE;
@@ -66,10 +67,10 @@ public class CustomAssociationClassLinkItemSemanticEditPolicy extends Associatio
*/
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
if(UMLElementTypes.Association_4001 == req.getElementType()) {
- return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.AssociationClass_4017 == req.getElementType()) {
- return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
//forbid creation of association branch from it.
if(UMLElementTypes.Association_4019 == req.getElementType()) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomAssociationItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomAssociationItemSemanticEditPolicy.java
index 2762f4e9e7d..56e770bc998 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomAssociationItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomAssociationItemSemanticEditPolicy.java
@@ -25,14 +25,17 @@ import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.BranchDependenctReorientCommand;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationClassCreateCommand;
+import org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationReorientCommand;
import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.AssociationClassLinkEditPart;
import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.AssociationEditPart;
import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.DependencyBranchEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.policies.AssociationItemSemanticEditPolicy;
import org.eclipse.papyrus.uml.diagram.clazz.providers.UMLElementTypes;
import org.eclipse.uml2.uml.Association;
import org.eclipse.uml2.uml.Property;
@@ -40,7 +43,7 @@ import org.eclipse.uml2.uml.Property;
/**
* this a specialization to manage creation of association and associationClass
*/
-public class CustomAssociationItemSemanticEditPolicy extends org.eclipse.papyrus.uml.diagram.clazz.edit.policies.AssociationItemSemanticEditPolicy {
+public class CustomAssociationItemSemanticEditPolicy extends AssociationItemSemanticEditPolicy {
/**
*
@@ -48,10 +51,10 @@ public class CustomAssociationItemSemanticEditPolicy extends org.eclipse.papyrus
*/
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
if(UMLElementTypes.Association_4001 == req.getElementType()) {
- return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new CAssociationCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.AssociationClass_4017 == req.getElementType()) {
- return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.TemplateBinding_4015 == req.getElementType()) {
return UnexecutableCommand.INSTANCE;
@@ -108,10 +111,10 @@ public class CustomAssociationItemSemanticEditPolicy extends org.eclipse.papyrus
*/
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
if(UMLElementTypes.Association_4001 == req.getElementType()) {
- return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.AssociationClass_4017 == req.getElementType()) {
- return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.TemplateBinding_4015 == req.getElementType()) {
return UnexecutableCommand.INSTANCE;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomAssociationNodeItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomAssociationNodeItemSemanticEditPolicy.java
index cd041184325..ccac1a93086 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomAssociationNodeItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomAssociationNodeItemSemanticEditPolicy.java
@@ -17,6 +17,7 @@ import org.eclipse.gef.commands.Command;
import org.eclipse.gef.commands.UnexecutableCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.BranchDependenctReorientCommand;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationClassCreateCommand;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationReorientCommand;
@@ -38,10 +39,10 @@ public class CustomAssociationNodeItemSemanticEditPolicy extends AssociationNode
*/
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
if(UMLElementTypes.Association_4001 == req.getElementType()) {
- return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.AssociationClass_4017 == req.getElementType()) {
- return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.TemplateBinding_4015 == req.getElementType()) {
return UnexecutableCommand.INSTANCE;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomClassItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomClassItemSemanticEditPolicy.java
index 12ec9709f38..312a65a37c7 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomClassItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomClassItemSemanticEditPolicy.java
@@ -25,6 +25,7 @@ import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelations
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
import org.eclipse.gmf.runtime.notation.Edge;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.BranchDependenctReorientCommand;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationClassCreateCommand;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationReorientCommand;
@@ -57,10 +58,10 @@ public class CustomClassItemSemanticEditPolicy extends ClassItemSemanticEditPoli
*/
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
if(UMLElementTypes.Association_4001 == req.getElementType()) {
- return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.AssociationClass_4017 == req.getElementType()) {
- return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.TemplateBinding_4015 == req.getElementType()) {
return getGEFWrapper(new CTemplateBindingCreateCommand(req, req.getSource(), req.getTarget()));
@@ -91,10 +92,10 @@ public class CustomClassItemSemanticEditPolicy extends ClassItemSemanticEditPoli
*/
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
if(UMLElementTypes.Association_4001 == req.getElementType()) {
- return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.AssociationClass_4017 == req.getElementType()) {
- return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
//forbid creation of association branch from it.
if(UMLElementTypes.Association_4019 == req.getElementType()) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomClassItemSemanticEditPolicyCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomClassItemSemanticEditPolicyCN.java
index c5464df2635..f64f1cdc631 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomClassItemSemanticEditPolicyCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomClassItemSemanticEditPolicyCN.java
@@ -25,6 +25,7 @@ import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelations
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
import org.eclipse.gmf.runtime.notation.Edge;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.BranchDependenctReorientCommand;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationClassCreateCommand;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationReorientCommand;
@@ -53,10 +54,10 @@ public class CustomClassItemSemanticEditPolicyCN extends ClassItemSemanticEditPo
*/
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
if(UMLElementTypes.Association_4001 == req.getElementType()) {
- return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.AssociationClass_4017 == req.getElementType()) {
- return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.TemplateBinding_4015 == req.getElementType()) {
return getGEFWrapper(new CTemplateBindingCreateCommand(req, req.getSource(), req.getTarget()));
@@ -89,10 +90,10 @@ public class CustomClassItemSemanticEditPolicyCN extends ClassItemSemanticEditPo
*/
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
if(UMLElementTypes.Association_4001 == req.getElementType()) {
- return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.AssociationClass_4017 == req.getElementType()) {
- return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
//forbid creation of association branch from it.
if(UMLElementTypes.Association_4019 == req.getElementType()) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomComponentItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomComponentItemSemanticEditPolicy.java
index f2252fbf4cd..b0cf1985d8b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomComponentItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomComponentItemSemanticEditPolicy.java
@@ -17,6 +17,7 @@ import org.eclipse.gef.commands.Command;
import org.eclipse.gef.commands.UnexecutableCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.BranchDependenctReorientCommand;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationClassCreateCommand;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationReorientCommand;
@@ -41,10 +42,10 @@ public class CustomComponentItemSemanticEditPolicy extends ComponentItemSemantic
*/
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
if(UMLElementTypes.Association_4001 == req.getElementType()) {
- return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.AssociationClass_4017 == req.getElementType()) {
- return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.TemplateBinding_4015 == req.getElementType()) {
return getGEFWrapper(new CTemplateBindingCreateCommand(req, req.getSource(), req.getTarget()));
@@ -74,10 +75,10 @@ public class CustomComponentItemSemanticEditPolicy extends ComponentItemSemantic
*/
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
if(UMLElementTypes.Association_4001 == req.getElementType()) {
- return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.AssociationClass_4017 == req.getElementType()) {
- return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
//forbid creation of association branch from it.
if(UMLElementTypes.Association_4019 == req.getElementType()) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomComponentItemSemanticEditPolicyCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomComponentItemSemanticEditPolicyCN.java
index bea723b9043..eb13c215542 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomComponentItemSemanticEditPolicyCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomComponentItemSemanticEditPolicyCN.java
@@ -17,6 +17,7 @@ import org.eclipse.gef.commands.Command;
import org.eclipse.gef.commands.UnexecutableCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.BranchDependenctReorientCommand;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationClassCreateCommand;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationReorientCommand;
@@ -41,10 +42,10 @@ public class CustomComponentItemSemanticEditPolicyCN extends ComponentItemSemant
*/
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
if(UMLElementTypes.Association_4001 == req.getElementType()) {
- return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.AssociationClass_4017 == req.getElementType()) {
- return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.TemplateBinding_4015 == req.getElementType()) {
return getGEFWrapper(new CTemplateBindingCreateCommand(req, req.getSource(), req.getTarget()));
@@ -74,10 +75,10 @@ public class CustomComponentItemSemanticEditPolicyCN extends ComponentItemSemant
*/
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
if(UMLElementTypes.Association_4001 == req.getElementType()) {
- return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.AssociationClass_4017 == req.getElementType()) {
- return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
//forbid creation of association branch from it.
if(UMLElementTypes.Association_4019 == req.getElementType()) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomDataTypeItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomDataTypeItemSemanticEditPolicy.java
index 8c2e22c4d69..11ad22349c6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomDataTypeItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomDataTypeItemSemanticEditPolicy.java
@@ -17,6 +17,7 @@ import org.eclipse.gef.commands.Command;
import org.eclipse.gef.commands.UnexecutableCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.BranchDependenctReorientCommand;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationClassCreateCommand;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationReorientCommand;
@@ -41,10 +42,10 @@ public class CustomDataTypeItemSemanticEditPolicy extends DataTypeItemSemanticEd
*/
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
if(UMLElementTypes.Association_4001 == req.getElementType()) {
- return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.AssociationClass_4017 == req.getElementType()) {
- return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.TemplateBinding_4015 == req.getElementType()) {
return getGEFWrapper(new CTemplateBindingCreateCommand(req, req.getSource(), req.getTarget()));
@@ -74,10 +75,10 @@ public class CustomDataTypeItemSemanticEditPolicy extends DataTypeItemSemanticEd
*/
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
if(UMLElementTypes.Association_4001 == req.getElementType()) {
- return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.AssociationClass_4017 == req.getElementType()) {
- return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.TemplateBinding_4015 == req.getElementType()) {
return getGEFWrapper(new CTemplateBindingCreateCommand(req, req.getSource(), req.getTarget()));
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomDataTypeItemSemanticEditPolicyCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomDataTypeItemSemanticEditPolicyCN.java
index 02f255ad0cc..d6420f68110 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomDataTypeItemSemanticEditPolicyCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomDataTypeItemSemanticEditPolicyCN.java
@@ -17,6 +17,7 @@ import org.eclipse.gef.commands.Command;
import org.eclipse.gef.commands.UnexecutableCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.BranchDependenctReorientCommand;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationClassCreateCommand;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationReorientCommand;
@@ -41,10 +42,10 @@ public class CustomDataTypeItemSemanticEditPolicyCN extends DataTypeItemSemantic
*/
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
if(UMLElementTypes.Association_4001 == req.getElementType()) {
- return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.AssociationClass_4017 == req.getElementType()) {
- return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.TemplateBinding_4015 == req.getElementType()) {
return getGEFWrapper(new CTemplateBindingCreateCommand(req, req.getSource(), req.getTarget()));
@@ -74,10 +75,10 @@ public class CustomDataTypeItemSemanticEditPolicyCN extends DataTypeItemSemantic
*/
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
if(UMLElementTypes.Association_4001 == req.getElementType()) {
- return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.AssociationClass_4017 == req.getElementType()) {
- return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
//forbid creation of association branch from it.
if(UMLElementTypes.Association_4019 == req.getElementType()) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomEnumerationItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomEnumerationItemSemanticEditPolicy.java
index 4a0d116f724..dc66c947a3d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomEnumerationItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomEnumerationItemSemanticEditPolicy.java
@@ -17,6 +17,7 @@ import org.eclipse.gef.commands.Command;
import org.eclipse.gef.commands.UnexecutableCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.BranchDependenctReorientCommand;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationClassCreateCommand;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationReorientCommand;
@@ -41,10 +42,10 @@ public class CustomEnumerationItemSemanticEditPolicy extends EnumerationItemSema
*/
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
if(UMLElementTypes.Association_4001 == req.getElementType()) {
- return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.AssociationClass_4017 == req.getElementType()) {
- return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.TemplateBinding_4015 == req.getElementType()) {
return getGEFWrapper(new CTemplateBindingCreateCommand(req, req.getSource(), req.getTarget()));
@@ -74,10 +75,10 @@ public class CustomEnumerationItemSemanticEditPolicy extends EnumerationItemSema
*/
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
if(UMLElementTypes.Association_4001 == req.getElementType()) {
- return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.AssociationClass_4017 == req.getElementType()) {
- return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
//forbid creation of association branch from it.
if(UMLElementTypes.Association_4019 == req.getElementType()) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomEnumerationItemSemanticEditPolicyCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomEnumerationItemSemanticEditPolicyCN.java
index 8b8fcb8aaca..c128be14cbc 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomEnumerationItemSemanticEditPolicyCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomEnumerationItemSemanticEditPolicyCN.java
@@ -17,6 +17,7 @@ import org.eclipse.gef.commands.Command;
import org.eclipse.gef.commands.UnexecutableCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.BranchDependenctReorientCommand;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationClassCreateCommand;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationReorientCommand;
@@ -41,10 +42,10 @@ public class CustomEnumerationItemSemanticEditPolicyCN extends EnumerationItemSe
*/
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
if(UMLElementTypes.Association_4001 == req.getElementType()) {
- return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.AssociationClass_4017 == req.getElementType()) {
- return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.TemplateBinding_4015 == req.getElementType()) {
return getGEFWrapper(new CTemplateBindingCreateCommand(req, req.getSource(), req.getTarget()));
@@ -74,10 +75,10 @@ public class CustomEnumerationItemSemanticEditPolicyCN extends EnumerationItemSe
*/
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
if(UMLElementTypes.Association_4001 == req.getElementType()) {
- return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.AssociationClass_4017 == req.getElementType()) {
- return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
//forbid creation of association branch from it.
if(UMLElementTypes.Association_4019 == req.getElementType()) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomInformationItemItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomInformationItemItemSemanticEditPolicy.java
index 9da9cf648c1..7bf374e7eaf 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomInformationItemItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomInformationItemItemSemanticEditPolicy.java
@@ -17,6 +17,7 @@ import org.eclipse.gef.commands.Command;
import org.eclipse.gef.commands.UnexecutableCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.BranchDependenctReorientCommand;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationClassCreateCommand;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationReorientCommand;
@@ -38,10 +39,10 @@ public class CustomInformationItemItemSemanticEditPolicy extends InformationItem
*/
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
if(UMLElementTypes.Association_4001 == req.getElementType()) {
- return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.AssociationClass_4017 == req.getElementType()) {
- return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.TemplateBinding_4015 == req.getElementType()) {
return getGEFWrapper(new CTemplateBindingCreateCommand(req, req.getSource(), req.getTarget()));
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomInterfaceItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomInterfaceItemSemanticEditPolicy.java
index 29e45b968c1..2cf72581eab 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomInterfaceItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomInterfaceItemSemanticEditPolicy.java
@@ -17,6 +17,7 @@ import org.eclipse.gef.commands.Command;
import org.eclipse.gef.commands.UnexecutableCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.BranchDependenctReorientCommand;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationClassCreateCommand;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationReorientCommand;
@@ -41,10 +42,10 @@ public class CustomInterfaceItemSemanticEditPolicy extends InterfaceItemSemantic
*/
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
if(UMLElementTypes.Association_4001 == req.getElementType()) {
- return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.AssociationClass_4017 == req.getElementType()) {
- return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.TemplateBinding_4015 == req.getElementType()) {
return getGEFWrapper(new CTemplateBindingCreateCommand(req, req.getSource(), req.getTarget()));
@@ -74,10 +75,10 @@ public class CustomInterfaceItemSemanticEditPolicy extends InterfaceItemSemantic
*/
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
if(UMLElementTypes.Association_4001 == req.getElementType()) {
- return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.AssociationClass_4017 == req.getElementType()) {
- return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
//forbid creation of association branch from it.
if(UMLElementTypes.Association_4019 == req.getElementType()) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomInterfaceItemSemanticEditPolicyCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomInterfaceItemSemanticEditPolicyCN.java
index a2fcdc95398..7b36f7c7a2b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomInterfaceItemSemanticEditPolicyCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomInterfaceItemSemanticEditPolicyCN.java
@@ -17,6 +17,7 @@ import org.eclipse.gef.commands.Command;
import org.eclipse.gef.commands.UnexecutableCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.BranchDependenctReorientCommand;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationClassCreateCommand;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationReorientCommand;
@@ -41,10 +42,10 @@ public class CustomInterfaceItemSemanticEditPolicyCN extends InterfaceItemSemant
*/
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
if(UMLElementTypes.Association_4001 == req.getElementType()) {
- return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.AssociationClass_4017 == req.getElementType()) {
- return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.TemplateBinding_4015 == req.getElementType()) {
return getGEFWrapper(new CTemplateBindingCreateCommand(req, req.getSource(), req.getTarget()));
@@ -74,10 +75,10 @@ public class CustomInterfaceItemSemanticEditPolicyCN extends InterfaceItemSemant
*/
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
if(UMLElementTypes.Association_4001 == req.getElementType()) {
- return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.AssociationClass_4017 == req.getElementType()) {
- return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
//forbid creation of association branch from it.
if(UMLElementTypes.Association_4019 == req.getElementType()) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomPrimitiveTypeItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomPrimitiveTypeItemSemanticEditPolicy.java
index 680883136b0..8f899417030 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomPrimitiveTypeItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomPrimitiveTypeItemSemanticEditPolicy.java
@@ -17,6 +17,7 @@ import org.eclipse.gef.commands.Command;
import org.eclipse.gef.commands.UnexecutableCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.BranchDependenctReorientCommand;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationClassCreateCommand;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationReorientCommand;
@@ -41,10 +42,10 @@ public class CustomPrimitiveTypeItemSemanticEditPolicy extends PrimitiveTypeItem
*/
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
if(UMLElementTypes.Association_4001 == req.getElementType()) {
- return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.AssociationClass_4017 == req.getElementType()) {
- return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.TemplateBinding_4015 == req.getElementType()) {
return getGEFWrapper(new CTemplateBindingCreateCommand(req, req.getSource(), req.getTarget()));
@@ -74,10 +75,10 @@ public class CustomPrimitiveTypeItemSemanticEditPolicy extends PrimitiveTypeItem
*/
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
if(UMLElementTypes.Association_4001 == req.getElementType()) {
- return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.AssociationClass_4017 == req.getElementType()) {
- return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
//forbid creation of association branch from it.
if(UMLElementTypes.Association_4019 == req.getElementType()) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomPrimitiveTypeItemSemanticEditPolicyCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomPrimitiveTypeItemSemanticEditPolicyCN.java
index 133e8a50a8b..9091a6bac87 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomPrimitiveTypeItemSemanticEditPolicyCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomPrimitiveTypeItemSemanticEditPolicyCN.java
@@ -17,6 +17,7 @@ import org.eclipse.gef.commands.Command;
import org.eclipse.gef.commands.UnexecutableCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.BranchDependenctReorientCommand;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationClassCreateCommand;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationReorientCommand;
@@ -41,10 +42,10 @@ public class CustomPrimitiveTypeItemSemanticEditPolicyCN extends PrimitiveTypeIt
*/
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
if(UMLElementTypes.Association_4001 == req.getElementType()) {
- return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.AssociationClass_4017 == req.getElementType()) {
- return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.TemplateBinding_4015 == req.getElementType()) {
return getGEFWrapper(new CTemplateBindingCreateCommand(req, req.getSource(), req.getTarget()));
@@ -74,10 +75,10 @@ public class CustomPrimitiveTypeItemSemanticEditPolicyCN extends PrimitiveTypeIt
*/
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
if(UMLElementTypes.Association_4001 == req.getElementType()) {
- return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.AssociationClass_4017 == req.getElementType()) {
- return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new CAssociationClassCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
//forbid creation of association branch from it.
if(UMLElementTypes.Association_4019 == req.getElementType()) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomSignalItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomSignalItemSemanticEditPolicy.java
index 9a4b862eb6c..ab878b614d4 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomSignalItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomSignalItemSemanticEditPolicy.java
@@ -17,6 +17,7 @@ import org.eclipse.gef.commands.Command;
import org.eclipse.gef.commands.UnexecutableCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.BranchDependenctReorientCommand;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationReorientCommand;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.CTemplateBindingCreateCommand;
@@ -40,7 +41,7 @@ public class CustomSignalItemSemanticEditPolicy extends SignalItemSemanticEditPo
*/
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
if(UMLElementTypes.Association_4001 == req.getElementType()) {
- return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.TemplateBinding_4015 == req.getElementType()) {
return getGEFWrapper(new CTemplateBindingCreateCommand(req, req.getSource(), req.getTarget()));
@@ -70,7 +71,7 @@ public class CustomSignalItemSemanticEditPolicy extends SignalItemSemanticEditPo
*/
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
if(UMLElementTypes.Association_4001 == req.getElementType()) {
- return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
//forbid creation of association branch from it.
if(UMLElementTypes.Association_4019 == req.getElementType()) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomSignalItemSemanticEditPolicyCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomSignalItemSemanticEditPolicyCN.java
index 28073ee8d28..2050cee7f22 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomSignalItemSemanticEditPolicyCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/policies/itemsemantic/CustomSignalItemSemanticEditPolicyCN.java
@@ -17,6 +17,7 @@ import org.eclipse.gef.commands.Command;
import org.eclipse.gef.commands.UnexecutableCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.BranchDependenctReorientCommand;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationReorientCommand;
import org.eclipse.papyrus.uml.diagram.clazz.custom.command.CTemplateBindingCreateCommand;
@@ -40,7 +41,7 @@ public class CustomSignalItemSemanticEditPolicyCN extends SignalItemSemanticEdit
*/
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
if(UMLElementTypes.Association_4001 == req.getElementType()) {
- return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
if(UMLElementTypes.TemplateBinding_4015 == req.getElementType()) {
return getGEFWrapper(new CTemplateBindingCreateCommand(req, req.getSource(), req.getTarget()));
@@ -70,7 +71,7 @@ public class CustomSignalItemSemanticEditPolicyCN extends SignalItemSemanticEdit
*/
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
if(UMLElementTypes.Association_4001 == req.getElementType()) {
- return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget()));
+ return getGEFWrapper(new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
}
//forbid creation of association branch from it.
if(UMLElementTypes.Association_4019 == req.getElementType()) {

Back to the top