Community
Participate
Working Groups
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);
I'm upgrading this to major because, until I get the issue resolved somehow, I cannot release my code to HEAD.
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.
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 ***