Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Theme for Eclipse Juno - Images
Theme for Eclipse Juno - Images [message #982836] Tue, 13 November 2012 08:05 Go to next message
Martin Lange is currently offline Martin Lange
Messages: 16
Registered: May 2010
Location: Munich, Germany
Junior Member

Hi,

I'm currently try to create my own theme for Eclipse Juno. For that I'd like to change the drag-handle-image for draggable controls.

I have created an plugin project 'org.mlange.theme' added a folder 'images' and put my images in that folder.

In CSS for my theme I wrote:

...
.MToolControl.Draggable 
{
	handle-image: url("./images/dragHandle.png");
}
...


Unfortunately it is not working. How do I have to specify the url for my image?

Many thanks!

Best,
Martin
Re: Theme for Eclipse Juno - Images [message #986015 is a reply to message #982836] Sat, 17 November 2012 08:48 Go to previous message
Brian de Alwis is currently offline Brian de Alwis
Messages: 163
Registered: January 2012
Senior Member

So your dragHandle.png isn't being found as it's likely in a bundle that's not on the search path. URLs in the CSS files are resolved from the following places:

  1. As an OSGI resource relative to platform:/plugin/org.eclipse.platform/css/ (zoiks! how'd this get hard-coded in there!?)
  2. As an OSGi resource relative to the location specified in the "applicationCSSResources": this property is either specified on the command-line, as a System property, or as a product property. The Eclipse IDE product specifies its applicationCSSResources = platform:/plugin/org.eclipse.platform/images/.
  3. As a URL
  4. As a file path: the current directory usually is that holding the executable (e.g., .../Contents/MacOS/ for OSX)
  5. Plus any resource locators registered with a stylesheet (which should be but doesn't seem to be theme-specific unfortunately).


You have two choices:

  • Associate a resource locator with a stylesheet. Individual stylesheets can contribute their own URI bases for resolving resources via the "osgiresourcelocator" element on org.eclipse.e4.css.swt.theme/stylesheet. And a stylesheet can be contributed to a theme (see the "themeid" element on org.eclipse.e4.css.swt.theme/stylesheet).
  • Specify your image using a full URL like platform:/plugin/xxxx/images/dragHandle.png. This is likely the easiest solution.



Brian.


Eclipse Platform committer. Ask me about Eclipse support, training, and consulting.
Previous Topic:How can I check if a part is active and has the focus?
Next Topic:Force to access contributor immediately, after setting the ContributorURI?
Goto Forum:
  


Current Time: Wed Jul 23 22:25:23 EDT 2014

Powered by FUDForum. Page generated in 0.02143 seconds