Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Lorenzo2014-04-11 14:47:02 +0000
committerVincent Lorenzo2014-04-11 14:47:02 +0000
commit182c1a1383dd44f82f45c7fee72fbf18832e08b8 (patch)
tree10c900ffe7b5bed574d1155ff3321ab6c5c83146
parentc0a5e2ea48e1a1d0bd60fa888ee9fcb490a9bbc9 (diff)
downloadorg.eclipse.papyrus-182c1a1383dd44f82f45c7fee72fbf18832e08b8.tar.gz
org.eclipse.papyrus-182c1a1383dd44f82f45c7fee72fbf18832e08b8.tar.xz
org.eclipse.papyrus-182c1a1383dd44f82f45c7fee72fbf18832e08b8.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.java16
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;
}
/**

Back to the top