Time for action – adding the clock
To add the clock to the Eclipse 4 application, a new part will be added which has a ClockWidget
as its only content.
- To use the
ClockWidget
in a different plug-in, the package needs to be exported. Open theMANIFEST.MF
from thecom.packtpub.e4.clock.ui
project, and on the Runtime tab, click on Add to add thecom.packtpub.e4.clock.ui
package to the list of Exported Packages. - Create a new class called
ClockPart
in thecom.packtpub.e4.application.parts
package. - Add a
create
method with a@PostConstruct
annotation that takes aComposite parent
argument. - In the body of the
create
method, instantiate a newClockWidget
instance with argumentsparent
,SWT.NONE
, andnew RGB(255,0,0)
. This will require that thecom.packtpub.e4.clock.ui ...
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.