public abstract class AbstractBuilder
extends java.lang.Object
FormLayout.Builders hide details of the FormLayout and provide convenience behavior that assists you in constructing a form, bar, stack. This class provides a cell cursor that helps you traverse a form while you add components. Also, it offers several methods to append custom and logical columns and rows.
ButtonBarBuilder,
ButtonStackBuilder,
PanelBuilder,
I15dPanelBuilder,
DefaultFormBuilder| Modifier and Type | Field and Description |
|---|---|
private ComponentFactory |
componentFactory
Refers to a factory that is used to create labels, titles,
separators, and buttons.
|
private java.awt.Container |
container
Holds the layout container that we are building.
|
protected CellConstraints |
currentCellConstraints
Holds an instance of
CellConstraints that will be used to
specify the location, extent and alignments of the component to be
added next. |
private FormLayout |
layout
Holds the FormLayout instance that is used
to specify, fill and layout this form.
|
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractBuilder(FormLayout layout,
java.awt.Container container)
Constructs an AbstractBuilder
for the given FormLayout and layout container.
|
| Modifier and Type | Method and Description |
|---|---|
protected ComponentFactory |
createComponentFactory()
Invoked when the per-instance component factory is lazily initialized.
|
int |
getColumnCount()
Returns the number of columns in the form.
|
ComponentFactory |
getComponentFactory()
Returns this builder's component factory.
|
java.awt.Container |
getContainer()
Returns the container used to build the form.
|
FormLayout |
getLayout()
Returns the FormLayout instance used to build this form.
|
int |
getRowCount()
Returns the number of rows in the form.
|
void |
setComponentFactory(ComponentFactory newFactory)
Sets a new component factory for this builder,
overriding the default as provided by
FormsSetup.getComponentFactoryDefault(). |
private final java.awt.Container container
private final FormLayout layout
protected final CellConstraints currentCellConstraints
CellConstraints that will be used to
specify the location, extent and alignments of the component to be
added next.private ComponentFactory componentFactory
protected AbstractBuilder(FormLayout layout, java.awt.Container container)
layout - the FormLayout to usecontainer - the layout containerjava.lang.NullPointerException - if layout or container is nullpublic final java.awt.Container getContainer()
public final FormLayout getLayout()
public final int getColumnCount()
public final int getRowCount()
public final ComponentFactory getComponentFactory()
FormsSetup.getComponentFactoryDefault().setComponentFactory(ComponentFactory)public final void setComponentFactory(ComponentFactory newFactory)
FormsSetup.getComponentFactoryDefault().newFactory - the component factory to be used for this buildergetComponentFactory()protected ComponentFactory createComponentFactory()
Subclasses may override to use a factory other than the global default.
However, in most cases it is sufficient to just set a new global default
using FormsSetup.setComponentFactoryDefault(ComponentFactory).