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-transparently, which allows the clock to float above other windows. SWT's Shell
has a number of these options that can be set.
Modify the instantiation of the
Shell
inside thewidgetSelected()
method in theActivator
class's inner class to addSWT.NO_TRIM
(no close/minimize/maximize widgets) andSWT.ON_TOP
(floating on top of other windows):shell = new Shell(trayItem.getDisplay(),SWT.NO_TRIM|SWT.ON_TOP);
Set the alpha value as
128
, which is semi-transparent:shell.setAlpha(128);
Run the Eclipse instance, and click on the tray item to see what kind of window is created.
To create a modal window (and thus, prevent interaction on the main window), change the flag to use
SWT.APPLICATION_MODAL
:shell = new Shell(trayItem.getDisplay(),SWT.APPLICATION_MODAL);
To make the application...