Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsHow to activate plugin providing an IAdapterFactory?
https://www.eclipse.org/forums/index.php/mv/msg/678391/1277962/#msg_1277962
I have a plugin which just is intended to provide an IAdapterFactory. So
I registered the factory. But when requesting the desired adapter always
null is returned. While debugging I found out that, on the one hand
side, the AdapterManager (in the getFactories method) correctly finds
the adapter type. But, on the other hand side, an AdapterFactoryProxy is
used. And the AdapterFactoryProxy checks if the plugin containing my
AdapterFactory is loaded. Unfortunately, my plugin is resolved and not
active and, thus, my AdapterFactory is not used und null is returned.
How can I achieve to get my AdapterFactory be loaded and used? Attached
you can find my manifest, my plugin.xml and my AdapterFactory.
MyAdapterFactory.java
=====================
public class MyAdapterFactory implements IAdapterFactory {
@Override
public Object getAdapter(Object adaptableObject,
@SuppressWarnings("rawtypes") Class adapterType) {
if(adapterType.equals(AdapterTarget.class) && adaptableObject
instanceof ITextEditor){
return new AdapterTarget();
}
}
return null;
}
@SuppressWarnings("rawtypes")
@Override
public Class[] getAdapterList() {
return new Class[] { AdapterTarget.class };
}
}]]>Jan Reimann2014-03-26T18:10:16-00:00Re: How to activate plugin providing an IAdapterFactory?
https://www.eclipse.org/forums/index.php/mv/msg/678391/1278373/#msg_1278373
Jan Reimann2014-03-27T08:39:38-00:00Re: How to activate plugin providing an IAdapterFactory?
https://www.eclipse.org/forums/index.php/mv/msg/678391/1289353/#msg_1289353
To force the load of a class, you can use the "org.eclipse.ui.startup" extension point.