Community
Participate
Working Groups
+++ This bug was initially created as a clone of Bug #477208 +++ Steps to reproduce: 1. Open a diagram with two containers with labels. 2. Select both containers using Ctrl-click. One is the primary selection (black handles) and one is not (white handles). 3. Click on the label of the container which is not the primary selection: KO, an exception appears in the error log: eclipse.buildId=4.5.1.M20150904-0015 java.version=1.7.0_79 java.vendor=Oracle Corporation BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=fr_FR Framework arguments: -product org.eclipse.epp.package.modeling.product Command-line arguments: -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.modeling.product org.eclipse.ui Error Fri Sep 11 16:49:09 CEST 2015 Unhandled event loop exception java.lang.IllegalArgumentException: An EditPart has to be selectable (isSelectable() == true) in order to get selected. at org.eclipse.core.runtime.Assert.isLegal(Assert.java:63) at org.eclipse.gef.editparts.AbstractEditPart.setSelected(AbstractEditPart.java:1060) at org.eclipse.gef.SelectionManager.appendSelection(SelectionManager.java:89) at org.eclipse.gef.ui.parts.AbstractEditPartViewer.appendSelection(AbstractEditPartViewer.java:190) at org.eclipse.gef.ui.parts.AbstractEditPartViewer.select(AbstractEditPartViewer.java:599) at org.eclipse.gef.tools.SelectEditPartTracker.performSelection(SelectEditPartTracker.java:221) at org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx.performSelection(DragEditPartsTrackerEx.java:247) at org.eclipse.gef.tools.SelectEditPartTracker.performConditionalSelection(SelectEditPartTracker.java:167) at org.eclipse.gef.tools.SelectEditPartTracker.handleButtonDown(SelectEditPartTracker.java:92) at org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx.handleButtonDown(DragEditPartsTrackerEx.java:231) at org.eclipse.gef.tools.AbstractTool.mouseDown(AbstractTool.java:1091) at org.eclipse.gef.tools.SelectionTool.mouseDown(SelectionTool.java:514) at org.eclipse.gef.EditDomain.mouseDown(EditDomain.java:245) at org.eclipse.gef.ui.parts.DomainEventDispatcher.dispatchMousePressed(DomainEventDispatcher.java:348) at org.eclipse.draw2d.LightweightSystem$EventHandler.mouseDown(LightweightSystem.java:523) If at step 3 you use the mouse to draw a selection rectangle which includes the non-primary selected container's label, the exception appears too, but in addition the selection marquee stays on the diagram and can not be removed except by closing and reopening the diagram.
The getParent().isSelectable() == EditPart.SELECTED has been introduce before the move to open source. This test is weird, it make the name part selectable only when the main part is in secondary selection (see EditPart.SELECTED vs EditPart.SELECTED_PRIMARY). Furthermore, the container/list/region name parts cannot be moved and the direct edit works. So we can simply always return false in isSelectable(). The IllegalArgumentException occurS because the drag tracker saw the name edit part as a selectable part (its parent is secondary selected) but during the set selection the AbstractEditPartView call primDeselectAll() which change the isSelectable() status of the DDiagramElementContainer name edit parts.
New Gerrit change created: https://git.eclipse.org/r/55761
New Gerrit change created: https://git.eclipse.org/r/55852
Gerrit change https://git.eclipse.org/r/55852 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=ee528044b8de2d0992ab458e5a2c925893618b8e
Gerrit change https://git.eclipse.org/r/55748 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=9cf1783c487c077ba2915922ec5e8a4679a30ce0
Gerrit change https://git.eclipse.org/r/55761 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=af1d22c7376477e55a3dc84e844f7be1ff527026
Fixed by af1d22c7376477e55a3dc84e844f7be1ff527026.
Validated with Sirius 3.1.0.201509241504
Available in Sirius 3.1.0.