Groovy Documentation

org.grails.plugin.vaadin.utils
[Groovy] Class CalendarPropertyConverter

java.lang.Object
  com.vaadin.data.util.AbstractProperty
      org.grails.plugin.vaadin.utils.PropertyConverter
          org.grails.plugin.vaadin.utils.CalendarPropertyConverter

@SuppressWarnings("unchecked")
class CalendarPropertyConverter
extends PropertyConverter

Makes a Calendar property look an behave like a Date property.

This allows a Calendar-type property to be used with the DateField component, which only supports Date properties.

Authors:
Francis McKenzie


Constructor Summary
CalendarPropertyConverter()

Initialise empty

CalendarPropertyConverter(Property propertyDataSource)

Initialise with data source

 
Method Summary
Object convert(Object value)

Converts value to Date if is Calendar, otherwise just returns value unchanged

Class getType()

If class of original datasource is Calendar then returns Date, else returns original datasource's class unchanged.

Object restore(Object value)

Restores value to Calendar if is Date and underlying datasource type is Calendar, otherwise just returns value unchanged

 
Methods inherited from class PropertyConverter
convert, getPropertyDataSource, getType, getValue, isReadOnly, readOnlyStatusChange, restore, setPropertyDataSource, setReadOnly, setValue, toString, valueChange
 
Methods inherited from class AbstractProperty
toString, setReadOnly, isReadOnly, getListeners, addListener, addListener, removeListener, removeListener, wait, wait, wait, equals, hashCode, getClass, notify, notifyAll, getValue, getType, setValue
 

Constructor Detail

CalendarPropertyConverter

CalendarPropertyConverter()
Initialise empty


CalendarPropertyConverter

CalendarPropertyConverter(Property propertyDataSource)
Initialise with data source


 
Method Detail

convert

@Override
Object convert(Object value)
Converts value to Date if is Calendar, otherwise just returns value unchanged


getType

@Override
Class getType()
If class of original datasource is Calendar then returns Date, else returns original datasource's class unchanged.

If no original datasource is set, then returns Date


restore

@Override
Object restore(Object value)
Restores value to Calendar if is Date and underlying datasource type is Calendar, otherwise just returns value unchanged


 

Groovy Documentation