Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2014-01-28 10:03:19 -0500
committerCamille Letavernier2014-01-28 10:03:19 -0500
commit37281013b3556b2479e2efe297058649f407924a (patch)
treec6748136754bbb1aba540e72df83e6f41ae01ac2 /plugins
parentb9e741da9eaebb34f48cbcf802e963bd91437741 (diff)
downloadorg.eclipse.papyrus-37281013b3556b2479e2efe297058649f407924a.tar.gz
org.eclipse.papyrus-37281013b3556b2479e2efe297058649f407924a.tar.xz
org.eclipse.papyrus-37281013b3556b2479e2efe297058649f407924a.zip
425749: [Class Diagram] Deletion of different element types together
causes exception https://bugs.eclipse.org/bugs/show_bug.cgi?id=425749
Diffstat (limited to 'plugins')
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/PapyrusResizableShapeEditPolicy.java12
1 files changed, 9 insertions, 3 deletions
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);
}

Back to the top