info.magnolia.ui.form.field.factory
Class SelectFieldFactory<D extends SelectFieldDefinition>
java.lang.Object
info.magnolia.ui.form.AbstractFormItem
info.magnolia.ui.form.field.factory.AbstractFieldFactory<D,Object>
info.magnolia.ui.form.field.factory.SelectFieldFactory<D>
- Type Parameters:
D
- type of definition
- All Implemented Interfaces:
- FieldFactory, FormItem
- Direct Known Subclasses:
- ComponentSelectorFieldFactory, OptionGroupFieldFactory, TemplateSelectorFieldFactory, TwinColSelectFieldFactory
public class SelectFieldFactory<D extends SelectFieldDefinition>
- extends AbstractFieldFactory<D,Object>
Creates and initializes a selection field based on a field definition.
Field Summary |
protected com.vaadin.ui.AbstractSelect |
select
|
Methods inherited from class info.magnolia.ui.form.field.factory.AbstractFieldFactory |
createField, getDefaultFieldType, getFieldDefinition, getFieldType, getI18nBasename, getView, initializeTransformer, setComponentProvider, setFieldValidatorFactoryFactory, setI18nContentSupport, setPropertyDataSourceAndDefaultValue, setPropertyDataSourceDefaultValue |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
select
protected com.vaadin.ui.AbstractSelect select
SelectFieldFactory
public SelectFieldFactory(D definition,
com.vaadin.data.Item relatedFieldItem)
createFieldComponent
protected com.vaadin.ui.AbstractSelect createFieldComponent()
- Description copied from class:
AbstractFieldFactory
- Implemented by subclasses to create and initialize the Vaadin Field instance to use.
- Specified by:
createFieldComponent
in class AbstractFieldFactory<D extends SelectFieldDefinition,Object>
createSelectionField
protected com.vaadin.ui.AbstractSelect createSelectionField()
- Used to initialize the desired subclass of AbstractSelect field component. Subclasses can override this method.
getSelectFieldOptionDefinition
public List<SelectFieldOptionDefinition> getSelectFieldOptionDefinition()
- Get the list of SelectFieldOptionDefinition.
If options is not empty, took the options defined in this field definition.
Else, if path is not empty, build an options list based on the node refereed by
the path and property value.
Else nothing is define, return an empty option.
Default value and i18n of the Label is also part of the responsibility of this method.
getIconResource
public com.vaadin.server.Resource getIconResource(SelectFieldOptionDefinition option)
- Default Implementation to retrieve an Icon.
Sub class should override this method in order to retrieve
others Resource.
createDefaultValue
protected Object createDefaultValue(com.vaadin.data.Property<?> dataSource)
- Set the value selected.
Set selectedItem to the last stored value.
If not yet stored, set initialSelectedKey as selectedItem
Else, set the first element of the list.
- Overrides:
createDefaultValue
in class AbstractFieldFactory<D extends SelectFieldDefinition,Object>
getDefinitionType
protected Class<?> getDefinitionType()
- Overrides:
getDefinitionType
in class AbstractFieldFactory<D extends SelectFieldDefinition,Object>
- Returns:
- Class Type defined into the field definition or null if not defined.
Copyright © 2013 Magnolia International Ltd.. All Rights Reserved.