| 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: | |||
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. Fixed implementation of setViewerSelection() as outlined. Pushed changes to origin/master. Will be available in Luna M2. |
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; }