public class Form<T> extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
Form.PropertyUpdater<FROM,TO,EDIT_OBJECT> |
Modifier and Type | Field and Description |
---|---|
protected boolean |
editable |
static boolean |
EDITABLE |
static Object |
GROW_FIRST_ELEMENT |
static boolean |
READ_ONLY |
Constructor and Description |
---|
Form() |
Form(boolean editable) |
Form(boolean editable,
int columns) |
Form(int columns) |
Modifier and Type | Method and Description |
---|---|
<FROM,TO> void |
addDependecy(FROM from,
Form.PropertyUpdater<FROM,TO,T> updater,
TO to)
Declares that if the key or property from changes the specified
updater should be called and after its return the to key or property
could have changed.
|
void |
addDependecy(Object from,
Object... to)
Declares that if the from property changes all
the properties with to could change.
|
void |
addTitle(String text) |
protected FormElement<?> |
createElement(Object key) |
protected FormElement<?> |
createElement(PropertyInterface property,
boolean editable) |
protected void |
fillWithDemoData(T object) |
protected int |
getColumnWidthPercentage() |
Frontend.FormContent |
getContent() |
Collection<PropertyInterface> |
getProperties() |
void |
indicate(List<ValidationMessage> validationMessages) |
void |
line(Object... keys) |
void |
mock() |
static Object |
readonly(Object key) |
void |
setChangeListener(ChangeListener<Form<?>> changeListener) |
void |
setObject(T object) |
public static final boolean EDITABLE
public static final boolean READ_ONLY
public static final Object GROW_FIRST_ELEMENT
protected final boolean editable
public Form()
public Form(boolean editable)
public Form(int columns)
public Form(boolean editable, int columns)
protected int getColumnWidthPercentage()
public Frontend.FormContent getContent()
protected FormElement<?> createElement(Object key)
protected FormElement<?> createElement(PropertyInterface property, boolean editable)
public void line(Object... keys)
public void addTitle(String text)
public void addDependecy(Object from, Object... to)
from
- the key or property of the field triggering the updateto
- the field possible changed its value implicitlypublic <FROM,TO> void addDependecy(FROM from, Form.PropertyUpdater<FROM,TO,T> updater, TO to)
This is used if there is a more complex relation between two fields.
FROM
- the type (class) of the fromKey / fieldTO
- the type (class) of the toKey / fieldfrom
- the field triggering the updateupdater
- the updater doing the change of the to fieldto
- the changed field by the updaterpublic final void mock()
protected void fillWithDemoData(T object)
public Collection<PropertyInterface> getProperties()
public void setObject(T object)
public void setChangeListener(ChangeListener<Form<?>> changeListener)
public void indicate(List<ValidationMessage> validationMessages)
Copyright © 2019. All rights reserved.