From 37281013b3556b2479e2efe297058649f407924a Mon Sep 17 00:00:00 2001 From: Camille Letavernier Date: Tue, 28 Jan 2014 16:03:19 +0100 Subject: 425749: [Class Diagram] Deletion of different element types together causes exception https://bugs.eclipse.org/bugs/show_bug.cgi?id=425749 --- .../common/editpolicies/PapyrusResizableShapeEditPolicy.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'plugins') diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/PapyrusResizableShapeEditPolicy.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/PapyrusResizableShapeEditPolicy.java index 74c05d41c4d..f5c83a5c8c4 100644 --- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/PapyrusResizableShapeEditPolicy.java +++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/PapyrusResizableShapeEditPolicy.java @@ -7,7 +7,7 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * + * * CEA LIST - Initial API and implementation * *****************************************************************************/ @@ -18,7 +18,7 @@ import org.eclipse.gef.requests.ChangeBoundsRequest; import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ResizableShapeEditPolicy; /** - * + * * See Bug 424943 ResizableEditPolicy#getResizeCommand duplicates request ignoring some request values * TODO : remove this class when the bug will be fixed */ @@ -29,11 +29,12 @@ public class PapyrusResizableShapeEditPolicy extends ResizableShapeEditPolicy { * default, the request is re-dispatched to the host's parent as a {@link org.eclipse.gef.RequestConstants#REQ_RESIZE_CHILDREN}. The * parent's edit policies determine how to perform the resize based on the * layout manager in use. - * + * * @param request * the resize request * @return the command contribution obtained from the parent */ + @Override protected Command getResizeCommand(ChangeBoundsRequest request) { ChangeBoundsRequest req = new ChangeBoundsRequest(REQ_RESIZE_CHILDREN); req.setCenteredResize(request.isCenteredResize()); @@ -47,6 +48,11 @@ public class PapyrusResizableShapeEditPolicy extends ResizableShapeEditPolicy { req.setLocation(request.getLocation()); req.setExtendedData(request.getExtendedData()); req.setResizeDirection(request.getResizeDirection()); + + if(getHost().getParent() == null) { + return null; + } + return getHost().getParent().getCommand(req); } -- cgit v1.2.3