O'Reilly logo

Eclipse 4 Plug-in Development by Example Beginner's Guide by Dr. Alex Blewitt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – styling the UI with CSS

The user interface for Eclipse 4 is styled with CSS. Although this is loosely based on the CSS syntax used in browsers, the content that can be used 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 generated by the wizard with sample content will have an empty CSS file called css/default.css. Open this file, and add the following rule:
    Shell {
      background-color: blue;
    }
  2. Run the application, and the background of the window (Shell) will be shown in blue.
  3. Basic CSS color ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required