Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Re: Where to put a Swing-specific jar to be accessible by a running plugin using SWT_SWING component
Re: Where to put a Swing-specific jar to be accessible by a running plugin using SWT_SWING component [message #448015] Thu, 23 December 2004 22:55 Go to next message
Eclipse UserFriend
Originally posted by: no.ddress.here

In article <cqf12p$9cr$1@www.eclipse.org>, ifedorenko@rogers.com says...
> Gerald B. Rosenberg wrote:
> > In article <MPG.1c2fa704e07eb88f98968a@news.eclipse.org>, no@ddress.here
> > says...
> >
> >>I have developed a plugin that embeds some Swing UI components in SWT in
> >>an otherwise standard Eclipse view. The Swing UI components have a
> >>dependency on the JGoodies looks.jar.
> >>
> >>The question is, where is the "correct" place to put the looks.jar to be
> >>accessible to the plugin when installed as a normal plugin. Note, no
> >>problem in developing the plugin - identifying the dependency in
> >>plugin.xml works. Its just when my plugin (including a copy of the
> >>looks.jar) is installed in the .../eclipse/plugins directory, the jar is
> >>not found; the plugin fails with a ComponentUI reference not found error
> >>- the necessary component UIs being in the looks.jar.
> >>
> >>So, putting the jar in my plugin directory (in the same relative
> >>location as used in development) does not work. Putting the looks.jar
> >>on either the system or user CLASSPATH does not work. Putting the jar
> >>in the Eclipse home directory does not work.
> >>
> >>The only location that I have found that works is the .../jre/lib/ext
> >>directory of the SDK that Eclipse is using.
> >>
> >>Is there a better place/way to provide the looks.jar as part of my
> >>plugin?
> >>
> >>Eclipse 3.1M3, SDK1.4.2, XP.
> >>
> >>Thanks,
> >>Gerald
> >>
> >
> >
> > Any thoughts on this would be appreciated.
>
> Each eclipse plugin has its own classloader that "sees" classes from
> plugin's "run time libraries" as well as from required plugins. That
> means that at least you need to add the looks.jar to runtime section of
> plugin.xml (or Bundle-ClassPath elntry of manifest.mf).

Thanks very much for the response.

I do have the looks.jar listed in the "Run-time libraries" list. And, it
does then show up in the MANIFEST.MF as

Bundle-ClassPath: JDocEditor.jar, log4j-1.2.8.jar, looks-1.2.2.jar

> I am not swing
> expert but I guess that you also need to set thread context classloader
> to your plugin classloader for swing libs to see looks.jar.

Not sure how or where to do something like this. Not even sure where to
begin. Any chance you could provide a bit more explanation?

Thanks,
Gerald


(Cross-posting to the swt forum just in case this is more of a swt/swing
issue than a plugin/platform issue)
Re: Where to put a Swing-specific jar to be accessible by a running plugin using SWT_SWING component [message #448020 is a reply to message #448015] Fri, 24 December 2004 06:57 Go to previous messageGo to next message
Igor Fedorenko is currently offline Igor FedorenkoFriend
Messages: 14
Registered: July 2009
Junior Member
This wiki page might help: http://eclipsewiki.editme.com/PDEFaq#context


Gerald B. Rosenberg wrote:
> In article <cqf12p$9cr$1@www.eclipse.org>, ifedorenko@rogers.com says...
>
>>Gerald B. Rosenberg wrote:
>>
>>>In article <MPG.1c2fa704e07eb88f98968a@news.eclipse.org>, no@ddress.here
>>>says...
>>>
>>>
>>>>I have developed a plugin that embeds some Swing UI components in SWT in
>>>>an otherwise standard Eclipse view. The Swing UI components have a
>>>>dependency on the JGoodies looks.jar.
>>>>
>>>>The question is, where is the "correct" place to put the looks.jar to be
>>>>accessible to the plugin when installed as a normal plugin. Note, no
>>>>problem in developing the plugin - identifying the dependency in
>>>>plugin.xml works. Its just when my plugin (including a copy of the
>>>>looks.jar) is installed in the .../eclipse/plugins directory, the jar is
>>>>not found; the plugin fails with a ComponentUI reference not found error
>>>>- the necessary component UIs being in the looks.jar.
>>>>
>>>>So, putting the jar in my plugin directory (in the same relative
>>>>location as used in development) does not work. Putting the looks.jar
>>>>on either the system or user CLASSPATH does not work. Putting the jar
>>>>in the Eclipse home directory does not work.
>>>>
>>>>The only location that I have found that works is the .../jre/lib/ext
>>>>directory of the SDK that Eclipse is using.
>>>>
>>>>Is there a better place/way to provide the looks.jar as part of my
>>>>plugin?
>>>>
>>>>Eclipse 3.1M3, SDK1.4.2, XP.
>>>>
>>>>Thanks,
>>>>Gerald
>>>>
>>>
>>>
>>>Any thoughts on this would be appreciated.
>>
>>Each eclipse plugin has its own classloader that "sees" classes from
>>plugin's "run time libraries" as well as from required plugins. That
>>means that at least you need to add the looks.jar to runtime section of
>>plugin.xml (or Bundle-ClassPath elntry of manifest.mf).
>
>
> Thanks very much for the response.
>
> I do have the looks.jar listed in the "Run-time libraries" list. And, it
> does then show up in the MANIFEST.MF as
>
> Bundle-ClassPath: JDocEditor.jar, log4j-1.2.8.jar, looks-1.2.2.jar
>
>
>>I am not swing
>>expert but I guess that you also need to set thread context classloader
>>to your plugin classloader for swing libs to see looks.jar.
>
>
> Not sure how or where to do something like this. Not even sure where to
> begin. Any chance you could provide a bit more explanation?
>
Re: Where to put a Swing-specific jar to be accessible by a running plugin using [message #448472 is a reply to message #448015] Mon, 10 January 2005 19:10 Go to previous message
Philip Borlin is currently offline Philip BorlinFriend
Messages: 17
Registered: July 2009
Junior Member
Gerald B. Rosenberg wrote:

>> >>The question is, where is the "correct" place to put the looks.jar to be
>> >>accessible to the plugin when installed as a normal plugin. Note, no
>> >>problem in developing the plugin - identifying the dependency in
>> >>plugin.xml works. Its just when my plugin (including a copy of the
>> >>looks.jar) is installed in the .../eclipse/plugins directory, the jar is
>> >>not found; the plugin fails with a ComponentUI reference not found error
>> >>- the necessary component UIs being in the looks.jar.

This is a classloader problem. Try this line:

UIManager.put("ClassLoader", getClass().getClassLoader());

Basically Swing is trying to use a classloader that doesn't know about
Eclipse. I put this line in the preWindowOpen() method of my
WorkbenchAdvisor subclass and everything works great. If you aren't using
RCP then put this as close to application startup as possible making sure
that you are in a class that got loaded by Eclipse.
Previous Topic:Combo processing
Next Topic:incremental search
Goto Forum:
  


Current Time: Sat Oct 31 07:49:04 GMT 2020

Powered by FUDForum. Page generated in 0.01390 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top