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.Type | Property and Description |
---|---|
protected com.vaadin.v7.data.Property<T> |
initialize
Initialize the property used as field's Datasource.
|
Modifier and Type | Field and Description |
---|---|
protected D |
definition |
protected com.vaadin.v7.ui.Field<T> |
field |
protected com.vaadin.v7.data.Item |
item |
Constructor and Description |
---|
AbstractFieldFactory(D definition,
com.vaadin.v7.data.Item relatedFieldItem)
Deprecated.
since 5.4.2 - use
AbstractFieldFactory(FieldDefinition, Item, UiContext, I18NAuthoringSupport) instead. |
AbstractFieldFactory(D definition,
com.vaadin.v7.data.Item relatedFieldItem,
UiContext uiContext,
I18NAuthoringSupport i18NAuthoringSupport) |
Modifier and Type | Method and Description |
---|---|
protected Object |
createDefaultValue(com.vaadin.v7.data.Property property) |
com.vaadin.v7.ui.Field<T> |
createField()
Creates and initializes a Vaadin
Field component. |
protected abstract com.vaadin.v7.ui.Field<T> |
createFieldComponent()
Implemented by subclasses to create and initialize the Vaadin Field instance to use.
|
protected Object |
createTypedValue(Object defaultValue,
Class<?> propertyType)
Create a typed value from an arbitrary value object to the given property type.
|
protected info.magnolia.objectfactory.ComponentProvider |
getComponentProvider() |
protected Object |
getConfiguredDefaultValue()
Resolve the default value from configuration.
|
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.
|
protected String |
getI18nBasename() |
Locale |
getLocale() |
View |
getView() |
protected com.vaadin.v7.data.util.converter.Converter<?,?> |
initializeConverter(Class<?> converterClass)
Exposed method used by field's factory to initialize the property
Converter . |
protected com.vaadin.v7.data.Property<T> |
initializeProperty()
Initialize the property used as field's Datasource.
|
protected Transformer<?> |
initializeTransformer(Class<? extends Transformer<?>> transformerClass)
Exposed method used by field's factory to initialize the property
Transformer . |
protected boolean |
isMessageKey(String key)
Field factories may use this method to check whether an @i18nText config property has an actual translation, or is a generated key.
|
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.v7.data.Property property)
Set the DataSource of the current field.
|
protected void |
setPropertyDataSourceDefaultValue(com.vaadin.v7.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.v7.data.Property<T> initializeProperty
Transformer
is configure to the field definition, use the default BasicTransformer
protected com.vaadin.v7.ui.Field<T> field
protected D extends FieldDefinition definition
protected com.vaadin.v7.data.Item item
@Inject public AbstractFieldFactory(D definition, com.vaadin.v7.data.Item relatedFieldItem, UiContext uiContext, I18NAuthoringSupport i18NAuthoringSupport)
@Deprecated public AbstractFieldFactory(D definition, com.vaadin.v7.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.v7.ui.Field<T> createField()
FieldFactory
Field
component.createField
in interface FieldFactory
public void setPropertyDataSourceAndDefaultValue(com.vaadin.v7.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.v7.data.Property property)
protected Object createDefaultValue(com.vaadin.v7.data.Property property)
protected Object createTypedValue(Object defaultValue, Class<?> propertyType)
protected Object getConfiguredDefaultValue()
public D getFieldDefinition()
getFieldDefinition
in interface FieldFactory
protected abstract com.vaadin.v7.ui.Field<T> createFieldComponent()
public View getView()
getView
in interface FieldFactory
protected com.vaadin.v7.data.Property<T> initializeProperty()
Transformer
is configure to the field definition, use the default BasicTransformer
protected Transformer<?> initializeTransformer(Class<? extends Transformer<?>> transformerClass)
Transformer
.protected com.vaadin.v7.data.util.converter.Converter<?,?> initializeConverter(Class<?> 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
protected boolean isMessageKey(String key)
By default, if no translation is found, these properties contain the longest key to provide such a translation.
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 © 2019 Magnolia International Ltd.. All rights reserved.