Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 114991 - [CommonNavigator] CommonViewer won't load label provider first
Summary: [CommonNavigator] CommonViewer won't load label provider first
Status: RESOLVED DUPLICATE of bug 115218
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Michael D. Elder CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-03 16:11 EST by Michael Valenta CLA
Modified: 2005-11-13 17:37 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Valenta CLA 2005-11-03 16:11:19 EST
When finding a relevant content provider (or navigator content extension), the 
CommonViewer will not load content extensions that are not already loaded. The 
way I am using the view is this.

- I have a CommonViewer whose root objects are ModelProviders. 
- Each ModelProvider implementor can provide a navigatorContent for their 
instance of ModelProvider.
- I expected that adding a ModelProvider would automatically pick up the 
registered extension but it didn't because the viewer wouldn't load them.

What is the expected way this is supposed to work?

P.S. I got this to work by making the following change. Obviously not ideal 
but perhaps we just need a flag on the CommonViewer that clients can set if 
they would like the viwer to load extensions that have not been loaded yet.


Index: src-navigator/org/eclipse/ui/navigator/NavigatorContentService.java

 	public ILabelProvider[] findRelevantLabelProviders(Object anElement) {
-		NavigatorContentExtension[] resultInstances = 
findRelevantContentExtensions(anElement,false);
+		NavigatorContentExtension[] resultInstances = 
findRelevantContentExtensions(anElement,true);
Comment 1 Michael Valenta CLA 2005-11-03 17:09:46 EST
I'm upgrading this to major because, until I get the issue resolved somehow, I 
cannot release my code to HEAD.
Comment 2 Michael Valenta CLA 2005-11-08 16:38:03 EST
Sorry, I mistated the problem. The problem is that the label provider will not 
be loaded until the content provider is loaded. In my example, the root 
content provider returns a set of ModelProviders and expects other content 
providers to provide both the labels and the sub-content. When the label for 
the content provider is asked for, the NavigatorServiceExtension will not load 
the label provider. When I expand the modle provider, it works since that 
loads the content provider.

This may not be such a big issue considering that you are planning on 
separating the label provider and content provider.
Comment 3 Michael D. Elder CLA 2005-11-13 17:37:54 EST
I am marking this as a duplicate of the bug to bring back the memory mechanism. 

Please advise if bringing back the memory mechanism does not solve your problem.

*** This bug has been marked as a duplicate of 115218 ***