Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 343477

Summary: [CommonNavigator] ProjectExplorer property sheet adapter factory is incorrectly declared
Product: [Eclipse Project] Platform Reporter: Francis Upton IV <francisu>
Component: UIAssignee: Francis Upton IV <francisu>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, kerstin.simonsson
Version: 3.6   
Target Milestone: 3.7 M7   
Hardware: All   
OS: All   
Whiteboard:

Description Francis Upton IV CLA 2011-04-21 02:25:39 EDT
Similar problem with tabbed property sheet and common navigator. 
We have also created a custom common navigator and enabled the use of a tabbed
property sheet extension.

It worked fine in 3.4.x, but when using 3.6.0 the tabbed property sheet failed
to load. Traced to the code below:

public class TabbedPropertySheetAdapterFactory
    implements IAdapterFactory {

    /*
     * (non-Javadoc)
     * 
     * @see
org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object,
     *      java.lang.Class)
     */
    public Object getAdapter(Object adaptableObject, Class adapterType) {
        if (adaptableObject instanceof ProjectExplorer) {
            if (IPropertySheetPage.class == adapterType)
                return new TabbedPropertySheetPage(
                    new TabbedPropertySheetProjectExplorerContributor(
                        (CommonNavigator) adaptableObject));
        }
        return null;
    }

The #getAdapter() will always return null for my CommonNavigator.
Comment 1 Francis Upton IV CLA 2011-04-21 02:27:22 EDT
This was reported as part of bug 310721 but was really not related to that. Moving to its own bug.
Comment 2 Francis Upton IV CLA 2011-04-21 02:41:21 EDT
In the plugin.xml for o.e.ui.navigator.resources the adaptableType is set to CommonNavigator. It should be ProjectExplorer which might be causing this problem for you.

Also, make sure you have your own adapter registered for your own subclass of CommonNavigator. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=304393#c1
Comment 3 Francis Upton IV CLA 2011-04-21 02:43:08 EDT
Released to HEAD 3.7M7