Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » 3.x plugins provided with the support of CSS in Eclipse 4?(3.x plugin CSS Eclipse 4)
icon5.gif  3.x plugins provided with the support of CSS in Eclipse 4? [message #886454] Fri, 15 June 2012 00:42 Go to next message
Robin Hamster is currently offline Robin HamsterFriend
Messages: 2
Registered: June 2012
Junior Member
Hi,everyone here.I just begin to migrate my 3.x plugins onto Eclipse 4. I just wonder how my old 3.x plugins can have the ability to modify its theme with the aid of CSS provided by Eclipse 4. THX.
Re: 3.x plugins provided with the support of CSS in Eclipse 4? [message #886658 is a reply to message #886454] Fri, 15 June 2012 11:33 Go to previous messageGo to next message
Brian de Alwis is currently offline Brian de AlwisFriend
Messages: 242
Registered: July 2009
Senior Member
It should work for you. The CSS support should be installable into 3.7 and 3.8, as well as 4.2.

Brian.
Re: 3.x plugins provided with the support of CSS in Eclipse 4? [message #886736 is a reply to message #886658] Fri, 15 June 2012 14:48 Go to previous messageGo to next message
Robin Hamster is currently offline Robin HamsterFriend
Messages: 2
Registered: June 2012
Junior Member
My plugin was developed with Eclipse 3.6.2. Then is it possible to add CSS to that plugin. And the most important is HOW. Just add some extension and a CSS file? Need to change any structure of my old plugin?
Re: 3.x plugins provided with the support of CSS in Eclipse 4? [message #886842 is a reply to message #886736] Fri, 15 June 2012 18:03 Go to previous message
Brian de Alwis is currently offline Brian de AlwisFriend
Messages: 242
Registered: July 2009
Senior Member
First off, the CSS support is unlikely to work under 3.6. I haven't tried it, and I'm pretty sure the required SWT changes only landed in 3.7. But your plugin should be able to be installed in 3.7 and 4.2. The CSS support is provided in three bundles: org.eclipse.e4.ui.css.core, org.eclipse.e4.ui.css.swt, and org.eclipse.e4.ui.css.swt.theme. There isn't a feature for them, so you'll either need to install them using the p2 director or checking out the source.

Our CSS support treats a window and it's contents as its document object model. So providing your plugin uses standard SWT controls, then styling rules may be applied to it without you're needing to do anything.

As to how to supply your own CSS... There's four ways:

1. Launch Eclipse with -applicationCSS path/to/file. This only works under 4.2.
2. Install the CSS Editor and customize the CSS in Preferences > General > Appearance. The CSS Editor is available from the update site at http://download.eclipse.org/e4/updates/0.12-I-builds under E4 Tools. This only works under 4.2 too.
3. Provide your own CSS-based theme using the org.eclipse.e4.ui.css.swt.theme extension point. On 4.2 this will appear in Preferences > General > Appearance. You'll need to trigger the theme change programmatically under 3.7 and 3.8 though.
4. Programmatically obtain the CSSEngine and provide a style sheet. See the applyCSS() method for an example at http://git.eclipse.org/c/e4/org.eclipse.e4.tools.git/tree/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/CSSScratchPadWindow.java

The easiest thing is to download the 4.2RC4 build at http://download.eclipse.org/eclipse/downloads/drops4 and give it a try.
Previous Topic:Eclipse plugins for Eclipse 4
Next Topic:Menues not shown in wizard generated e4 application
Goto Forum:
  


Current Time: Fri Mar 29 07:17:24 GMT 2024

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

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

Back to the top