[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[news.eclipse.tools] Re: How can I pre-req an Optional plugin?
|
I would do it like this:
// first get plugin A by it's id (should be it's folder name?)
Plugin aPlugin= org.eclipse.core.runtime.Platform.getPlugin(String
pluginID);
if (aPlugin == null) return; // plugin A not installed
ClassLoader loader= aPlugin.getDescriptor().getPluginClassLoader();
Class aClass= loader.loadClass(myClassName);
mfg feser aka peter paul amhof
"Randy Hudson" <none@xxxxxxx> schrieb im Newsbeitrag
news:9noceg$9om$1@xxxxxxxxxxxxxxxx
> How can I have Plugin B pre-req Plugin A, but also no care if Plugin A is
> not installed. For example, we are trying to dynamically find a class by
> using Class.forName("foo") to see if a class from Plugin A is around. If
it
> is, great, and we will then instantiate that class foo. If not, we don't
> care.
>
> Currently Plugin B is getting deactiviated if Plugin A is not found.
>
>