Community
Participate
Working Groups
Copied from an e-mail sent by Nick: Maybe we should instead add the ability to consider the parent in ViewerSorter, e.g. add the following methods to ViewerSorter: - sort(Viewer viewer, Object parent, Object[] elements) - compare(Viewer viewer, Object parent, Object e1, Object e2) and change the viewers to call these instead. The default implementation would be in terms of the old sort and compare methods to ensure that existing overrides of sort and compare still get honoured. We may need to put the methods in a new ViewerSorter2 subclass (with instanceof checks in the viewers) to ensure backwards compatibility.
How about a subclass called TreeViewerSorter with the additional methods?
Much better than ViewerSorter2.
The new class is called TreePathViewerSorter and takes not only the parent into account, but the full tree path. *** This bug has been marked as a duplicate of 126506 ***