|
||||||||||
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
public abstract class GenericFormBuilder
Encapsulates basic actions that can be done with all form builder implementations, and delegates the actual parts that require layout decisions to the actual implementation.
Field Summary |
---|
Fields inherited from class to.etc.domui.component.form.FormBuilderBase |
---|
LOG |
Constructor Summary | |
---|---|
GenericFormBuilder()
Default ctor. |
|
GenericFormBuilder(java.lang.Class<T> clz,
IReadOnlyModel<T> mdl)
Create one primed with a model and class. |
|
GenericFormBuilder(T instance)
|
Method Summary | ||
---|---|---|
abstract void |
addContent(NodeBase label,
NodeBase[] control,
boolean editable)
|
|
void |
addContent(NodeBase label,
NodeBase control,
boolean editable)
|
|
void |
addContent(java.lang.String label,
NodeBase control,
boolean editable)
|
|
protected abstract void |
addControl(NodeBase label,
NodeBase labelnode,
NodeBase[] list,
boolean mandatory,
boolean editable,
PropertyMetaModel<?> pmm)
|
|
protected abstract 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. |
|
IControl<?> |
addDisplayProp(java.lang.String name)
Add a display-only field for the specified property. |
|
IControl<?> |
addDisplayProp(java.lang.String name,
java.lang.String label)
Add an input for the specified property just as addProp(String, String) ,
only this input won't be editable (ever). |
|
|
addDisplayProp(java.lang.String propertyname,
T ctl)
|
|
IControl<?>[] |
addDisplayProps(java.lang.String... names)
Add the specified properties to the form as display-only properties, in the current mode. |
|
void |
addLabelAndControl(Label label,
java.lang.String errorLocation,
NodeBase control,
boolean mandatory)
Add a fully manually specified label and control to the layout. |
|
void |
addLabelAndControl(java.lang.String label,
NodeBase control,
boolean mandatory)
Add a fully manually specified label and control to the layout. |
|
protected abstract IControl<?>[] |
addListOfProperties(boolean editable,
java.lang.String... names)
Handle placement of a list of property names, all obeying the current mode in effect. |
|
IControl<?> |
addProp(java.lang.String name)
Add an input for the specified property. |
|
IControl<?> |
addProp(java.lang.String name,
boolean editable)
Add an input for the specified property. |
|
IControl<?> |
addProp(java.lang.String name,
boolean editable,
boolean mandatory)
Add an input for the specified property. |
|
IControl<?> |
addProp(java.lang.String name,
java.lang.String label)
Add an input for the specified property. |
|
IControl<?> |
addProp(java.lang.String name,
java.lang.String label,
boolean editable,
boolean mandatory)
Add an input for the specified property. |
|
|
addProp(java.lang.String name,
java.lang.String label,
T ctl)
Add a user-specified control for a given property. |
|
|
addProp(java.lang.String propertyname,
T ctl)
Add a user-specified control for a given property. |
|
void |
addPropertyAndControl(java.lang.String propertyName,
NodeBase nb,
boolean mandatory)
This adds a fully user-specified control for a given property with it's default label, without creating any binding. |
|
protected IControl<?> |
addPropertyControl(java.lang.String name,
java.lang.String label,
PropertyMetaModel<?> pmm,
boolean editable)
|
|
IControl<?>[] |
addProps(java.lang.String... names)
Add the specified properties to the form, in the current mode. |
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 GenericFormBuilder()
public GenericFormBuilder(java.lang.Class<T> clz, IReadOnlyModel<T> mdl)
T
- clz
- mdl
- public GenericFormBuilder(T instance)
T
- instance
- Method Detail |
---|
protected abstract void addControl(java.lang.String label, NodeBase labelnode, NodeBase[] list, boolean mandatory, boolean editable, PropertyMetaModel<?> pmm)
label
- labelnode
- list
- mandatory
- T when the node is mandatory, needed by the label factoryeditable
- T when the node is editable, needed by the label factorypmm
- protected abstract void addControl(NodeBase label, NodeBase labelnode, NodeBase[] list, boolean mandatory, boolean editable, PropertyMetaModel<?> pmm)
public abstract void addContent(NodeBase label, NodeBase[] control, boolean editable)
protected abstract IControl<?>[] addListOfProperties(boolean editable, java.lang.String... names)
editable
- names
- public IControl<?> addProp(java.lang.String name)
name
- public IControl<?> addProp(java.lang.String name, java.lang.String label)
name
- label
- The label text to use. Use the empty string to prevent a label from being generated. This still adds an empty cell for the label though.public IControl<?> addProp(java.lang.String name, java.lang.String label, boolean editable, boolean mandatory)
name
- label
- Add custom label.editable
- When false this adds a display-only field, when true a fully editable control.mandatory
- Specify if field is mandatory. This always overrides the mandatoryness of the metadata which is questionable.public IControl<?> addProp(java.lang.String name, boolean editable)
name
- editable
- When false add a display-only control, else add an editable control.public IControl<?> addProp(java.lang.String name, boolean editable, boolean mandatory)
name
- editable
- When false this adds a display-only field, when true a fully editable control.mandatory
- Specify if field is mandatory. This always overrides the mandatoryness of the metadata which is questionable.public void addContent(NodeBase label, NodeBase control, boolean editable)
public void addContent(java.lang.String label, NodeBase control, boolean editable)
public IControl<?> addDisplayProp(java.lang.String name)
name
- public IControl<?> addDisplayProp(java.lang.String name, java.lang.String label)
addProp(String, String)
,
only this input won't be editable (ever).
name
- label
- public <V,T extends NodeBase & IInputNode<V>> IControl<V> addProp(java.lang.String propertyname, T ctl)
addPropertyAndControl(String, NodeBase, boolean)
.
FORMAL-INTERFACE.
propertyname
- ctl
- public <V,T extends NodeBase & IDisplayControl<V>> IControl<V> addDisplayProp(java.lang.String propertyname, T ctl)
public <V,T extends NodeBase & IInputNode<V>> IControl<V> addProp(java.lang.String name, java.lang.String label, T ctl)
name
- label
- The label text to use. Use the empty string to prevent a label from being generated. This still adds an empty cell for the label though.ctl
- public void addLabelAndControl(java.lang.String label, NodeBase control, boolean mandatory)
label
- control
- mandatory
- public void addLabelAndControl(Label label, java.lang.String errorLocation, NodeBase control, boolean mandatory)
label
- errorLocation
- control
- mandatory
- protected IControl<?> addPropertyControl(java.lang.String name, java.lang.String label, PropertyMetaModel<?> pmm, boolean editable)
name
- label
- pmm
- editable
- when false, the rendered control will be display-only.
public void addPropertyAndControl(java.lang.String propertyName, NodeBase nb, boolean mandatory)
propertyName
- nb
- mandatory
- public IControl<?>[] addProps(java.lang.String... names)
f.append().addProps("a", "b","c");all three fields are appended to the current row. FORMAL-INTERFACE.
names
- public IControl<?>[] addDisplayProps(java.lang.String... names)
f.append().addProps("a", "b","c");all three fields are appended to the current row. FORMAL-INTERFACE.
names
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |