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).

  1. 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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.