|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object info.magnolia.ui.form.AbstractFormItem info.magnolia.ui.form.field.factory.AbstractFieldFactory<D,T>
D
- definition typeT
- field value typepublic abstract class AbstractFieldFactory<D extends FieldDefinition,T>
Abstract FieldFactory implementations. This class handle all common attributes defined in FieldDefinition
and binds Vaadin Field
instances created
by subclasses to the Property
they will be reading and writing to.
Field Summary | |
---|---|
protected D |
definition
|
protected com.vaadin.ui.Field<T> |
field
|
protected com.vaadin.data.Item |
item
|
Constructor Summary | |
---|---|
AbstractFieldFactory(D definition,
com.vaadin.data.Item relatedFieldItem)
|
Method Summary | |
---|---|
protected Object |
createDefaultValue(com.vaadin.data.Property<?> property)
Create a typed default value. |
com.vaadin.ui.Field<T> |
createField()
Creates and initializes a Vaadin Field component. |
protected abstract com.vaadin.ui.Field<T> |
createFieldComponent()
Implemented by subclasses to create and initialize the Vaadin Field instance to use. |
protected Class<?> |
getDefaultFieldType()
Exposed method used by field's factory in order to define a default Field Type (decoupled from the definition). |
protected Class<?> |
getDefinitionType()
|
D |
getFieldDefinition()
|
protected Class<?> |
getFieldType()
Define the field property value type Class. Return the value defined by the configuration ('type' property). If this value is not defined, return the value of the overriding method getDefaultFieldType() .If this method is not override, return UndefinedPropertyType .In this case, the Transformer will have the responsibility to define the property type. |
protected String |
getI18nBasename()
|
View |
getView()
|
protected Transformer<?> |
initializeTransformer(Class<? extends Transformer<?>> transformerClass)
Exposed method used by field's factory to initialize the property Transformer .This allows to add additional constructor parameter if needed. |
void |
setComponentProvider(info.magnolia.objectfactory.ComponentProvider componentProvider)
|
void |
setFieldValidatorFactoryFactory(FieldValidatorFactoryFactory fieldValidatorFactoryFactory)
|
void |
setI18nContentSupport(info.magnolia.cms.i18n.I18nContentSupport i18nContentSupport)
|
void |
setPropertyDataSourceAndDefaultValue(com.vaadin.data.Property<?> property)
Set the DataSource of the current field. Set the default value if : - the item is an instance of ItemAdapter and this is a new Item (Not yet stored in the related datasource)
- the item is not an instance of ItemAdapter .In this case, the Item is a custom implementation of Item and we have no possibility to define if it is or not a new Item. |
protected void |
setPropertyDataSourceDefaultValue(com.vaadin.data.Property property)
Set the Field default value is required. |
Methods inherited from class info.magnolia.ui.form.AbstractFormItem |
---|
getMessage, getMessages, getParent, setParent |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface info.magnolia.ui.form.FormItem |
---|
getMessages, getParent, setParent |
Field Detail |
---|
protected com.vaadin.data.Item item
protected com.vaadin.ui.Field<T> field
protected D extends FieldDefinition definition
Constructor Detail |
---|
public AbstractFieldFactory(D definition, com.vaadin.data.Item relatedFieldItem)
Method Detail |
---|
public void setFieldValidatorFactoryFactory(FieldValidatorFactoryFactory fieldValidatorFactoryFactory)
setFieldValidatorFactoryFactory
in interface FieldFactory
public void setI18nContentSupport(info.magnolia.cms.i18n.I18nContentSupport i18nContentSupport)
setI18nContentSupport
in interface FieldFactory
public com.vaadin.ui.Field<T> createField()
FieldFactory
Field
component.
createField
in interface FieldFactory
public void setPropertyDataSourceAndDefaultValue(com.vaadin.data.Property<?> property)
ItemAdapter
and this is a new Item (Not yet stored in the related datasource)
- the item is not an instance of ItemAdapter
.Item
and we have no possibility to define if it is or not a new Item.
protected void setPropertyDataSourceDefaultValue(com.vaadin.data.Property property)
protected Object createDefaultValue(com.vaadin.data.Property<?> property)
public D getFieldDefinition()
getFieldDefinition
in interface FieldFactory
protected abstract com.vaadin.ui.Field<T> createFieldComponent()
public View getView()
getView
in interface FieldFactory
protected Transformer<?> initializeTransformer(Class<? extends Transformer<?>> transformerClass)
Transformer
.
protected Class<?> getFieldType()
getDefaultFieldType()
.UndefinedPropertyType
.Transformer
will have the responsibility to define the property type.
protected Class<?> getDefinitionType()
protected Class<?> getDefaultFieldType()
protected String getI18nBasename()
getI18nBasename
in class AbstractFormItem
public void setComponentProvider(info.magnolia.objectfactory.ComponentProvider componentProvider)
setComponentProvider
in interface FieldFactory
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |