Theme for Eclipse Juno - Images [message #982836] |
Tue, 13 November 2012 13:05 |
|
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 13:48 |
Eclipse User |
|
|
|
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:
- As an OSGI resource relative to platform:/plugin/org.eclipse.platform/css/ (zoiks! how'd this get hard-coded in there!?)
- 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/.
- As a URL
- As a file path: the current directory usually is that holding the executable (e.g., .../Contents/MacOS/ for OSX)
- 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.
|
|
|
Powered by
FUDForum. Page generated in 0.03903 seconds