com.vaadin.addon.jpacontainer.fieldfactory
Class ListTranslator

java.lang.Object
  extended by com.vaadin.data.util.AbstractProperty
      extended by com.vaadin.addon.jpacontainer.fieldfactory.PropertyTranslator
          extended by com.vaadin.addon.jpacontainer.fieldfactory.ListTranslator
All Implemented Interfaces:
com.vaadin.data.Property, com.vaadin.data.Property.ReadOnlyStatusChangeListener, com.vaadin.data.Property.ReadOnlyStatusChangeNotifier, com.vaadin.data.Property.ValueChangeListener, com.vaadin.data.Property.ValueChangeNotifier, com.vaadin.data.Property.Viewer, Serializable

public class ListTranslator
extends PropertyTranslator

Generic wrapper property that translates items (Set from Vaadin selects) to a property of type List. The list order is taken from the selects order of items.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.vaadin.data.util.AbstractProperty
com.vaadin.data.util.AbstractProperty.ReadOnlyStatusChangeEvent
 
Nested classes/interfaces inherited from interface com.vaadin.data.Property
com.vaadin.data.Property.Editor, com.vaadin.data.Property.ReadOnlyException, com.vaadin.data.Property.ReadOnlyStatusChangeListener, com.vaadin.data.Property.ReadOnlyStatusChangeNotifier, com.vaadin.data.Property.Transactional<T>, com.vaadin.data.Property.ValueChangeListener, com.vaadin.data.Property.ValueChangeNotifier, com.vaadin.data.Property.Viewer
 
Constructor Summary
ListTranslator(com.vaadin.ui.AbstractSelect select)
           
 
Method Summary
 Object translateFromDatasource(Object value)
          This method must be implemented to translate the value received from DataSource.
 Object translateToDatasource(Object formattedValue)
          This method is used by setValue() method to translate given value to be suitable for the datasource.
 
Methods inherited from class com.vaadin.addon.jpacontainer.fieldfactory.PropertyTranslator
getPropertyDataSource, getType, getValue, isReadOnly, readOnlyStatusChange, setPropertyDataSource, setReadOnly, setValue, toString, valueChange
 
Methods inherited from class com.vaadin.data.util.AbstractProperty
addListener, addListener, addReadOnlyStatusChangeListener, addValueChangeListener, fireReadOnlyStatusChange, fireValueChange, getListeners, removeListener, removeListener, removeReadOnlyStatusChangeListener, removeValueChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ListTranslator

public ListTranslator(com.vaadin.ui.AbstractSelect select)
Method Detail

translateFromDatasource

public Object translateFromDatasource(Object value)
Description copied from class: PropertyTranslator
This method must be implemented to translate the value received from DataSource.

Specified by:
translateFromDatasource in class PropertyTranslator
Parameters:
value - Value object got from the datasource. This is guaranteed to be non-null and of the type compatible with getType() of the datasource.
Returns:

translateToDatasource

public Object translateToDatasource(Object formattedValue)
                             throws Exception
Description copied from class: PropertyTranslator
This method is used by setValue() method to translate given value to be suitable for the datasource. The method is required to assure that translateToDatasource(translateFromDatasource(x)) equals x.

Specified by:
translateToDatasource in class PropertyTranslator
Returns:
Non-null value compatible with datasource.
Throws:
Exception - Any type of exception can be thrown to indicate that the conversion was not succesful.


Copyright © 2013 Vaadin Ltd. All rights reserved.