Time for action – using layouts

Now that the ClockWidget has been created, multiple instances can be added into the ClockView.

  1. Modify the createPartControl method in the ClockView class to create three ClockWidget 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);
  2. Run the target Eclipse instance, and show the Clock View. Three clocks will be shown, counting in seconds:
    Time for action – using layouts
  3. At the start of the ClockView class's createPartControl method, create a new RowLayout with SWT.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.