Time for action – using layouts
Now that the ClockWidget
has been created, multiple instances can be added into the ClockView
.
- Modify the
createPartControl
method in theClockView
class to create threeClockWidget
instances, and assign them to local variables:final ClockWidget clock1 = new ClockWidget(parent, SWT.NONE); final ClockWidget clock2 = new ClockWidget(parent, SWT.NONE); final ClockWidget clock3 = new ClockWidget(parent, SWT.NONE);
- Run the target Eclipse instance, and show the Clock View. Three clocks will be shown, counting in seconds:
- At the start of the
ClockView
class'screatePartControl
method, create a newRowLayout
withSWT.HORIZONTAL ...
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.