[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.platform] Re: IAdapterFactory vs. adapters extension

Alex Blewitt wrote:
I think they're two ways of doing the same thing. You shouldn't have to do them twice; in fact, I'd expect one to override the other.

I use the IAdapterFactory for registering UI components with non-UI components where a direct dependency wouldn't be possible, and I don't have to list the types in the plugin.xml. In fact, I don't list them in the plugin.xml at all; I hook them in when the plugin starts up using the <code>PlatformManager.getAdapterManager().registerAdapters()</code> call.

The plugin stuff is probably there if you want to do it that way yourself, but you can do it either way.

Alex.

<a href="http://cvs.sourceforge.net/viewcvs.py/rcpapps/org.rcpapps.rcpnews.ui/Source/Java/org/rcpapps/rcpnews/ui/RCPNewsUIPlugin.java?view=markup";>RCPNewsUIPlugin.java</a>

Thanks for your answer. So there's no black magic behind this (that's what I was afraid of :). It just seemed irritating to me that there is no way of NOT specifying the adapter type list twice when registering the factory class in plugin.xml. I can't omit the method because it's part of the interface; and when I tried to omit the adapter type list in plugin.xml, I got an error message to the console telling me that the extension point was malformed.


Regards,
M