facebook

AdapterFactory [Closed]

  1. MyEclipse Archived
  2.  > 
  3. UML Development
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #234363 Reply

    sonofseven
    Member

    Hi,
    In my RCP I have IAdapterFactory implementation that provides adapters for my UI Elements.
    Whan I register it by hand like this:

    IAdapterManager mgr = Platform.getAdapterManager();
    myfact = new MyAdapterFactory();
    mgr.registerAdapters(myfact , MyElement1.class);
    mgr.registerAdapters(myfact , MyElement2.class);

    and then have a view that after selecting an element the Properties View use the proper adapter to show the properties.

    But whan I register the factory using plugin.xml file the factory does not work for IPropertySource.

    <extension
    point=”org.eclipse.core.runtime.adapters”>
    <factory
    adaptableType=”MyElement1″
    class=”MyAdapterFactory”>
    <adapter type=”org.eclipse.ui.views.IPropertySource”/>
    <adapter type=”org.eclipse.ui.model.IWorkbenchAdapter”/>
    </factory>
    </extension>

    getAdapterList of MyAdapterFactory returns array
    private static final Class[] ADAPTER_LIST = {
    IWorkbenchAdapter.class,
    IPropertySource.class };

    In fact when I use plugin.xml the only way I can get the Properties View to show info about my Element is to override getAdapter and return the MyElementPropertySource.

    Is this a problem of Eclipse of MyEclipse?

    /rp

    #234402 Reply

    Scott Anderson
    Participant

    rp,

    Is this a problem of Eclipse of MyEclipse?

    It’s likely a difference in what you expect to happen and how Eclipse implements it. To find out for sure, update your runtime PDE launch configuration to *only* launch with the Eclipse plugins, not any MyEclipse plugins. Does it operate as you expect in that configuration?

    #234422 Reply

    sonofseven
    Member

    ok, this is me being an arse
    the problem is with adapter type org.eclipse.ui.views.IPropertySource
    it should be org.eclipse.ui.views.properties.IPropertySource

    I got misslead by the example on the eclipse homepage which must be referring to the old version of eclipse.

    sorry to waist your time
    /rp

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: AdapterFactory [Closed]

You must be logged in to post in the forum log in