Problem finding plugin location. [message #256439] |
Mon, 28 June 2004 14:14  |
Eclipse User |
|
|
|
Originally posted by: dave_gray.versata.com
I am building a plugin that will handle some background utilities. The
plugin will have a directory of property files outside of the plugin jar.
I need to be able to query the plugin to find the path to these files.
I have tried through the plugin's bundle:
Platform.getBundle("my.bundle.symbolicName").getLocation()
I have tried with deprecated methods:
((PluginDescriptor)MyPlugin.getDefault()
.getDescriptor()).getInstallURL()
Both produce NPEs. My impression was that these calls should load the
plugin if not already loaded.
Can anyone help?
Dave
|
|
|
|
|
|
Re: Problem finding plugin location. [message #256726 is a reply to message #256676] |
Tue, 29 June 2004 12:34   |
Eclipse User |
|
|
|
Originally posted by: dave_gray.xxxxx.versata.com
After playing around a bit I think my problem is understanding how actions
in a non-UI related plugin are triggered. If I put code in a simple plugin
that has a visual component - view, button, or menu itme, and then have
that (show view, or click item) trigger the action, I can find the info
from the resource bundle or plugin that I want.
If instead have a plugin with no UI component, how do I trigger actions? I
have been trying to just call methods in classes in the plugin jar. I
assumed from what I had read that this would load my "utility" plugin and
make the information available. This does not work and I am not sure what
else I need to do.
Jeff, to answer your question more exactly: I have installed my plugin in
the ../plugins directory and see it in the list in the "about" box. I am
then just calling methods from a java class that I code and run in Eclipse.
Dave
Jeff McAffer wrote:
> There must be something strange about how your system is starting up. If
> PlatformAdmin is not available then the system pretty much will not run. Is
> there anything in your log? Are you doing this code very early (i.e., where
> is your code running?)
> Jeff
> "Dave" <dave_gray@xxxx.versata.com> wrote in message
> news:cbroo7$f2d$1@eclipse.org...
> > Platform.getBundle("my.bundle.symbolicName") calls
> > InternalPlatform.getDefault().getBundle(symbolicName) which calls
> > packageAdmin.getBundles(symbolicName, null) where packageAdmin is a field
> > of InternalPlatform.
> >
> > Problem is that packageAdmin is null. The InternalPlatform singleton
> > instance is not null but most of its fields are. Seems like the plugin has
> > not yet been initialized. Is my call to a class in the plugin jar not
> > causing the plugin to be intialized and loaded? How can I ensure that it
> > is?
> >
> > Dave
> >
> > Jeff McAffer wrote:
> >
> > > Try Platform.getBundle("my.bundle.symbolicName").getEntry() and friends.
> >
> > > You can use "/" or "" to get the root location of the bundle. Note that
> > > there are no guarantees as to the form of the returned URL. Bundles can
> be
> > > in jars, in the file system, on http servers, ...
> >
> > > Jeff
> >
> >
> > > "Dave Gray" <dave_gray@versata.com> wrote in message
> > > news:cbpn5r$a2v$1@eclipse.org...
> > > > I am building a plugin that will handle some background utilities. The
> > > > plugin will have a directory of property files outside of the plugin
> jar.
> > > > I need to be able to query the plugin to find the path to these files.
> > > >
> > > > I have tried through the plugin's bundle:
> > > >
> > > > Platform.getBundle("my.bundle.symbolicName").getLocation()
> > > >
> > > > I have tried with deprecated methods:
> > > >
> > > > ((PluginDescriptor)MyPlugin.getDefault()
> > > > .getDescriptor()).getInstallURL()
> > > >
> > > > Both produce NPEs. My impression was that these calls should load the
> > > > plugin if not already loaded.
> > > >
> > > > Can anyone help?
> > > >
> > > > Dave
> > > >
> >
> >
|
|
|
Re: Problem finding plugin location. [message #256933 is a reply to message #256726] |
Tue, 29 June 2004 21:48  |
Eclipse User |
|
|
|
Originally posted by: jeff_mcaffer.REMOVE.ca.ibm.com
It seems like this is a separate issue. The initial post was related to the
InternalPlatform object is not initialized correctly. If this were true then
really very little in Eclipse would work. Do you have any more information
on that? What happens if you put a breakpoint in
InternalPlatform.getPlatformAdmin()? Is the ServiceReference really coming
back null? If so, put a breakpoint in EclipseAdaptor.frameworkStart() where
the PlatformAdmin service is registered and confirm that it is getting
registered.
Jeff
"Dave" <dave_gray@xxxxx.versata.com> wrote in message
news:cbs5mu$ium$1@eclipse.org...
> After playing around a bit I think my problem is understanding how actions
> in a non-UI related plugin are triggered. If I put code in a simple plugin
> that has a visual component - view, button, or menu itme, and then have
> that (show view, or click item) trigger the action, I can find the info
> from the resource bundle or plugin that I want.
>
> If instead have a plugin with no UI component, how do I trigger actions? I
> have been trying to just call methods in classes in the plugin jar. I
> assumed from what I had read that this would load my "utility" plugin and
> make the information available. This does not work and I am not sure what
> else I need to do.
>
> Jeff, to answer your question more exactly: I have installed my plugin in
> the ../plugins directory and see it in the list in the "about" box. I am
> then just calling methods from a java class that I code and run in
Eclipse.
>
> Dave
>
> Jeff McAffer wrote:
>
> > There must be something strange about how your system is starting up.
If
> > PlatformAdmin is not available then the system pretty much will not run.
Is
> > there anything in your log? Are you doing this code very early (i.e.,
where
> > is your code running?)
>
> > Jeff
>
> > "Dave" <dave_gray@xxxx.versata.com> wrote in message
> > news:cbroo7$f2d$1@eclipse.org...
> > > Platform.getBundle("my.bundle.symbolicName") calls
> > > InternalPlatform.getDefault().getBundle(symbolicName) which calls
> > > packageAdmin.getBundles(symbolicName, null) where packageAdmin is a
field
> > > of InternalPlatform.
> > >
> > > Problem is that packageAdmin is null. The InternalPlatform singleton
> > > instance is not null but most of its fields are. Seems like the plugin
has
> > > not yet been initialized. Is my call to a class in the plugin jar not
> > > causing the plugin to be intialized and loaded? How can I ensure that
it
> > > is?
> > >
> > > Dave
> > >
> > > Jeff McAffer wrote:
> > >
> > > > Try Platform.getBundle("my.bundle.symbolicName").getEntry() and
friends.
> > >
> > > > You can use "/" or "" to get the root location of the bundle. Note
that
> > > > there are no guarantees as to the form of the returned URL. Bundles
can
> > be
> > > > in jars, in the file system, on http servers, ...
> > >
> > > > Jeff
> > >
> > >
> > > > "Dave Gray" <dave_gray@versata.com> wrote in message
> > > > news:cbpn5r$a2v$1@eclipse.org...
> > > > > I am building a plugin that will handle some background utilities.
The
> > > > > plugin will have a directory of property files outside of the
plugin
> > jar.
> > > > > I need to be able to query the plugin to find the path to these
files.
> > > > >
> > > > > I have tried through the plugin's bundle:
> > > > >
> > > > > Platform.getBundle("my.bundle.symbolicName").getLocation()
> > > > >
> > > > > I have tried with deprecated methods:
> > > > >
> > > > > ((PluginDescriptor)MyPlugin.getDefault()
> > > > > .getDescriptor()).getInstallURL()
> > > > >
> > > > > Both produce NPEs. My impression was that these calls should load
the
> > > > > plugin if not already loaded.
> > > > >
> > > > > Can anyone help?
> > > > >
> > > > > Dave
> > > > >
> > >
> > >
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03720 seconds