Class FormSpec
java.lang.Object
com.vaadin.featurepack.desktop.layouts.form.FormSpec
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ColumnSpec,RowSpec
An abstract class that specifies columns and rows in FormLayout by their
default alignment, start size and resizing behavior. API users will use the
subclasses
ColumnSpec and RowSpec.
Also implements the parser for encoded column and row specifications and provides parser convenience behavior for its subclasses ColumnSpec and RowSpec.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classAn ordinal-based serializable type-safe enumeration for the column and row default alignment types. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doubleThe default resize weight.static final doubleGives a column or row a fixed size. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedFormSpec(FormSpec.DefaultAlignment defaultAlignment, Size size, double resizeWeight) Constructs aFormSpecfor the given default alignment, size, and resize weight.protectedFormSpec(FormSpec.DefaultAlignment defaultAlignment, String encodedDescription) Constructs a FormSpec from the specified encoded description. -
Method Summary
-
Field Details
-
NO_GROW
public static final double NO_GROWGives a column or row a fixed size.- See Also:
-
DEFAULT_GROW
public static final double DEFAULT_GROWThe default resize weight.- See Also:
-
-
Constructor Details
-
FormSpec
Constructs aFormSpecfor the given default alignment, size, and resize weight. The resize weight must be a non-negative double; you can useNONEas a convenience value for no resize.- Parameters:
defaultAlignment- the spec's default alignmentsize- a constant, component or bounded sizeresizeWeight- the spec resize weight- Throws:
NullPointerException- if thesizeisnullIllegalArgumentException- if theresizeWeightis negative
-
FormSpec
Constructs a FormSpec from the specified encoded description. The description will be parsed to set initial values.- Parameters:
defaultAlignment- the default alignmentencodedDescription- the encoded description
-
-
Method Details
-
getDefaultAlignment
Returns the default alignment.- Returns:
- the default alignment
-
getSize
Returns the size.- Returns:
- the size
-
getResizeWeight
public final double getResizeWeight()Returns the current resize weight.- Returns:
- the resize weight.
-