summaryrefslogtreecommitdiffstats
authorHenrik Rentz-Reichert2012-07-20 10:24:13 (EDT)
committer Henrik Rentz-Reichert2012-07-20 10:27:18 (EDT)
commitbecf9f55a38e07b20ef3abe861c21033cc0a69a4 (patch) (side-by-side diff)
treed6ff3cb9bdcc2a78037e5a0cc9bc4426d9e2e19e
parentae018a7a3aa1082f3cfd3dbbfbfa55a657f4c4d2 (diff)
downloadorg.eclipse.gmp.graphiti-becf9f55a38e07b20ef3abe861c21033cc0a69a4.zip
org.eclipse.gmp.graphiti-becf9f55a38e07b20ef3abe861c21033cc0a69a4.tar.gz
org.eclipse.gmp.graphiti-becf9f55a38e07b20ef3abe861c21033cc0a69a4.tar.bz2
bug 329517: state call backs during creation of a connectionrefs/changes/93/6893/1
https://bugs.eclipse.org/bugs/show_bug.cgi?id=329517 Calling connectionStarted of the CreateConnectionCommand also for drag connections Change-Id: I77c4a37030840086fd5f7ecd0aba36d03fde780b
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/GFDragConnectionTool.java16
1 files changed, 14 insertions, 2 deletions
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/GFDragConnectionTool.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/GFDragConnectionTool.java
index 17f07ad..0f0b5e9 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/GFDragConnectionTool.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/GFDragConnectionTool.java
@@ -24,6 +24,7 @@ import org.eclipse.gef.requests.CreateConnectionRequest;
import org.eclipse.gef.tools.ConnectionDragCreationTool;
import org.eclipse.graphiti.tb.ContextButtonEntry;
import org.eclipse.graphiti.ui.editor.DiagramEditor;
+import org.eclipse.graphiti.ui.internal.command.CreateConnectionCommand;
import org.eclipse.graphiti.ui.internal.requests.ContextButtonDragRequest;
/**
@@ -104,8 +105,8 @@ public class GFDragConnectionTool extends ConnectionDragCreationTool {
((CreateConnectionRequest) getTargetRequest()).setSourceEditPart(getTargetEditPart());
Command command = getCommand();
if (command != null) {
- setState(STATE_CONNECTION_STARTED);
setCurrentCommand(command);
+ setState(STATE_CONNECTION_STARTED);
}
handleDrag();
@@ -139,8 +140,8 @@ public class GFDragConnectionTool extends ConnectionDragCreationTool {
createConnectionRequest.setTargetEditPart(targetTargetEditPart);
Command command = getCommand();
if (command != null) {
- setState(STATE_CONNECTION_STARTED);
setCurrentCommand(command);
+ setState(STATE_CONNECTION_STARTED);
}
handleDrag();
@@ -170,4 +171,15 @@ public class GFDragConnectionTool extends ConnectionDragCreationTool {
}
+ @Override
+ protected void setState(int state) {
+ if (state == STATE_CONNECTION_STARTED) {
+ Command cmd = getCurrentCommand();
+ if (cmd instanceof CreateConnectionCommand) {
+ ((CreateConnectionCommand) cmd).connectionStarted();
+ }
+ }
+ super.setState(state);
+ }
+
}