|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectto.etc.domui.component.form.FormBuilderBase
to.etc.domui.component.form.GenericFormBuilder
to.etc.domui.component.form.GenericTableFormBuilder
to.etc.domui.component.form.HorizontalFormBuilder
public class HorizontalFormBuilder
EXPERIMENTAL UNSTABLE INTERFACE This builder helps with constructing horizontally-oriented forms, where input fields are put next to each other with their labels on top of each other. This is a replacement for TabularFormBuilder doing much of the same work but generating a different layout.
Field Summary |
---|
Fields inherited from class to.etc.domui.component.form.FormBuilderBase |
---|
LOG |
Constructor Summary | |
---|---|
HorizontalFormBuilder()
Uninitialized form builder. |
|
HorizontalFormBuilder(java.lang.Class<T> clz,
IReadOnlyModel<T> mdl)
Create a form builder using a lazy model and a current type. |
|
HorizontalFormBuilder(T instance)
Create a form builder to edit the specified, immutable instance (meaning the instance is immutable, not it's properties). |
Method Summary | |
---|---|
TD |
addCell()
Add a new cell to the last-used row. |
TD |
addCell(int colSpan,
int rowSpan)
|
TD |
addCell(java.lang.String css,
int colSpan,
int rowSpan)
|
void |
addContent(NodeBase label,
NodeBase[] control,
boolean editable)
|
protected void |
addControl(NodeBase label,
NodeBase labelnode,
NodeBase[] list,
boolean mandatory,
boolean editable,
PropertyMetaModel<?> pmm)
|
protected void |
addControl(java.lang.String label,
NodeBase labelnode,
NodeBase[] list,
boolean mandatory,
boolean editable,
PropertyMetaModel<?> pmm)
This is the actual workhorse doing the per-builder actual placement and layouting of a {control, label} pair. |
protected IControl<?>[] |
addListOfProperties(boolean editable,
java.lang.String... names)
Handle placement of a list of property names, all obeying the current mode in effect. |
HorizontalFormBuilder |
colSpan(int x)
Set the colspan for both label and control for all controls added after this call. |
HorizontalFormBuilder |
controlClass(java.lang.String controlClass)
|
HorizontalFormBuilder |
controlColSpan(int x)
Set the colspan for only the control for all controls added after this call. |
HorizontalFormBuilder |
controlNowrap()
|
HorizontalFormBuilder |
controlRowSpan(int x)
Set the rowspan for only the control for all controls added after this call. |
HorizontalFormBuilder |
controlWidth(java.lang.String s)
|
HorizontalFormBuilder |
defaultControlClass(java.lang.String defaultControlClass)
|
HorizontalFormBuilder |
defaultLabelClass(java.lang.String defaultLabelClass)
|
NodeContainer |
finish()
This finishes off the current table by calculating colspans for all skewed rows. |
void |
finish(NodeContainer target)
|
void |
finish(NodeContainer target,
boolean balance)
Adds the generated tables/table to the target specified. |
TR |
getEditRow()
|
TR |
getLabelRow()
|
protected void |
internalClearLocation()
Called when a new table, body or whatever is made current; it should reset all known positioning information. |
HorizontalFormBuilder |
labelClass(java.lang.String labelClass)
|
HorizontalFormBuilder |
labelColSpan(int x)
Set the colspan for only the label for all controls added after this call. |
HorizontalFormBuilder |
labelNowrap()
|
HorizontalFormBuilder |
labelRowSpan(int x)
Set the rowspan for only the label for all controls added after this call. |
HorizontalFormBuilder |
labelWidth(java.lang.String s)
|
void |
nl()
Start a new row of input fields. |
HorizontalFormBuilder |
nowrap()
|
protected void |
onTableAdded(Table t)
Called when a new table is added. |
HorizontalFormBuilder |
rowSpan(int x)
Set the rowspan for both label and control for all controls added after this call. |
HorizontalFormBuilder |
tablePerForm()
|
HorizontalFormBuilder |
tablePerRow()
|
HorizontalFormBuilder |
width(java.lang.String s)
|
Methods inherited from class to.etc.domui.component.form.GenericTableFormBuilder |
---|
addCell, addRow, addRowAndCell, addRowAndCell, getLastUsedRow, getTable, getTBody, newBody, onBodyAdded, onRowAdded, reset, row, selectRow, setLastUsedCell, setLastUsedRow, setTable, setTBody, table, tbody |
Methods inherited from class to.etc.domui.component.form.GenericFormBuilder |
---|
addContent, addContent, addDisplayProp, addDisplayProp, addDisplayProp, addDisplayProps, addLabelAndControl, addLabelAndControl, addProp, addProp, addProp, addProp, addProp, addProp, addProp, addPropertyAndControl, addPropertyControl, addProps |
Methods inherited from class to.etc.domui.component.form.FormBuilderBase |
---|
createControlFor, createControlFor, getBindings, getBuilder, getClassMeta, getContext, getControlLabelFactory, getCurrentInputClass, getModel, resolveProperty, rights, setBindings, setClassModel, setContext, setControlLabelFactory, setInstance, setMetaModel |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HorizontalFormBuilder()
public HorizontalFormBuilder(java.lang.Class<T> clz, IReadOnlyModel<T> mdl)
T
- clz
- mdl
- public HorizontalFormBuilder(T instance)
T
- instance
- Method Detail |
---|
public TD addCell()
GenericTableFormBuilder
addCell
in class GenericTableFormBuilder
GenericTableFormBuilder.addCell()
public TD addCell(int colSpan, int rowSpan)
public TD addCell(java.lang.String css, int colSpan, int rowSpan)
public TR getLabelRow()
public TR getEditRow()
protected void addControl(java.lang.String label, NodeBase labelnode, NodeBase[] list, boolean mandatory, boolean editable, PropertyMetaModel<?> pmm)
GenericFormBuilder
addControl
in class GenericFormBuilder
mandatory
- T when the node is mandatory, needed by the label factoryeditable
- T when the node is editable, needed by the label factoryto.etc.domui.component.form.GenericFormBuilder#addControl(java.lang.String, to.etc.domui.dom.html.NodeBase, to.etc.domui.dom.html.NodeBase[], boolean, to.etc.domui.component.meta.PropertyMetaModel)
protected void addControl(NodeBase label, NodeBase labelnode, NodeBase[] list, boolean mandatory, boolean editable, PropertyMetaModel<?> pmm)
addControl
in class GenericFormBuilder
public void addContent(NodeBase label, NodeBase[] control, boolean editable)
addContent
in class GenericFormBuilder
protected IControl<?>[] addListOfProperties(boolean editable, java.lang.String... names)
GenericFormBuilder
addListOfProperties
in class GenericFormBuilder
protected void onTableAdded(Table t)
GenericTableFormBuilder
onTableAdded
in class GenericTableFormBuilder
protected void internalClearLocation()
GenericTableFormBuilder
internalClearLocation
in class GenericTableFormBuilder
public void nl()
public NodeContainer finish()
finish
in class GenericTableFormBuilder
public void finish(NodeContainer target)
public void finish(NodeContainer target, boolean balance)
target
- public HorizontalFormBuilder colSpan(int x)
x
-
public HorizontalFormBuilder rowSpan(int x)
x
-
public HorizontalFormBuilder labelColSpan(int x)
x
-
public HorizontalFormBuilder labelRowSpan(int x)
x
-
public HorizontalFormBuilder controlColSpan(int x)
x
-
public HorizontalFormBuilder controlRowSpan(int x)
x
-
public HorizontalFormBuilder defaultLabelClass(java.lang.String defaultLabelClass)
public HorizontalFormBuilder defaultControlClass(java.lang.String defaultControlClass)
public HorizontalFormBuilder labelClass(java.lang.String labelClass)
public HorizontalFormBuilder controlClass(java.lang.String controlClass)
public HorizontalFormBuilder tablePerRow()
public HorizontalFormBuilder tablePerForm()
public HorizontalFormBuilder labelWidth(java.lang.String s)
public HorizontalFormBuilder controlWidth(java.lang.String s)
public HorizontalFormBuilder labelNowrap()
public HorizontalFormBuilder controlNowrap()
public HorizontalFormBuilder nowrap()
public HorizontalFormBuilder width(java.lang.String s)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |