Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 115125 - [CommonNavigator] [arch] Should the labelProvider be treated as a first class extension?
Summary: [CommonNavigator] [arch] Should the labelProvider be treated as a first class...
Status: RESOLVED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Michael D. Elder CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-04 14:11 EST by Michael D. Elder CLA
Modified: 2006-01-22 23:30 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael D. Elder CLA 2005-11-04 14:11:14 EST
Currently the labelProvider is specified as part of the navigatorContent
extension point. There is no formal way to define only a label provider (that
would then override an existing label provider). Should the label provider be
made a first class extension, and what kind of semantics would be useful for the
override capability?

If there are no use cases identified for overriding label providers, then it
will remain as is. 

This would likely be an M5 item.
Comment 1 Nick Edgar CLA 2005-11-04 14:47:22 EST
I don't know of any use cases for overriding the label provider, but there may
be some from the older Rational generic navigator, as it allowed content
provider and label provider to be specified separately.

I like the simplicity of the current approach, but would like to avoid having to
match against the <expression> element for the label provider to be applied.  I
would expect any elements provided by the content provider of a navigator
extension to use that extension's label provider, regardless of <enablement>.

Comment 2 Michael Valenta CLA 2005-11-05 20:14:57 EST
It is interesting to note that, as Nick stated in bug 114940, it is actually 
the parent content provider that determines what the label of an item should 
be. As an example, consider a Java package in the Packages Explorer. In Flat 
mode when the package is a direct child of the source folder, the label should 
be the full package name. But, in heirarchy mode, when the parent is another 
package, the label is just the last package segment. 
Comment 3 Michael Valenta CLA 2005-11-21 09:25:18 EST
After some more playing around, I can see two cases here. 

  - The first is what has been described by Nick in comment 1 (i.e. the parent content provider determines the labels for it's children). This is definitly required in some cases. 

  - However, in some cases (probably most cases?), the parent is happy to allow the registered label provider provide the label and image.

I have hit the second case in my prototyping for the team operations. The Team framework throws one or more model providers into a view but is happy to let the extensions for those providers provide a label and image.

I think having a separate extension point for label provides helps here since the content provider can then choose whether to provide it's own label provider or use the one from the separate extension.
Comment 4 Michael D. Elder CLA 2006-01-22 23:30:23 EST
Without a specific use case that cannot be supported in some other way, I am closing this bugzilla as WONTFIX. 

The last case mentioned can be supported by a label provider that chooses to return null for items that it contributes to allow other extensions to jump in and provide a label. In general though, most clients I am aware of have a tight coupling between the label provider and content provider. JDT is particular tight on this point as the label provider requires the content provider in some cases to determine the correct label.