Time for action – using a CSS property

At present the color of the hand is set in the constructor of the ClockWidget, and cannot be changed after creation. It would be better if the style of the widget could be controlled externally using the CSS that is used to style the application. This is handled with an ICSSPropertyHandler subclass from the org.eclipse.e4.ui.css.swt plug-in.

  1. Open the plugin.xml file from the com.packtpub.e4.clock.ui plug-in and switch to the Dependencies tab. Add the org.eclipse.e4.ui.css.swt and org.eclipse.e4.ui.css.core plug-ins to the list. To ensure that the bundle will work if these are missing, mark them both as Optional dependencies.
  2. Create a new package com.packtpub.e4.ui.internal.css to store the classes necessary ...

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.