diff options
author | Vincent Lorenzo | 2014-04-11 14:47:02 +0000 |
---|---|---|
committer | Vincent Lorenzo | 2014-04-11 14:48:40 +0000 |
commit | 32aa7981aec97e876e49fe7b5ae6551ee180fd98 (patch) | |
tree | e91b0f74ed172facf92e4c961855bceaa7e1eafe | |
parent | c323d87c8e82d4fa64ed812c125f81b1e6019d6b (diff) | |
download | org.eclipse.papyrus-32aa7981aec97e876e49fe7b5ae6551ee180fd98.tar.gz org.eclipse.papyrus-32aa7981aec97e876e49fe7b5ae6551ee180fd98.tar.xz org.eclipse.papyrus-32aa7981aec97e876e49fe7b5ae6551ee180fd98.zip |
430702: [Diagram] Moving source of a link moves the target too. Add a test to avoid to chain the fix anchor command to an unexecutable command
-rw-r--r-- | plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/DefaultGraphicalNodeEditPolicy.java | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/DefaultGraphicalNodeEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/DefaultGraphicalNodeEditPolicy.java index cc8533b56a5..dc711eaab88 100644 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/DefaultGraphicalNodeEditPolicy.java +++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/DefaultGraphicalNodeEditPolicy.java @@ -91,13 +91,15 @@ public class DefaultGraphicalNodeEditPolicy extends GraphicalNodeEditPolicy { } final TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain(); - final CompoundCommand cc = new CompoundCommand("ConnectionAndRelationshipCompleteCommand");//$NON-NLS-1$ - final ICommand fixAnchor = new FixEdgeAnchorAfterCreationCommand(editingDomain, request); - - - cc.add(super.getConnectionAndRelationshipCompleteCommand(request)); - cc.add(new ICommandProxy(fixAnchor)); - return cc; + final Command defaultCommand = super.getConnectionAndRelationshipCompleteCommand(request); + if(defaultCommand != null && defaultCommand.canExecute()) { + final CompoundCommand cc = new CompoundCommand("ConnectionAndRelationshipCompleteCommand");//$NON-NLS-1$ + cc.add(defaultCommand); + final ICommand fixAnchor = new FixEdgeAnchorAfterCreationCommand(editingDomain, request); + cc.add(new ICommandProxy(fixAnchor)); + return cc; + } + return defaultCommand; } /** |