Community
Participate
Working Groups
Now that the JFace tree viewer supports the notion of a tree path, it would be benefitial if this information was made available to content providers and label providers. The particular scenario that requires this is team views that include change sets. A view can display multiple change sets and a single model element may be included in multiple change sets. In 3.2, we are using the common navigator framework to allow model providers to display their models in a team operation. Having a tree path based content provider would allow the logical model display to be intermixed with change sets. Without this support, team providers would most likely need to support two views, one which shows resources and change sets and another that shows the effects of the operation on the logical model.
Created attachment 33433 [details] First cut Here's a patch that is a first cut at this. It adds an ITreePathContent provider and the required support in AbstractTreeViewer. It also adds the API to the common navigator and includes a use of the API in team (although it doesn't make any special use of the path). It doesn't yet address the add/remove issue (i.e. we would need to add the ability to add or remove a tree path).
Created attachment 33434 [details] Modified Add and Remove to take a TreePath
Created attachment 34171 [details] Latest Patch I've updated the patch to work against the latest in HEAD. I've also added the tree path sorting and a getParentPaths to the content provider (although the viewer doesn't use it).
Created attachment 34218 [details] And yet another patch I've added the label provider as well. I've run the viewer tests and they all pass (not that that is an indication that all is well but it's a good start).
Created attachment 34254 [details] Yet another patch This latest installment has all the changes we discussed.
Created attachment 34255 [details] Patch again I had to change the order of content provide instanceof checks in case the content provider implemented both interfaces. We want the TreePath version to be checked first.
Thanks for the patch, Michael! Released >20060206.
[I20060214-0800] Verfied by looking at the code in the imported JFace plug-in.