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

Bug 417188

Summary: SelectionSynchronizer don't respect selectable
Product: [Tools] GEF Reporter: Falko Schumann <falko.schumann>
Component: GEF-Legacy GEF (MVC)Assignee: gef-inbox <gef-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: news, nyssen
Version: 3.9.0   
Target Milestone: 3.9.100 (Luna) M2   
Hardware: All   
OS: All   
Whiteboard:

Description Falko Schumann CLA 2013-09-13 09:34:49 EDT
While upgrading from GEF 3.6 to GEF 3.9 I found a new assert in AbstractEditPart#setSelected(int value). The assert fails if try to select an unselectable edit part. An AbstractGraphicalEditPart is selectable if the figure is showing.

In my scenario I have two viewers, tree viewer in Outline View and graphical viewer in an editor part. The graphical viewer contains a set of layers with visible flag. If I select an edit part in tree viewer the SelectionSynchronizer run in this new assert if the edit part in graphical viewer is contained in an invisible layer.

My solution is changing the following method in SelectionSynchronizer


	protected EditPart convert(EditPartViewer viewer, EditPart part) {
		EditPart temp = (EditPart) viewer.getEditPartRegistry().get(part.getModel());
		EditPart newPart = null;
		if (temp != null && temp.isSelectable()) {
			newPart =  temp;
		}
		return newPart;
	}
Comment 1 Alexander Nyßen CLA 2013-09-30 10:03:23 EDT
As convert may be overwritten by clients (and the check within may be forgotten), I rather opt to change setViewerSelection() to filter for selectable edit parts only.
Comment 2 Alexander Nyßen CLA 2013-09-30 10:07:08 EDT
Fixed implementation of setViewerSelection() as outlined. Pushed changes to origin/master. Will be available in Luna M2.