info.magnolia.ui.form.field.transformer
Class TransformedProperty<T>

java.lang.Object
  extended by com.vaadin.data.util.AbstractProperty<T>
      extended by com.vaadin.data.util.ObjectProperty<T>
          extended by info.magnolia.ui.form.field.transformer.TransformedProperty<T>
All Implemented Interfaces:
com.vaadin.data.Property<T>, com.vaadin.data.Property.ReadOnlyStatusChangeNotifier, com.vaadin.data.Property.ValueChangeNotifier, Serializable

public class TransformedProperty<T>
extends com.vaadin.data.util.ObjectProperty<T>

Basic implementation of an ObjectProperty .
This base property delegate to the Transformer the read and write of the value used by the field.

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
TransformedProperty(Transformer<T> transformer)
          Creates a new instance of TransformedProperty with the given transformer.
The super ObjectProperty is initialized with:
- value = Transformer.readFromItem() in order to get the Item property value, - type = Transformer.getType(), the type of the value.
 
Method Summary
 void fireI18NValueChange()
          In case of i18n change, Reload the Value returned by the Handler.
 Transformer<T> getTransformer()
           
 T getValue()
           
 boolean hasI18NSupport()
           
 void setValue(T newValue)
           
 
Methods inherited from class com.vaadin.data.util.ObjectProperty
getType
 
Methods inherited from class com.vaadin.data.util.AbstractProperty
addListener, addListener, addReadOnlyStatusChangeListener, addValueChangeListener, fireReadOnlyStatusChange, fireValueChange, getListeners, isReadOnly, removeListener, removeListener, removeReadOnlyStatusChangeListener, removeValueChangeListener, setReadOnly, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TransformedProperty

public TransformedProperty(Transformer<T> transformer)
Creates a new instance of TransformedProperty with the given transformer.
The super ObjectProperty is initialized with:
- value = Transformer.readFromItem() in order to get the Item property value, - type = Transformer.getType(), the type of the value.

Parameters:
transformer - the relate Property Transformer.
Method Detail

setValue

public void setValue(T newValue)
              throws com.vaadin.data.Property.ReadOnlyException
Specified by:
setValue in interface com.vaadin.data.Property<T>
Overrides:
setValue in class com.vaadin.data.util.ObjectProperty<T>
Throws:
com.vaadin.data.Property.ReadOnlyException

getValue

public T getValue()
Specified by:
getValue in interface com.vaadin.data.Property<T>
Overrides:
getValue in class com.vaadin.data.util.ObjectProperty<T>

hasI18NSupport

public boolean hasI18NSupport()
Returns:
true if the handler support I18N.

fireI18NValueChange

public void fireI18NValueChange()
In case of i18n change, Reload the Value returned by the Handler.


getTransformer

public Transformer<T> getTransformer()


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