Community
Participate
Working Groups
The spec of CommonViewerSorter states that it must be used with a CommonViewer. However, there is nothing in the class that has a depencency on CommonViewer. The only dependency is on INavigatorContentService. Unless there is some reason to do so, I think that CommonViewer should be a convenience class and there should be no reference to it from the INavigatorContentService, INavigatorActionService or CommonViewerSorter. Here is the reason for my request. One of the things we have in Team is a global synchronization wizard. From this, the user can browse the workspace and select what resources they want to synchronize. I have extended this to use the Common Navigator framework. The tricky part is that the tree is a ContainerCheckedTreeViewer. I was able to use an INavigatorContentService with this viewer with no problems. I want to use the CommonViewerSorter as well and there does not appear to be anything in the implementation that would prevent it's use.
The biggest connection between the CommonViewerSorter and CommonViewer seems to be that the viewer needs to provide the sorter with the parent when sorting. Given the recent work on support for TreePaths in the JFace tree viewer, I think it would be worthwhile to create a TreePath based sorter and have it live in JFace. An added benefit of this would be that the CommonViewer would not need to override as many methods. Nick and Michael, does this seem reasonable? If it does, I can help with the implementation if needed. I've been looking at support for TreePath based content providers already (see bug 122756).
As for the use of the INavigatorContentService in a CheckboxTreeViewer (i.e. not a subclass of CommonViewer), can you think of any gotchas I should be aware of? I haven't seen any problems yet.
Created attachment 34166 [details] Patch to add TreePathViewerSorter to JFace Here's the patch that adds the TreePathViewerSorter to JFace and converts the CommonViewerSorter to use that sorter (and removes the copied code from CommonViewer).
I have logged bug 126506 to add the TreePathViewerSorter to JFace
This was also scoped for M5. The change is required to make better use of JFace API that was introduced in M5.
+1 to applying the patch.
Released the patch. Added a work around due to bug 129193.
Fixed.