|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.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.
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(Property propertyDataSource)
Method Detail |
---|
@Override Object convert(Object value)
@Override Class getType()
If no original datasource is set, then returns Date
@Override Object restore(Object value)
Groovy Documentation