info.magnolia.ui.form.field.factory
Class SwitchableFieldFactory<D extends FieldDefinition>

java.lang.Object
  extended by info.magnolia.ui.form.AbstractFormItem
      extended by info.magnolia.ui.form.field.factory.AbstractFieldFactory<SwitchableFieldDefinition,com.vaadin.data.util.PropertysetItem>
          extended by info.magnolia.ui.form.field.factory.SwitchableFieldFactory<D>
Type Parameters:
D - definition type
All Implemented Interfaces:
FieldFactory, FormItem

public class SwitchableFieldFactory<D extends FieldDefinition>
extends AbstractFieldFactory<SwitchableFieldDefinition,com.vaadin.data.util.PropertysetItem>

Creates a @ link SwitchableField} based on definition.
has two components:
- A select section configured based on the Options list of the definition
- A field section configured based on the Fields list of the definition
The link between select and fields is based on the association of:
- The String property defined into the value property of the definition (value = date)
and
- The Field name defined into the Fields set (Date field named date).


Field Summary
 
Fields inherited from class info.magnolia.ui.form.field.factory.AbstractFieldFactory
definition, field, item
 
Constructor Summary
SwitchableFieldFactory(SwitchableFieldDefinition definition, com.vaadin.data.Item relatedFieldItem, FieldFactoryFactory fieldFactoryFactory, info.magnolia.cms.i18n.I18nContentSupport i18nContentSupport, info.magnolia.objectfactory.ComponentProvider componentProvider)
           
 
Method Summary
protected  com.vaadin.ui.Field<com.vaadin.data.util.PropertysetItem> createFieldComponent()
          Implemented by subclasses to create and initialize the Vaadin Field instance to use.
protected  Transformer<?> initializeTransformer(Class<? extends Transformer<?>> transformerClass)
          Create a new Instance of Transformer.
 
Methods inherited from class info.magnolia.ui.form.field.factory.AbstractFieldFactory
createDefaultValue, createField, getDefaultFieldType, getDefinitionType, getFieldDefinition, getFieldType, getI18nBasename, getView, setComponentProvider, setFieldValidatorFactoryFactory, setI18nContentSupport, setPropertyDataSourceAndDefaultValue, setPropertyDataSourceDefaultValue
 
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
 

Constructor Detail

SwitchableFieldFactory

@Inject
public SwitchableFieldFactory(SwitchableFieldDefinition definition,
                                     com.vaadin.data.Item relatedFieldItem,
                                     FieldFactoryFactory fieldFactoryFactory,
                                     info.magnolia.cms.i18n.I18nContentSupport i18nContentSupport,
                                     info.magnolia.objectfactory.ComponentProvider componentProvider)
Method Detail

createFieldComponent

protected com.vaadin.ui.Field<com.vaadin.data.util.PropertysetItem> 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<SwitchableFieldDefinition,com.vaadin.data.util.PropertysetItem>

initializeTransformer

protected Transformer<?> initializeTransformer(Class<? extends Transformer<?>> transformerClass)
Create a new Instance of Transformer.

Overrides:
initializeTransformer in class AbstractFieldFactory<SwitchableFieldDefinition,com.vaadin.data.util.PropertysetItem>


Copyright © 2013 Magnolia International Ltd.. All Rights Reserved.