Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbblajer2007-03-09 17:19:32 +0000
committerbblajer2007-03-09 17:19:32 +0000
commit770a2e899336bab8156e82debbad93aef342de27 (patch)
tree249a8e3d03f92508dc8366602d65a6013daf4f75 /plugins/org.eclipse.gmf.runtime.lite/src/org
parentc45571679432637b06fc3d4b67bae1870353fd47 (diff)
downloadorg.eclipse.gmf-tooling-770a2e899336bab8156e82debbad93aef342de27.tar.gz
org.eclipse.gmf-tooling-770a2e899336bab8156e82debbad93aef342de27.tar.xz
org.eclipse.gmf-tooling-770a2e899336bab8156e82debbad93aef342de27.zip
NewDiagramFileWizard: layout is not persisted if the diagram is closed right after initialization
Diffstat (limited to 'plugins/org.eclipse.gmf.runtime.lite/src/org')
-rw-r--r--plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/policies/XYLayoutEditPolicyEx.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/policies/XYLayoutEditPolicyEx.java b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/policies/XYLayoutEditPolicyEx.java
index f3e12b42a..6b4fc679b 100644
--- a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/policies/XYLayoutEditPolicyEx.java
+++ b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/policies/XYLayoutEditPolicyEx.java
@@ -14,14 +14,19 @@ package org.eclipse.gmf.runtime.lite.edit.policies;
import java.util.List;
import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.transaction.util.TransactionUtil;
import org.eclipse.gef.EditPart;
import org.eclipse.gef.EditPolicy;
import org.eclipse.gef.GraphicalEditPart;
import org.eclipse.gef.Request;
import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.UnexecutableCommand;
import org.eclipse.gef.editpolicies.ConstrainedLayoutEditPolicy;
import org.eclipse.gef.editpolicies.XYLayoutEditPolicy;
import org.eclipse.gef.requests.ChangeBoundsRequest;
+import org.eclipse.gmf.runtime.lite.commands.ChangeBoundsCommand;
+import org.eclipse.gmf.runtime.lite.commands.WrappingCommand;
+import org.eclipse.gmf.runtime.notation.Node;
/**
* Edit policy for use with edit parts with XYLayout generated with the lite runtime.
@@ -72,4 +77,17 @@ public abstract class XYLayoutEditPolicyEx extends XYLayoutEditPolicy {
}
return super.createChildEditPolicy(child);
}
+
+ @Override
+ protected Command createChangeConstraintCommand(final ChangeBoundsRequest request, final EditPart child, Object constraint) {
+ final Node node = (Node) child.getModel();
+ ChangeBoundsCommand emfCommand = new ChangeBoundsCommand(node, request, ((GraphicalEditPart) child).getFigure());
+ return new WrappingCommand(TransactionUtil.getEditingDomain(node.getDiagram().getElement()), emfCommand);
+ }
+
+ @Override
+ protected Command createChangeConstraintCommand(EditPart child, Object constraint) {
+ assert false;
+ return UnexecutableCommand.INSTANCE;
+ }
}

Back to the top