1.0 Procedure:

 

This scenario will test out the features and behaviour of the Fill layout manager in a java project with the SWT libraries added.

 

FillLayout is the simplest layout class. It lays out widgets in a single row or column, forcing them to be the same size. Initially, the widgets will all be as tall as the tallest widget, and as wide as the widest.

 

FillLayout does not wrap, and you cannot specify margins or spacing. You might use it to lay out buttons in a task bar or tool bar, or to stack checkboxes in a Group. FillLayout can also be used when a Composite only has one child. For example, if a Shell has a single Group child, FillLayout will cause the Group to completely fill the Shell.

 

2.0 Setup:

 In a Java Project with the SWT library added, create a new Visual Class.

On to the canvas, drag and drop a Shell from the SWT drawer on the palette.

Then go to the Properties view and set the layout property to 'FillLayout'.
Verify that the layout for the Shell is ‘FillLayout’ in the Properties view and in the source view.

 

3.0 Basic Canvas Manipulation:

·        Default behaviour

Drop a number of SWT components on to the Shell and verify that the components are laid out on a single row horizontally and that they fill the Shell from top to bottom.

 

·        Customize Layout

Select the ‘Customize Layout’ button from the tool bar…

 

Select the ‘Vertical’ fill orientation, and verify that the components stack upon each other.

 

Verify that the fill orientation can be changed from with the source, switching from ‘HORIZONTAL’ to ‘VERTICAL’, and back again, in “fillLayout1.type = org.eclipse.swt.SWT.VERTICAL;”.

 

And, verify that this same action can be done from the Properties view as well.

 

Verify that the Spacing can be selected and changed.

 

 

And verify that these changes are reflected in the source and in the Properties view. Also, verify that these settings can be changed in the properties view and in the source as well.

 

 

 

 

·        Marquee selection

Verify that some or all of the SWT components on the Shell can be selected.

 

Select just one or two components and verify that selected components can be moved.

 

Verify that UNDO works as expected.

 

·        Changing to other SWT Layouts

Verify that other SWT layouts of ‘Null’, ‘FormLayout’, ‘GridLayout’ and ‘Rowlayout’ can be selected. And verify that it is possible to return to the FillLayout without loss of the code.

And verify that these layout changes can be done from the source.