Time for action – adding themes

Eclipse 4 ships with a theme manager which can be used to swap between themes (in essence, separate CSS files). The theme manager is available for inclusion in Eclipse 4-based applications by adding the org.eclipse.e4.ui.css.swt plug-in as a dependency to the application, and by adding one or more org.eclipse.e4.ui.css.swt.theme extension points.

  1. Add the org.eclipse.e4.ui.css.swt.theme plug-in to the Dependencies tab of the plugin.xml file of the com.packtpub.e4.application project.
  2. Go to the plugin.xml tab of the plugin.xml file (or edit the file as text) and add the following content to add blue and green themes:
    <extension point="org.eclipse.e4.ui.css.swt.theme"> <theme label="Blue Theme" id="com.packtpub.e4.ui.css.theme.blue" ...

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.