CSS Theming for Eclipse RCP 3.x
Join the DZone community and get the full member experience.
Join For FreeEclipse 4.0 brought a great new feature: Theming RCP applications with CSS. Another good news is, this cool feature can also be used with RCP 3.x based applications. The following screen shot shows the RCP Mail Demo, styled with CSS:
How to run the Demo with CSS styling?
- Checkout :pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse/e4/releng
- Import Project Set /releng/org.eclipse.e4.ui.releng/e4.ui.css.psf
- Checkout e4/org.eclipse.e4.ui/bundles/org.eclipse.e4.ui.widgets (see bug 322641)
- Cleanup org.eclipse.e4.ui.css.swt (see bug 322644)
=> Organize Imports
=> Delete dependencies to org.eclipse.e4.core.* - Start the CSS RCP Mail demo (project org.eclipse.e4.ui.examples.css.rcp)
The demo also provides dynamic theme switching. Here is is little excerpt from the defaul.css styling:
CTabItem, Label, Tree, Text {
font-family: "Arial";
}
Shell {
font-size: 12;
}
CTabItem, ToolBar, Button, CBanner, CoolBar {
font-size: 9;
background-color: white;
}
CTabFolder, CTabItem {
background-color: #F0F1F7;
}
If you would like to play around with the css, just edit the files css/default.css and css/colorful.css in the project org.eclipse.e4.ui.examples.css.rcp. I have submitted a short talk at Eclipse Summit Europe to explain a few more details.
Have Fun!
Opinions expressed by DZone contributors are their own.
Trending
-
Five Java Books Beginners and Professionals Should Read
-
Observability Architecture: Financial Payments Introduction
-
A Complete Guide to Agile Software Development
-
Understanding Data Compaction in 3 Minutes
Comments