public class Layouts extends Object
LayoutsFillLayout
,
LayoutsGridLayout
, LayoutsGridData
, LayoutsRowLayout
, and LayoutsRowData
.
SWT's layouts don't have consistent defaults for margin and spacing. All layouts created
by this class (via setFill(Composite)
, setGrid(Composite)
, and
setRow(Composite)
have all of their margins and spacing values set to
defaultMargin()
.
`FillLayout` only supports `marginHeight` and `marginWidth`, but `GridLayout` and
`RowLayout` also support `marginTop/Bottom/Left/Right`. These are additive - the margin on the
top side will be `marginHeight + marginTop`. When setting all margins at once using
LayoutWrapper.margin(int)
, height/width are set to the given value, and top/bottom/left/right are all
set to 0.
Modifier and Type | Method and Description |
---|---|
static int |
defaultMargin()
Returns the default margin for layouts.
|
static LayoutsFillLayout |
modifyFill(Composite composite)
Returns an API for modifying the already-existing FillLayout on the given Composite.
|
static LayoutsGridLayout |
modifyGrid(Composite composite)
Returns an API for modifying the already-existing GridLayout on the given Composite.
|
static LayoutsGridData |
modifyGridData(Control control)
Returns an API for modifying the already-existing GridData which has been set on the given Control.
|
static LayoutsGridData |
modifyGridData(ControlWrapper wrapper)
Returns an API for modifying the already-existing GridData which has been set on the given ControlWrapper.
|
static LayoutsRowLayout |
modifyRow(Composite composite)
Returns an API for modifying the already-existing RowLayout on the given Composite.
|
static LayoutsRowData |
modifyRowData(Control control)
Returns an API for modifying the already-existing RowData which has been set on the given Control.
|
static LayoutsRowData |
modifyRowData(ControlWrapper wrapper)
Returns an API for modifying the already-existing RowData which has been set on the given ControlWrapper.
|
static LayoutsGridData |
newGridPlaceholder(Composite parent)
Creates an invisible `org.eclipse.swt.widgets.Label`, and returns an API for setting its GridData.
|
static Composite |
newGridRow(Composite parent,
Coat coat)
Quick shortcut to add a row to to this parent.
|
static LayoutsRowData |
newRowPlaceholder(Composite parent)
Creates an invisible `org.eclipse.swt.widgets.Label`, and returns an API for setting its RowData.
|
static LayoutsFillLayout |
setFill(Composite composite)
Sets the composite to have a standard FillLayout, and returns an API for modifying it.
|
static LayoutsGridLayout |
setGrid(Composite composite)
Sets the composite to have a standard GridLayout, and returns an API for modifying it.
|
static LayoutsGridData |
setGridData(Control control)
Sets the layouData on the Control to a new GridData, and returns an API for modifying it.
|
static LayoutsGridData |
setGridData(ControlWrapper wrapper)
Sets the layoutData on the ControlWrapper to a new GridData, and returns an API for modifying it.
|
static LayoutsRowLayout |
setRow(Composite composite)
Sets the composite to have a standard RowLayout, and returns an API for modifying it.
|
static LayoutsRowData |
setRowData(Control control)
Sets the layouData on the Control to a new GridData, and returns an API for modifying it.
|
static LayoutsRowData |
setRowData(ControlWrapper wrapper)
Sets the layoutData on the ControlWrapper to a new RowData, and returns an API for modifying it.
|
static LayoutsFillLayout |
wrap(FillLayout fillLayout)
Returns an API for modifying the given FillLayout.
|
static LayoutsGridData |
wrap(GridData gridData)
Returns an API for modifying the given GridData.
|
static LayoutsGridLayout |
wrap(GridLayout gridLayout)
Returns an API for modifying the given GridLayout.
|
static LayoutsRowData |
wrap(RowData gridData)
Returns an API for modifying the given RowData.
|
static LayoutsRowLayout |
wrap(RowLayout rowLayout)
Returns an API for modifying the given RowLayout.
|
public static int defaultMargin()
public static LayoutsFillLayout setFill(Composite composite)
public static LayoutsFillLayout modifyFill(Composite composite)
public static LayoutsFillLayout wrap(FillLayout fillLayout)
public static LayoutsGridLayout setGrid(Composite composite)
public static LayoutsGridLayout modifyGrid(Composite composite)
public static LayoutsGridLayout wrap(GridLayout gridLayout)
public static LayoutsGridData setGridData(Control control)
public static LayoutsGridData setGridData(ControlWrapper wrapper)
public static LayoutsGridData modifyGridData(Control control)
public static LayoutsGridData modifyGridData(ControlWrapper wrapper)
public static LayoutsGridData wrap(GridData gridData)
public static LayoutsGridData newGridPlaceholder(Composite parent)
public static Composite newGridRow(Composite parent, Coat coat)
public static LayoutsRowLayout setRow(Composite composite)
public static LayoutsRowLayout modifyRow(Composite composite)
public static LayoutsRowLayout wrap(RowLayout rowLayout)
public static LayoutsRowData setRowData(Control control)
public static LayoutsRowData setRowData(ControlWrapper wrapper)
public static LayoutsRowData modifyRowData(Control control)
public static LayoutsRowData modifyRowData(ControlWrapper wrapper)
public static LayoutsRowData wrap(RowData gridData)
public static LayoutsRowData newRowPlaceholder(Composite parent)