Bug 226150 - Arrange All Command need to check whether the EditPart is active
Summary: Arrange All Command need to check whether the EditPart is active
Status: RESOLVED FIXED
Alias: None
Product: GMF-Runtime
Classification: Modeling
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 critical
Target Milestone: ---   Edit
Assignee: Alex Boyko CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks: 219592
  Show dependency tree
 
Reported: 2008-04-08 12:28 EDT by Jacques LESCOT CLA
Modified: 2008-04-28 18:55 EDT (History)
2 users (show)

See Also:


Attachments
Provide an additional check on the active state of an EditPart while calculating the Arrange All Command (1.13 KB, patch)
2008-04-08 12:28 EDT, Jacques LESCOT CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jacques LESCOT CLA 2008-04-08 12:28:33 EDT
Created attachment 95230 [details]
Provide an additional check on the active state of an EditPart while calculating the Arrange All Command

While fixing bug 203520, I am encountering a new bug while deleting an element from the diagram because of the synchronisation between the editor and the outline view.

Here is an snippet of the raised exception :
...
Caused by: java.lang.IllegalArgumentException: Argument 'nodes' contains objects which have a different parent containment
at org.eclipse.gmf.runtime.diagram.ui.services.layout.LayoutService.checkValidLayoutNodes(LayoutService.java:120)
at org.eclipse.gmf.runtime.diagram.ui.services.layout.LayoutService.layoutLayoutNodes(LayoutService.java:294)
at org.eclipse.gmf.runtime.diagram.ui.editpolicies.ContainerEditPolicy.layoutNodes(ContainerEditPolicy.java:374)
at org.eclipse.gmf.runtime.diagram.ui.editpolicies.ContainerEditPolicy.getArrangeCommand(ContainerEditPolicy.java:329)
at org.eclipse.gmf.runtime.diagram.ui.editpolicies.ContainerEditPolicy.getCommand(ContainerEditPolicy.java:509)
at org.eclipse.gef.editparts.AbstractEditPart.getCommand(AbstractEditPart.java:473)
at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.access$1(GraphicalEditPart.java:1)
at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart$1.run(GraphicalEditPart.java:463)
at org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl.runExclusive(TransactionalEditingDomainImpl.java:289)
at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.getCommand(GraphicalEditPart.java:458)
at org.eclipse.gmf.runtime.diagram.ui.actions.internal.ArrangeAction.getCommand(ArrangeAction.java:90)
at org.eclipse.gmf.runtime.diagram.ui.actions.DiagramAction.calculateEnabled(DiagramAction.java:124)
at org.eclipse.gmf.runtime.diagram.ui.actions.DiagramAction.refresh(DiagramAction.java:114)
at org.eclipse.gmf.runtime.common.ui.action.AbstractActionHandler.selectionChanged(AbstractActionHandler.java:387)
at org.eclipse.emf.ecoretools.diagram.part.EcoreDiagramEditor$4.fireSelectionChanged(EcoreDiagramEditor.java:357)
...

The attached patch provide an additional check on the active state of an EditPart while calculating the Arrange All Command and there is no more Exception.
Comment 1 Anthony Hunter CLA 2008-04-28 17:03:45 EDT
Hi Alex, can you review this patch?
Comment 2 Alex Boyko CLA 2008-04-28 18:55:25 EDT
The patch looks ok and harmless. If an editpart is not active it cannot be moved anywhere anyway, so it shouldn't be supplied to the graph layout algorithm.
Committed the patch to head.
Comment 3 Eclipse Webmaster CLA 2010-07-19 12:30:27 EDT
[GMF Restructure] Bug 319140 : product GMF and component Runtime Diagram was the original product and component for this bug