Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcletavernie2012-02-22 05:00:29 -0500
committercletavernie2012-02-22 05:00:29 -0500
commit99424c0dc53872c75266108377e3a89dcbb31629 (patch)
tree68e672727383a09336575a699e33c0277aacac2f /plugins
parentf4b4a60ba86f049eef4ce191ba6cc002c6f7100e (diff)
downloadorg.eclipse.papyrus-99424c0dc53872c75266108377e3a89dcbb31629.tar.gz
org.eclipse.papyrus-99424c0dc53872c75266108377e3a89dcbb31629.tar.xz
org.eclipse.papyrus-99424c0dc53872c75266108377e3a89dcbb31629.zip
364828: [Sequence Diagram] - Messages deletion
https://bugs.eclipse.org/bugs/show_bug.cgi?id=364828
Diffstat (limited to 'plugins')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SequenceDeleteHelper.java39
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message2ItemSemanticEditPolicy.java20
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message3ItemSemanticEditPolicy.java20
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message4ItemSemanticEditPolicy.java20
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message5ItemSemanticEditPolicy.java20
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message6ItemSemanticEditPolicy.java20
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message7ItemSemanticEditPolicy.java20
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/MessageItemSemanticEditPolicy.java20
8 files changed, 53 insertions, 126 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SequenceDeleteHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SequenceDeleteHelper.java
index 054bfb2528f..bf79d3a655a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SequenceDeleteHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SequenceDeleteHelper.java
@@ -21,20 +21,29 @@ import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.gef.EditPart;
import org.eclipse.gef.commands.Command;
import org.eclipse.gef.commands.CompoundCommand;
+import org.eclipse.gef.commands.UnexecutableCommand;
+import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
+import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
import org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil;
import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.LifelineEditPart;
import org.eclipse.uml2.uml.DestructionOccurrenceSpecification;
import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Event;
import org.eclipse.uml2.uml.ExecutionSpecification;
import org.eclipse.uml2.uml.Message;
import org.eclipse.uml2.uml.MessageEnd;
+import org.eclipse.uml2.uml.MessageOccurrenceSpecification;
import org.eclipse.uml2.uml.OccurrenceSpecification;
/**
@@ -201,4 +210,34 @@ public class SequenceDeleteHelper {
}
}
}
+
+ public static Command completeDeleteMessageCommand(DestroyElementRequest req) {
+ EObject selectedEObject = req.getElementToDestroy();
+ IElementEditService provider = ElementEditServiceUtils
+ .getCommandProvider(selectedEObject);
+ if (provider != null) {
+ // Retrieve delete command from the Element Edit service
+ ICommand deleteCommand = provider.getEditCommand(req);
+ if (deleteCommand != null) {
+ CompositeCommand command = new CompositeCommand(
+ deleteCommand.getLabel());
+ command.add(deleteCommand);
+ Message message = (Message) selectedEObject;
+ MessageEnd receiveEvent = message.getReceiveEvent();
+ if (receiveEvent != null) {
+ DestroyElementRequest myReq = new DestroyElementRequest(
+ req.getEditingDomain(), receiveEvent, false);
+ command.add(new DestroyElementCommand(myReq));
+ }
+ MessageEnd sendEvent = message.getSendEvent();
+ if (sendEvent != null) {
+ DestroyElementRequest myReq = new DestroyElementRequest(
+ req.getEditingDomain(), sendEvent, false);
+ command.add(new DestroyElementCommand(myReq));
+ }
+ return new ICommandProxy(command);
+ }
+ }
+ return UnexecutableCommand.INSTANCE;
+ }
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message2ItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message2ItemSemanticEditPolicy.java
index ab5bf506c2c..da37fb65131 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message2ItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message2ItemSemanticEditPolicy.java
@@ -13,13 +13,9 @@
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.sequence.edit.policies;
-import org.eclipse.emf.ecore.EObject;
import org.eclipse.gef.commands.Command;
import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
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.emf.type.core.requests.DestroyElementRequest;
@@ -27,8 +23,6 @@ import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementReorientCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
@@ -92,20 +86,10 @@ public class Message2ItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
/**
* the added code to delete the messageoccurencespecification when the message is deleted
*
- * @generated
+ * @generated NOT
*/
protected Command getDestroyElementCommand(DestroyElementRequest req) {
- EObject selectedEObject = req.getElementToDestroy();
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
- // Retrieve delete command from the Element Edit service
- ICommand deleteCommand = provider.getEditCommand(req);
-
- if(deleteCommand != null) {
- return new ICommandProxy(deleteCommand);
- }
- }
- return UnexecutableCommand.INSTANCE;
+ return SequenceDeleteHelper.completeDeleteMessageCommand(req);
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message3ItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message3ItemSemanticEditPolicy.java
index 67d8d8c4280..e3c51c6f8ac 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message3ItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message3ItemSemanticEditPolicy.java
@@ -13,13 +13,9 @@
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.sequence.edit.policies;
-import org.eclipse.emf.ecore.EObject;
import org.eclipse.gef.commands.Command;
import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
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.emf.type.core.requests.DestroyElementRequest;
@@ -27,8 +23,6 @@ import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementReorientCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
@@ -90,20 +84,10 @@ public class Message3ItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
}
/**
- * @generated
+ * @generated NOT
*/
protected Command getDestroyElementCommand(DestroyElementRequest req) {
- EObject selectedEObject = req.getElementToDestroy();
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
- // Retrieve delete command from the Element Edit service
- ICommand deleteCommand = provider.getEditCommand(req);
-
- if(deleteCommand != null) {
- return new ICommandProxy(deleteCommand);
- }
- }
- return UnexecutableCommand.INSTANCE;
+ return SequenceDeleteHelper.completeDeleteMessageCommand(req);
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message4ItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message4ItemSemanticEditPolicy.java
index 3c49d50356b..efce0b5a320 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message4ItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message4ItemSemanticEditPolicy.java
@@ -13,13 +13,9 @@
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.sequence.edit.policies;
-import org.eclipse.emf.ecore.EObject;
import org.eclipse.gef.commands.Command;
import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
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.emf.type.core.requests.DestroyElementRequest;
@@ -27,8 +23,6 @@ import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementReorientCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
@@ -90,20 +84,10 @@ public class Message4ItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
}
/**
- * @generated
+ * @generated NOT
*/
protected Command getDestroyElementCommand(DestroyElementRequest req) {
- EObject selectedEObject = req.getElementToDestroy();
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
- // Retrieve delete command from the Element Edit service
- ICommand deleteCommand = provider.getEditCommand(req);
-
- if(deleteCommand != null) {
- return new ICommandProxy(deleteCommand);
- }
- }
- return UnexecutableCommand.INSTANCE;
+ return SequenceDeleteHelper.completeDeleteMessageCommand(req);
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message5ItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message5ItemSemanticEditPolicy.java
index 6eaf287c01e..6af9fbdba64 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message5ItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message5ItemSemanticEditPolicy.java
@@ -13,13 +13,9 @@
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.sequence.edit.policies;
-import org.eclipse.emf.ecore.EObject;
import org.eclipse.gef.commands.Command;
import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
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.emf.type.core.requests.DestroyElementRequest;
@@ -27,8 +23,6 @@ import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementReorientCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
@@ -90,20 +84,10 @@ public class Message5ItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
}
/**
- * @generated
+ * @generated NOT
*/
protected Command getDestroyElementCommand(DestroyElementRequest req) {
- EObject selectedEObject = req.getElementToDestroy();
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
- // Retrieve delete command from the Element Edit service
- ICommand deleteCommand = provider.getEditCommand(req);
-
- if(deleteCommand != null) {
- return new ICommandProxy(deleteCommand);
- }
- }
- return UnexecutableCommand.INSTANCE;
+ return SequenceDeleteHelper.completeDeleteMessageCommand(req);
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message6ItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message6ItemSemanticEditPolicy.java
index 7415b50cac1..e4ede8a5831 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message6ItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message6ItemSemanticEditPolicy.java
@@ -13,13 +13,9 @@
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.sequence.edit.policies;
-import org.eclipse.emf.ecore.EObject;
import org.eclipse.gef.commands.Command;
import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
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.emf.type.core.requests.DestroyElementRequest;
@@ -27,8 +23,6 @@ import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementReorientCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
@@ -90,20 +84,10 @@ public class Message6ItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
}
/**
- * @generated
+ * @generated NOT
*/
protected Command getDestroyElementCommand(DestroyElementRequest req) {
- EObject selectedEObject = req.getElementToDestroy();
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
- // Retrieve delete command from the Element Edit service
- ICommand deleteCommand = provider.getEditCommand(req);
-
- if(deleteCommand != null) {
- return new ICommandProxy(deleteCommand);
- }
- }
- return UnexecutableCommand.INSTANCE;
+ return SequenceDeleteHelper.completeDeleteMessageCommand(req);
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message7ItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message7ItemSemanticEditPolicy.java
index adbd0279ed0..145f040c921 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message7ItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/Message7ItemSemanticEditPolicy.java
@@ -13,13 +13,9 @@
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.sequence.edit.policies;
-import org.eclipse.emf.ecore.EObject;
import org.eclipse.gef.commands.Command;
import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
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.emf.type.core.requests.DestroyElementRequest;
@@ -27,8 +23,6 @@ import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementReorientCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
@@ -90,20 +84,10 @@ public class Message7ItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
}
/**
- * @generated
+ * @generated NOT
*/
protected Command getDestroyElementCommand(DestroyElementRequest req) {
- EObject selectedEObject = req.getElementToDestroy();
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
- // Retrieve delete command from the Element Edit service
- ICommand deleteCommand = provider.getEditCommand(req);
-
- if(deleteCommand != null) {
- return new ICommandProxy(deleteCommand);
- }
- }
- return UnexecutableCommand.INSTANCE;
+ return SequenceDeleteHelper.completeDeleteMessageCommand(req);
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/MessageItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/MessageItemSemanticEditPolicy.java
index 9eb14a120a9..4dfdfde7986 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/MessageItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/MessageItemSemanticEditPolicy.java
@@ -13,13 +13,9 @@
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.sequence.edit.policies;
-import org.eclipse.emf.ecore.EObject;
import org.eclipse.gef.commands.Command;
import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
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.emf.type.core.requests.DestroyElementRequest;
@@ -27,8 +23,6 @@ import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.CommentAnnotatedElementReorientCommand;
import org.eclipse.papyrus.uml.diagram.sequence.edit.commands.ConstraintConstrainedElementCreateCommand;
@@ -90,20 +84,10 @@ public class MessageItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy
}
/**
- * @generated
+ * @generated NOT
*/
protected Command getDestroyElementCommand(DestroyElementRequest req) {
- EObject selectedEObject = req.getElementToDestroy();
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
- // Retrieve delete command from the Element Edit service
- ICommand deleteCommand = provider.getEditCommand(req);
-
- if(deleteCommand != null) {
- return new ICommandProxy(deleteCommand);
- }
- }
- return UnexecutableCommand.INSTANCE;
+ return SequenceDeleteHelper.completeDeleteMessageCommand(req);
}
/**

Back to the top