Optional dependency [message #325649] |
Mon, 25 February 2008 05:01  |
Eclipse User |
|
|
|
Originally posted by: s.larsen.danskebank.dk
My situation is this:
I have made a very important plugin (X), which uses a very unimportant
(statistics) plugin (Y).
I want the X-plugin to work, even if Y-plugin is not present.
In X-plugin I have defined an optional dependency to Y-plugin.
The X-plugin is calling the Y-plugin in a seperate thread.
This actually works - but not very nice.
If the Y-plugin is not available I get this error from org.eclipse.ui:
Failed to execute runnable (java.lang.NoClassDefFoundError: Y-plugin)
and the thread is terminated.
So... my question is:
How can I from X-plugin, check if Y-plugin is available, so that I handle
it and omit trying to instantiate Y-plugin?
Regards
Steen Larsen
|
|
|
Re: Optional dependency [message #325651 is a reply to message #325649] |
Mon, 25 February 2008 05:29  |
Eclipse User |
|
|
|
Hi,
I'd use Platform.getBundle("y") which will return null if the bundle
with this name is not found.
Tom
Steen Larsen schrieb:
> My situation is this:
>
> I have made a very important plugin (X), which uses a very unimportant
> (statistics) plugin (Y).
> I want the X-plugin to work, even if Y-plugin is not present.
>
> In X-plugin I have defined an optional dependency to Y-plugin.
> The X-plugin is calling the Y-plugin in a seperate thread.
>
> This actually works - but not very nice.
> If the Y-plugin is not available I get this error from org.eclipse.ui:
> Failed to execute runnable (java.lang.NoClassDefFoundError: Y-plugin)
> and the thread is terminated.
>
> So... my question is: How can I from X-plugin, check if Y-plugin is
> available, so that I handle it and omit trying to instantiate Y-plugin?
>
> Regards
> Steen Larsen
>
--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
|
|
|
Powered by
FUDForum. Page generated in 0.28892 seconds