diff options
author | Mickael ADAM | 2017-10-09 14:09:52 +0000 |
---|---|---|
committer | Patrick Tessier | 2017-10-11 11:51:08 +0000 |
commit | fd004f4251dff30d10a5bb34791f1be0ef6399ee (patch) | |
tree | f38866a64ad2d765571c33e26f2e82b1f322cb41 | |
parent | db06a6b059c8f86563ff81dfee18df2ad615c313 (diff) | |
download | org.eclipse.papyrus-fd004f4251dff30d10a5bb34791f1be0ef6399ee.tar.gz org.eclipse.papyrus-fd004f4251dff30d10a5bb34791f1be0ef6399ee.tar.xz org.eclipse.papyrus-fd004f4251dff30d10a5bb34791f1be0ef6399ee.zip |
Bug 522729 - [Sequence Diagram] execution specification is not well set
with message reply
https://bugs.eclipse.org/bugs/show_bug.cgi?id=522729
- destroy not wanted finish occur spec.
Change-Id: I6bfb147aeaae584dc9314cec4bbacfba449925dc
Signed-off-by: Mickael ADAM <mickael.adam@all4tec.net>
-rw-r--r-- | plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CreateExecutionSpecificationWithMessage.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CreateExecutionSpecificationWithMessage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CreateExecutionSpecificationWithMessage.java index fce8c6bfda7..79b8fd40a9a 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CreateExecutionSpecificationWithMessage.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/command/CreateExecutionSpecificationWithMessage.java @@ -43,7 +43,10 @@ import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest; import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequestFactory; import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand; import org.eclipse.gmf.runtime.emf.type.core.IHintedType; +import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest; import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.papyrus.commands.DestroyElementPapyrusCommand; +import org.eclipse.papyrus.infra.emf.gmf.command.GMFtoEMFCommandWrapper; import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.CustomActionExecutionSpecificationEditPart; import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.LifelineEditPart; import org.eclipse.papyrus.uml.diagram.sequence.messages.Messages; @@ -53,6 +56,7 @@ import org.eclipse.papyrus.uml.service.types.element.UMLDIElementTypes; import org.eclipse.uml2.uml.ExecutionSpecification; import org.eclipse.uml2.uml.Message; import org.eclipse.uml2.uml.MessageEnd; +import org.eclipse.uml2.uml.OccurrenceSpecification; import org.eclipse.uml2.uml.UMLPackage; /** @@ -168,8 +172,15 @@ public class CreateExecutionSpecificationWithMessage extends AbstractTransaction Message messageReply = getCreatedElement(replycommand, Message.class); if (null != messageReply) { MessageEnd sendEvent = messageReply.getSendEvent(); + OccurrenceSpecification finish = executionSpecification.getFinish(); SetCommand setSendEventCommand = new SetCommand(getEditingDomain(), executionSpecification, UMLPackage.eINSTANCE.getExecutionSpecification_Finish(), sendEvent); setSendEventCommand.execute(); + + // delete the old finish os. + DestroyElementPapyrusCommand destroyElementPapyrusCommand = new DestroyElementPapyrusCommand(new DestroyElementRequest(finish, false)); + if (destroyElementPapyrusCommand != null && destroyElementPapyrusCommand.canExecute()) { + getEditingDomain().getCommandStack().execute(new GMFtoEMFCommandWrapper(destroyElementPapyrusCommand)); + } } } |