|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.vaadin.ui.DefaultFieldFactory
public class DefaultFieldFactory
This class contains a basic implementation for both FormFieldFactory
and TableFieldFactory
. The class is singleton, use get()
method to get reference to the instance.
There are also some static helper methods available for custom built field factories.
Constructor Summary | |
---|---|
protected |
DefaultFieldFactory()
|
Method Summary | |
---|---|
static java.lang.String |
createCaptionByPropertyId(java.lang.Object propertyId)
If name follows method naming conventions, convert the name to spaced upper case text. |
Field<?> |
createField(Container container,
java.lang.Object itemId,
java.lang.Object propertyId,
Component uiContext)
Creates a field based on the Container, item id, property id and the component responsible for displaying the field (most commonly Table ). |
Field<?> |
createField(Item item,
java.lang.Object propertyId,
Component uiContext)
Creates a field based on the item, property id and the component (most commonly Form ) where the Field will be presented. |
static Field<?> |
createFieldByPropertyType(java.lang.Class<?> type)
Creates fields based on the property type. |
static DefaultFieldFactory |
get()
Singleton method to get an instance of DefaultFieldFactory. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected DefaultFieldFactory()
Method Detail |
---|
public static DefaultFieldFactory get()
public Field<?> createField(Item item, java.lang.Object propertyId, Component uiContext)
FormFieldFactory
Form
) where the Field will be presented.
createField
in interface FormFieldFactory
item
- the item where the property belongs to.propertyId
- the Id of the property.uiContext
- the component where the field is presented, most commonly this
is Form
. uiContext will not necessary be the parent
component of the field, but the one that is responsible for
creating it.
public Field<?> createField(Container container, java.lang.Object itemId, java.lang.Object propertyId, Component uiContext)
TableFieldFactory
Table
).
createField
in interface TableFieldFactory
container
- the Container where the property belongs to.itemId
- the item Id.propertyId
- the Id of the property.uiContext
- the component where the field is presented.
public static java.lang.String createCaptionByPropertyId(java.lang.Object propertyId)
propertyId
-
public static Field<?> createFieldByPropertyType(java.lang.Class<?> type)
The default field type is TextField
. Other field types generated
by this method:
Boolean: CheckBox
.
Date: DateField
(resolution: day).
Item: Form
.
default field type: TextField
.
type
- the type of the property
Field
for given type
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |