Time for action – styling the UI with CSS
Eclipse 4 user interfaces are styled with CSS. Although this is loosely based on the CSS syntax used by browsers, the stylesheet is interpreted by the Eclipse 4 runtime. CSS stylesheets are composed of selectors and style rules: a selector can be one of a widget name (for example, Button
), a model class name (for example, .MPartStack
), or an identifier (for example, #PerspectiveSwitcher
).
- The default Eclipse 4 application with sample content (generated by the wizard in Chapter 7, Creating an E4 Application, will have an empty CSS file called
css/default.css
. Open this file, and add the following rule:Shell { background-color: blue; }
Tip
The File | New | Plug-in Project menu can be used to create a new plug-in ...
Get Eclipse Plug-in Development Beginner's Guide - Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.