Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 343477 - [CommonNavigator] ProjectExplorer property sheet adapter factory is incorrectly declared
Summary: [CommonNavigator] ProjectExplorer property sheet adapter factory is incorrect...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.7 M7   Edit
Assignee: Francis Upton IV CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-21 02:25 EDT by Francis Upton IV CLA
Modified: 2011-05-02 05:13 EDT (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 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