Project: Eclipse_Platform_UI
Bug 295803 [CommonNavigator] Source of Contribution set to lowest priority NCE, not the NCE providing the children
Reported: 2009-11-22 03:08:44 | Status: resolved fixed

If two NCEs are triggered on the same object they are processed in order of priority, both NCEs are asked to contribute children for a given parent. In the case where they both contribute the same object, the second one will be recorded as the "source of contribution" for the object. This happens for example for a resource where there are two NCEs defined, the resource (or perhaps Java NCE that overrides the resource NCE) and another one possibly related to an RCP app. The source of the contribution is important because it is used first to determine which NCE is going to be selected to provide the label. The first NCE that provides a label wins. In 3.4 the behavior was the opposite, the higher priority NCE provided the label. There was no mechanism for overriding the label provider in 3.4, and the label was also not provided with regard to the source of contribution, it just picked the highest priority NCE to start with (which is what you would expect, in the absence of overrides). There is a benefit of using the source of contribution to provide the label, but then the source of contribution should be set to the NCE that actually provide the objects, not a subsequent NCE. We should consider fixing this for 3.5.2, and of course we need to make sure and test all of the usual things that depend on the CNF. (DTP, WST, CDT)

Files changed in fix:
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/ContributorTrackingSet.java bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/NavigatorContentService.java bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/NavigatorContentServiceContentProvider.java bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/NavigatorPipelineService.java bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/extensions/NavigatorContentExtension.java bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/extensions/SafeDelegateTreeContentProvider.java bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/extensions/StructuredViewerManager.java tests/org.eclipse.ui.tests.navigator/src/org/eclipse/ui/tests/navigator/LabelProviderTest.java