Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » using image resources from other plugin in css
using image resources from other plugin in css [message #1745485] Tue, 11 October 2016 13:16 Go to next message
Wim Anckaert is currently offline Wim AnckaertFriend
Messages: 32
Registered: December 2012
Member
Hi,

The target of this exercise is according to the entrypoint we load different css file and in that css file we want to specify a background-image on a composite.
But the images are in another plugin than the plugin where the css is.

Full explanation
We have a workbench RAP application.

Our css is defined in the product plugin.
We have a lot of resources that are used in a regular plugin.

We want in our css refer to the resources in the regular plugin.
We can off course copy them all to the product plugin, but we don't like that Smile

But we have some images
For example:
We have resources in the product plugin which are used directly without registering them in plugin.xml

What are the steps we need to do?

I've tried the following:
1. alter css to :
background-image: url('platform:plugin/be.cs.fashion.awg.core/edition.png');
2.
background-image: url('edition.png');
and add it to the extension point
<extension
point="org.eclipse.equinox.http.registry.resources">
<resource
alias="/edition.png"
base-name="/resources/images/Edition-26.png">
</resource>

3. same as 2 but
<resource
alias="/edition.png"
base-name="/platform:plugin/be.cs.fashion.awg.core/resources/images/Edition-26.png">
</resource>


kind regards,
Wim
Re: using image resources from other plugin in css [message #1745510 is a reply to message #1745485] Tue, 11 October 2016 19:29 Go to previous messageGo to next message
Chris Fairhall is currently offline Chris FairhallFriend
Messages: 221
Registered: February 2011
Senior Member
Have you tried exporting the package that contains the images and importing it in the plugin that has the CSS?

It looks like the theme code that loads themes from extension points uses org.osgi.framework.Bundle.getEntry(String) to find background image files.


After reading the javadoc on getEntry again, it only looks at the bundle contents, not what the bundle can access via it's classloader.

[Updated on: Tue, 11 October 2016 19:40]

Report message to a moderator

Re: using image resources from other plugin in css [message #1745566 is a reply to message #1745510] Wed, 12 October 2016 14:38 Go to previous messageGo to next message
Wim Anckaert is currently offline Wim AnckaertFriend
Messages: 32
Registered: December 2012
Member
Hi,
I have tried it with exporting/importing the packages.

But as you define it in the updated post it is not possible to do so for now?
Are there any known workarounds?

Kind regards
Re: using image resources from other plugin in css [message #1745593 is a reply to message #1745566] Wed, 12 October 2016 20:46 Go to previous message
Chris Fairhall is currently offline Chris FairhallFriend
Messages: 221
Registered: February 2011
Senior Member
I supposed if you can get a hold of the org.eclipse.rap.rwt.application.Application instance the Workbench uses, you could call addStyleSheet yourself with your own ResourceLoader instead of using the extension point.

I don't there there is public API to find that instance though.

Either way you'd probably have to patch workbench plugin
Previous Topic:Focus bug in Internet Explorer?
Next Topic:RAP-application
Goto Forum:
  


Current Time: Thu Mar 28 11:11:19 GMT 2024

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

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

Back to the top