D
- definition typeT
- field value typepublic abstract class AbstractFieldFactory<D extends FieldDefinition,T> extends AbstractFormItem implements FieldFactory
FieldDefinition
and binds Vaadin Field
instances created
by subclasses to the Property
they will be reading and writing to.Modifier and Type | Field and Description |
---|---|
protected D |
definition |
protected com.vaadin.ui.Field<T> |
field |
protected com.vaadin.data.Item |
item |
Constructor and Description |
---|
AbstractFieldFactory(D definition,
com.vaadin.data.Item relatedFieldItem)
Deprecated.
since 5.4.2 - use
AbstractFieldFactory(FieldDefinition, Item, UiContext, I18NAuthoringSupport) instead. |
AbstractFieldFactory(D definition,
com.vaadin.data.Item relatedFieldItem,
UiContext uiContext,
I18NAuthoringSupport i18NAuthoringSupport) |
Modifier and Type | Method and Description |
---|---|
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 info.magnolia.objectfactory.ComponentProvider |
getComponentProvider() |
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() |
Locale |
getLocale() |
View |
getView() |
protected com.vaadin.data.util.converter.Converter<?,?> |
initializeConverter(Class<? extends com.vaadin.data.util.converter.Converter<?,?>> converterClass)
Exposed method used by field's factory to initialize the property
Converter .This allows to add additional constructor parameter if needed. |
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)
Deprecated.
This is deprecated since 5.3.4;
I18nContentSupport was never used within any FieldFactory , rightfully so.
If any, I18NAuthoringSupport is the one that should be used. |
void |
setLocale(Locale locale) |
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.
|
getMessage, getMessages, getParent, setParent
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getMessages, getParent, setParent
protected com.vaadin.data.Item item
protected com.vaadin.ui.Field<T> field
protected D extends FieldDefinition definition
@Inject public AbstractFieldFactory(D definition, com.vaadin.data.Item relatedFieldItem, UiContext uiContext, I18NAuthoringSupport i18NAuthoringSupport)
@Deprecated public AbstractFieldFactory(D definition, com.vaadin.data.Item relatedFieldItem)
AbstractFieldFactory(FieldDefinition, Item, UiContext, I18NAuthoringSupport)
instead.public void setFieldValidatorFactoryFactory(FieldValidatorFactoryFactory fieldValidatorFactoryFactory)
setFieldValidatorFactoryFactory
in interface FieldFactory
@Deprecated public void setI18nContentSupport(info.magnolia.cms.i18n.I18nContentSupport i18nContentSupport)
I18nContentSupport
was never used within any FieldFactory
, rightfully so.
If any, I18NAuthoringSupport
is the one that should be used.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).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 com.vaadin.data.util.converter.Converter<?,?> initializeConverter(Class<? extends com.vaadin.data.util.converter.Converter<?,?>> converterClass)
Converter
.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
protected info.magnolia.objectfactory.ComponentProvider getComponentProvider()
public void setLocale(Locale locale)
public Locale getLocale()
Copyright © 2015 Magnolia International Ltd.. All rights reserved.