Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 165972

Summary: Selection not validated
Product: [Tools] GEF Reporter: Alex Boyko <aboyko>
Component: GEF-Legacy GEF (MVC)Assignee: gef-inbox <gef-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: ahunter.eclipse
Version: 3.2.1   
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard:

Description Alex Boyko CLA 2006-11-27 16:06:28 EST
Build ID: 3.2.0

Steps To Reproduce:
1. Override isSelectable() method on CircuitEditPart from Logic editor example. Ensure that the method returns false
2. Create a new Logic diagram and place "Circuit" on the diagram
3. In the outline view, open up the tree view of the diagram and select the tree node corresponding to the "Circuit"

Problem: "Circuit" is selected in the graphical viewer too, although it must not be selectable.
Expected: non-selectable edit parts should not be selected.


More information:
Tree viewer can also have a tree item corresponding to the diagram edit part in the graphical viewer. Hence, once such a tree item is selected the diagram edit part in the graphical viewer becomes selected explicitly, which must never happen (can be reproduced with GMF example editors).

This behavior happens because there no validation done of selection passed from the tree viewer to graphical viewer.
Tree viewer fires selection to SelectionSynchronizer, which converts tree edit parts into graphical edit parts and passes the selection to graphical viewer's setSelection() method which calls setSelection() method of SelectionManager to set the selection. None of these steps has testing  whether edit parts to be selected are actually selectable.

I would suggest to do the testing for selectability of edit parts to be added to selection either in the SelectionManager or in the Viewer's class
Comment 1 Pratik Shah CLA 2006-11-28 12:59:36 EST
Dupe of bug 99815
Comment 2 Anthony Hunter CLA 2009-03-06 11:33:54 EST

*** This bug has been marked as a duplicate of bug 99815 ***