Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » accessing resources from other plugin in Application.e4xmi
accessing resources from other plugin in Application.e4xmi [message #1073978] Thu, 25 July 2013 22:02 Go to next message
Ralf Heydenreich is currently offline Ralf Heydenreich
Messages: 122
Registered: July 2009
Senior Member
Hi all,
I want to use an icon in my Application.e4xmi from an other plugin which
I've created. But if I write e.g.

platform:/plugin/de.my.own.resourcesplugin/icons/16/app_16.png

for Icon URI the Application editor complaints about "missing path". How
can I expose the icons from my plugin for others?

Thanks in advance,
Ralf.
Re: accessing resources from other plugin in Application.e4xmi [message #1073999 is a reply to message #1073978] Thu, 25 July 2013 23:01 Go to previous messageGo to next message
Joseph Carroll is currently offline Joseph Carroll
Messages: 174
Registered: May 2012
Location: Milwaukee, WI
Senior Member

You should be able to, though you should either have an explicit dependency on your resourcesplugin or have a way to handle missing images to avoid the ugly red square.

With that said, what is the exact error message you are getting?

JD
Re: accessing resources from other plugin in Application.e4xmi [message #1074025 is a reply to message #1073999] Fri, 26 July 2013 00:25 Go to previous messageGo to next message
Ralf Heydenreich is currently offline Ralf Heydenreich
Messages: 122
Registered: July 2009
Senior Member
Am 26.07.2013 01:01, schrieb Joseph Carroll:
> You should be able to, though you should either have an explicit
> dependency on your resourcesplugin or have a way to handle missing
> images to avoid the ugly red square.
>
> With that said, what is the exact error message you are getting?
>
> JD

Hi Joseph,
the exact message is "the system cannot find the path specified". What
I've now tried is to select the real path in my plugin in, i.e.

platform:/plugin/de.my.own.resourcesplugin/src/main/resources/icons/16/app_16.png

which is really ugly (but working!). If I build that plugin with Maven
(Tycho) than the correct structure is generated:. The resulting jar file
has the following directories (1st level):

<root>
/de
/icons
/META-INF
/OSGI-INF

How can I fix that?

Regards,
Ralf.
Re: accessing resources from other plugin in Application.e4xmi [message #1074183 is a reply to message #1074025] Fri, 26 July 2013 08:35 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas Schindl
Messages: 5351
Registered: July 2009
Senior Member
This directory is only available at dev-time and once you export your
project it won't be found.

The problem you have is a mismatch between your structure in eclipse
where icons are located in "src/main/resources/icons" and
runtime-classpath where it is "icons/...".

My wild guess is that if you start the application inside eclipse with
the path
"platform:/plugin/de.my.own.resourcesplugin/icons/16/app_16.png" it will
work although the tooling editor tells you the icon is not found (it
does not know about the classpath)!

Like in my other answer to your ResourceProvider problem I'd suggest you
move away from your maven story and put the icons into an icons folder
directly below your plugin dir.

So your layout in Eclipse looks like this:

de.my.own.resourcesplugin
src
de
....
icons

and add icons to your build.properties and let PDE manage your project
and maven-tycho build it.

Tom

On 26.07.13 02:31, Ralf Heydenreich wrote:
> Am 26.07.2013 01:01, schrieb Joseph Carroll:
>> You should be able to, though you should either have an explicit
>> dependency on your resourcesplugin or have a way to handle missing
>> images to avoid the ugly red square.
>>
>> With that said, what is the exact error message you are getting?
>>
>> JD
>
> Hi Joseph,
> the exact message is "the system cannot find the path specified". What
> I've now tried is to select the real path in my plugin in, i.e.
>
> platform:/plugin/de.my.own.resourcesplugin/src/main/resources/icons/16/app_16.png
>
> which is really ugly (but working!). If I build that plugin with Maven
> (Tycho) than the correct structure is generated:. The resulting jar file
> has the following directories (1st level):
>
> <root>
> /de
> /icons
> /META-INF
> /OSGI-INF
>
> How can I fix that?
>
> Regards,
> Ralf.
>
>
Re: accessing resources from other plugin in Application.e4xmi [message #1074368 is a reply to message #1074183] Fri, 26 July 2013 15:31 Go to previous message
Joseph Carroll is currently offline Joseph Carroll
Messages: 174
Registered: May 2012
Location: Milwaukee, WI
Senior Member

Couldn't have said it better.
Previous Topic:Accessing/updating UI elements in other Parts + best practices?
Next Topic:Eclipse Kepler Dependency Injection in 3.x & Views
Goto Forum:
  


Current Time: Thu Oct 02 12:33:40 GMT 2014

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

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