public final class FormFactory
extends java.lang.Object
I consider removing the FormLayout factory methods.
These seem to be less useful and may lead to poor layout readability.
If you want to use these methods, you may consider copying them
to your codebase.
The forms are described by major and minor columns. Major columns consist of a leading label and a set of related components, for example: a label plus textfield, or label plus textfield plus button. The component part of a major column is divided into minor columns as shown in this layout:
<- major column 1 -> <- major column 2 -> label1 textfield1a textfield1b label2 textfield2a textfield2b label3 textfield3a textfield3b label4 textfield4 label5 textfield5 label6 textfield6
Many forms use 1, 2, 3 or 4 major columns, which in turn are often split into 1, 2, 3 or 4 minor columns.
FormLayout,
ColumnSpec| Modifier and Type | Field and Description |
|---|---|
static ColumnSpec |
BUTTON_COLSPEC
Describes a logical horizontal column for a fixed size button.
|
static ColumnSpec |
DEFAULT_COLSPEC
An unmodifyable
ColumnSpec that determines its preferred
width by computing the maximum of all column component preferred widths
and its minimum width by computing all column component minimum widths. |
static RowSpec |
DEFAULT_ROWSPEC
An unmodifyable
RowSpec that determines its preferred
height by computing the maximum of all column component preferred heights
and its minimum height by computing all column component minimum heights. |
static ColumnSpec |
GLUE_COLSPEC
An unmodifyable
ColumnSpec that has an initial width
of 0 pixels and that grows. |
static RowSpec |
GLUE_ROWSPEC
An unmodifyable
RowSpec that has an initial height
of 0 pixels and that grows. |
static ColumnSpec |
GROWING_BUTTON_COLSPEC
Describes a logical horizontal column for a growing button.
|
static ColumnSpec |
LABEL_COMPONENT_GAP_COLSPEC
Describes a logical horizontal gap between a label and an associated
component.
|
static RowSpec |
LINE_GAP_ROWSPEC
Describes the logical vertical default gap between two rows in the grid.
|
static ColumnSpec |
MIN_COLSPEC
An unmodifyable
ColumnSpec that determines its width by
computing the maximum of all column component minimum widths. |
static RowSpec |
MIN_ROWSPEC
An unmodifyable
RowSpec that determines its height by
computing the maximum of all column component minimum heights. |
static RowSpec |
NARROW_LINE_GAP_ROWSPEC
Describes a logical vertical narrow gap between two rows in the grid.
|
static RowSpec |
PARAGRAPH_GAP_ROWSPEC
Describes the logical vertical default gap between two paragraphs in
the layout grid.
|
static ColumnSpec |
PREF_COLSPEC
An unmodifyable
ColumnSpec that determines its width by
computing the maximum of all column component preferred widths. |
static RowSpec |
PREF_ROWSPEC
An unmodifyable
RowSpec that determines its height by
computing the maximum of all column component preferred heights. |
static ColumnSpec |
RELATED_GAP_COLSPEC
Describes a logical horizontal gap between two related components.
|
static RowSpec |
RELATED_GAP_ROWSPEC
Describes a logical vertical gap between two related components.
|
static ColumnSpec |
UNRELATED_GAP_COLSPEC
Describes a logical horizontal gap between two unrelated components.
|
static RowSpec |
UNRELATED_GAP_ROWSPEC
Describes a logical vertical gap between two unrelated components.
|
| Modifier and Type | Method and Description |
|---|---|
static FormLayout |
createColumnLayout(int majorColumns,
int minorColumns,
ColumnSpec labelColumnSpec)
Creates and returns an instance of
FormLayout
to build forms with the specified number of major and minor columns. |
static FormLayout |
createColumnLayout(int majorColumns,
int minorColumns,
ColumnSpec labelColumnSpec,
ColumnSpec componentColumnSpec,
ConstantSize indent,
ConstantSize majorColumnGap,
ConstantSize minorColumnGap)
Creates and returns an instance of
FormLayout
to build forms with the given number of major columns. |
static FormLayout |
createColumnLayout(int majorColumns,
int minorColumns,
ColumnSpec labelColumnSpec,
ConstantSize indent,
ConstantSize minorColumnGap)
Creates and returns an instance of
FormLayout
to build forms with the given number of major columns. |
static ColumnSpec |
createGapColumnSpec(ConstantSize gapSize)
Creates and returns a
ColumnSpec that represents a gap with the
specified ConstantSize. |
static RowSpec |
createGapRowSpec(ConstantSize gapSize)
Creates and returns a
RowSpec that represents a gap with the
specified ConstantSize. |
public static final ColumnSpec MIN_COLSPEC
ColumnSpec that determines its width by
computing the maximum of all column component minimum widths.PREF_COLSPEC,
DEFAULT_COLSPECpublic static final ColumnSpec PREF_COLSPEC
ColumnSpec that determines its width by
computing the maximum of all column component preferred widths.MIN_COLSPEC,
DEFAULT_COLSPECpublic static final ColumnSpec DEFAULT_COLSPEC
ColumnSpec that determines its preferred
width by computing the maximum of all column component preferred widths
and its minimum width by computing all column component minimum widths.Useful to let a column shrink from preferred width to minimum width if the container space gets scarce.
MIN_COLSPEC,
PREF_COLSPECpublic static final ColumnSpec GLUE_COLSPEC
ColumnSpec that has an initial width
of 0 pixels and that grows. Useful to describe glue columns
that fill the space between other columns.GLUE_ROWSPECpublic static final ColumnSpec LABEL_COMPONENT_GAP_COLSPEC
Note: In a future version this constant will likely
be moved to a class LogicalSize or StyledSize.
public static final ColumnSpec RELATED_GAP_COLSPEC
Note: In a future version this constant will likely
be moved to a class LogicalSize or StyledSize.
UNRELATED_GAP_COLSPECpublic static final ColumnSpec UNRELATED_GAP_COLSPEC
Note: In a future version this constant will likely
be moved to a class LogicalSize or StyledSize.
RELATED_GAP_COLSPECpublic static final ColumnSpec BUTTON_COLSPEC
Note: In a future version this constant will likely
be moved to a class LogicalSize or StyledSize.
GROWING_BUTTON_COLSPECpublic static final ColumnSpec GROWING_BUTTON_COLSPEC
Note: In a future version this constant will likely
be moved to a class LogicalSize or StyledSize.
BUTTON_COLSPECpublic static final RowSpec MIN_ROWSPEC
RowSpec that determines its height by
computing the maximum of all column component minimum heights.PREF_ROWSPEC,
DEFAULT_ROWSPECpublic static final RowSpec PREF_ROWSPEC
RowSpec that determines its height by
computing the maximum of all column component preferred heights.MIN_ROWSPEC,
DEFAULT_ROWSPECpublic static final RowSpec DEFAULT_ROWSPEC
RowSpec that determines its preferred
height by computing the maximum of all column component preferred heights
and its minimum height by computing all column component minimum heights.Useful to let a column shrink from preferred height to minimum height if the container space gets scarce.
MIN_COLSPEC,
PREF_COLSPECpublic static final RowSpec GLUE_ROWSPEC
RowSpec that has an initial height
of 0 pixels and that grows. Useful to describe glue rows
that fill the space between other rows.GLUE_COLSPECpublic static final RowSpec RELATED_GAP_ROWSPEC
Note: In a future version this constant will likely
be moved to a class LogicalSize or StyledSize.
UNRELATED_GAP_ROWSPECpublic static final RowSpec UNRELATED_GAP_ROWSPEC
Note: In a future version this constant will likely
be moved to a class LogicalSize or StyledSize.
RELATED_GAP_ROWSPECpublic static final RowSpec NARROW_LINE_GAP_ROWSPEC
Note: In a future version this constant will likely
be moved to a class LogicalSize or StyledSize.
LINE_GAP_ROWSPEC,
PARAGRAPH_GAP_ROWSPECpublic static final RowSpec LINE_GAP_ROWSPEC
Note: In a future version this constant will likely
be moved to a class LogicalSize or StyledSize.
NARROW_LINE_GAP_ROWSPEC,
PARAGRAPH_GAP_ROWSPECpublic static final RowSpec PARAGRAPH_GAP_ROWSPEC
Note: In a future version this constant will likely
be moved to a class LogicalSize or StyledSize.
NARROW_LINE_GAP_ROWSPEC,
LINE_GAP_ROWSPECpublic static FormLayout createColumnLayout(int majorColumns, int minorColumns, ColumnSpec labelColumnSpec)
FormLayout
to build forms with the specified number of major and minor columns.The layout will use default values for all gaps.
This method may be removed from a future version.
majorColumns - the number of used major columnsminorColumns - the number of used minor columnslabelColumnSpec - specifies the label columnsFormLayoutpublic static FormLayout createColumnLayout(int majorColumns, int minorColumns, ColumnSpec labelColumnSpec, ConstantSize indent, ConstantSize minorColumnGap)
FormLayout
to build forms with the given number of major columns.
Major columns consists of a label and a component section, where each
component section is divided into the given number of minor columns.The layout will use the specified gaps to separate major columns, and the label and component section.
This method may be removed from a future version.
majorColumns - the number of major columnsminorColumns - the number of minor columnslabelColumnSpec - specifies the label columnsindent - an optional ConstantSize
that describes the width of the leading indent columnminorColumnGap - a ConstantSize that describes
the gap between minor columnsFormLayoutpublic static FormLayout createColumnLayout(int majorColumns, int minorColumns, ColumnSpec labelColumnSpec, ColumnSpec componentColumnSpec, ConstantSize indent, ConstantSize majorColumnGap, ConstantSize minorColumnGap)
FormLayout
to build forms with the given number of major columns.
Major columns consists of a label and a component section, where each
component section is divided into the given number of minor columns.The layout will use the specified gaps to separate major columns, minor columns, and the label and component section.
This method may be removed from a future version.
majorColumns - the number of major columnsminorColumns - the number of minor columnslabelColumnSpec - specifies the label columnscomponentColumnSpec - specifies the label columnsindent - an optional ConstantSize
that describes the width of the leading indent columnmajorColumnGap - a ConstantSize that describes
the gap between major columnsminorColumnGap - a ConstantSize that describes
the gap between minor columnsFormLayoutpublic static ColumnSpec createGapColumnSpec(ConstantSize gapSize)
ColumnSpec that represents a gap with the
specified ConstantSize.gapSize - a ConstantSize that specifies the gapColumnSpec that describes a horizontal gappublic static RowSpec createGapRowSpec(ConstantSize gapSize)
RowSpec that represents a gap with the
specified ConstantSize.gapSize - a ConstantSize that specifies the gapRowSpec that describes a vertical gap