GridLayout lays out the control children of a Composite in a grid. GridLayout has a number of configuration fields, and the controls it lays out can have an associated layout data object, called GridData. The power of GridLayout lies in the ability to configure GridData for each control in the layout. The numColumns field is the most important field in a GridLayout. Widgets are laid out in columns from left to right, and a new row is created when numColumns + 1 controls are added to the Composite.

Main Features

  • Select GridLayout from the Layouts palette and drop it on a Window or Composite

image

  • Graphical feedback is provided for all column, row and cell interactions

  • Column and row properties may be changed via a popup menu

  • Convert existing layouts (null, FormLayout, etc.) to GridLayout with intelligent column and row creation

image image

Popup Header Menu

  • Right-click on the header area to access the popup header menu

image image

  • Delete entire columns or rows

  • Set the column alignment to left, center, right or fill

  • Set the row alignment to top, center, bottom or fill

  • Specify that the column or row should grab any excess space

Graphical Feedback

  • When moving a widget or adding a new widget, open cells are highlighted green while populated cells are highlighted red and insertion points are highlighted in yellow

image image image

  • Phantom drop point to the right and below the current cells will create new columns, rows and gaps as needed

image image

  • The currently selected cell shows its column and row spanning handles, sizing handles and alignment handles

image

  • Set the alignment of a cell using its popup alignment menu or the toolbar

image

image image

  • Set the grab property by right-clicking (or double-clicking) on a column or row

image image

  • Width and height sizing handles make it easy to set the size of a widget

image image

  • Right-click a widget to set is horizontal or vertical alignment values, grab property or to clear its width or height hint

image

  • Reorder columns and rows by dragging them (with their associated gap columns or rows)

image image image

  • Column and rows borders are indicated with gray lines

image

  • Interactive column and row spanning feedback is provided

image image

  • Full keyboard support for quickly changing alignment values

Cells

F

fill horizontal

Shift+F

fill vertical

H

grow horizontal

V

grow vertical

L, C, R

left/center/right for horizontal

T, M, B

top/middle/bottom for vertical

Cell Editing

  • Floating layout assistant image

image image

  • Edit individual layout data properties for each widget in the Property Pane.

image

Preferences

  • Control whether automatic grab is used for text widgets, comboboxes, tables, etc.

image image

  • Control whether labels are automatically right-aligned when next to a text widget

image image

Source Code Generation & Parsing

  • Intelligently convert existing layouts (null, FormLayout, etc.) to GridLayout with column and row creation

  • Parser can understand long or short constructor style for GridData

image