Bug 122756 - [Viewers] Support for TreePath based content providers
Summary: [Viewers] Support for TreePath based content providers
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2 M5   Edit
Assignee: Boris Bokowski CLA
QA Contact:
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks: 122849
  Show dependency tree
 
Reported: 2006-01-05 09:55 EST by Michael Valenta CLA
Modified: 2006-02-14 17:21 EST (History)
3 users (show)

See Also:


Attachments
First cut (27.18 KB, patch)
2006-01-21 21:28 EST, Michael Valenta CLA
no flags Details | Diff
Modified Add and Remove to take a TreePath (32.39 KB, patch)
2006-01-21 21:54 EST, Michael Valenta CLA
no flags Details | Diff
Latest Patch (28.84 KB, patch)
2006-02-05 21:33 EST, Michael Valenta CLA
no flags Details | Diff
And yet another patch (38.20 KB, patch)
2006-02-06 15:22 EST, Michael Valenta CLA
no flags Details | Diff
Yet another patch (49.14 KB, patch)
2006-02-06 20:37 EST, Michael Valenta CLA
no flags Details | Diff
Patch again (43.11 KB, patch)
2006-02-06 21:00 EST, Michael Valenta CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Valenta CLA 2006-01-05 09:55:38 EST
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.
Comment 1 Michael Valenta CLA 2006-01-21 21:28:03 EST
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).
Comment 2 Michael Valenta CLA 2006-01-21 21:54:51 EST
Created attachment 33434 [details]
Modified Add and Remove to take a TreePath
Comment 3 Michael Valenta CLA 2006-02-05 21:33:17 EST
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).
Comment 4 Michael Valenta CLA 2006-02-06 15:22:02 EST
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).
Comment 5 Michael Valenta CLA 2006-02-06 20:37:41 EST
Created attachment 34254 [details]
Yet another patch

This latest installment has all the changes we discussed.
Comment 6 Michael Valenta CLA 2006-02-06 21:00:21 EST
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.
Comment 7 Boris Bokowski CLA 2006-02-06 22:19:30 EST
Thanks for the patch, Michael!
Released >20060206.
Comment 8 Boris Bokowski CLA 2006-02-14 17:21:06 EST
[I20060214-0800]

Verfied by looking at the code in the imported JFace plug-in.