Menu

ManualCustomLayout

Remo

Customizing Layout

The layout of the forms is defined in your form in the createUI() method.
You can either define the layout yourself using standard swt techniques or you can use the Builder(s) delivered with RCPForms;
currently there is a GridBuilder defined which uses a GridLayout.

Two scenarios are supported by the builder:

  • grid data is created by passing additional information in the add..() method of the builder when you add your control
  • for compounds a special layout mechanism exists (see below)

The builder uses a Form toolkit to create the swt widgets from the RCP widget wrappers and a layout factory to create the grid data from
the information passed in the add method.

Examples

Setting label standard alignment

  • create a subclass of GridLayoutFactory
  • overwrite the label layout method

    public GridData getLabelLayoutData(final int verticalSpan)
    {
      GridData data = super.getLabelLayoutData(verticalSpan);
      gridData.horizontalAlignment = SWT.BEGINNING;
      return gridData;
    }
    
  • create the GridBuilder passing your modified layout factory and standard toolkit and start adding controls


Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.