Time for action – modal and other effects

There are a number of style bits that are applicable to windows, and some useful methods to affect how the window appears. For example, it might be desirable to make the clock appear semi-transparent, which allows the clock to float above other windows. SWT's Shell has a number of these options that can be set.

  1. Modify the instantiation of the Shell inside the widgetSelected method in the Activator inner class to add SWT.NO_TRIM (no close/minimise/maximise widgets) and SWT.ON_TOP (floating on top of other windows):
    shell = new Shell(trayItem.getDisplay(), SWT.NO_TRIM | SWT.ON_TOP);
  2. Set the alpha value as 128, which is semi-transparent:
    shell.setAlpha(128);
  3. Run the target Eclipse instance, and click on the

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.