com.extjs.gxt.ui.client.widget.form
Class DateTimePropertyEditor

java.lang.Object
  extended by com.extjs.gxt.ui.client.widget.form.DateTimePropertyEditor
All Implemented Interfaces:
PropertyEditor<java.util.Date>

public class DateTimePropertyEditor
extends java.lang.Object
implements PropertyEditor<java.util.Date>

A PropertyEditor implementation for Dates. This implementation delegates formatting and parsing the to the underlying @link DateTimeFormat. @link DateTimeFormat.getShortDateFormat() is the default format.

By default, strings are parsed with the @link DateTimeFormat.parse(String), to parse "strictly" use setParseStrict(boolean) to enable. When true, strings are parsed with @link DateTimeFormat.parseStrict(String).

See Also:
DateTimeFormat

Field Summary
protected  com.google.gwt.i18n.client.DateTimeFormat format
           
protected  boolean parseStrict
           
 
Fields inherited from interface com.extjs.gxt.ui.client.widget.form.PropertyEditor
DEFAULT
 
Constructor Summary
DateTimePropertyEditor()
          Creates a new date time property editor.
DateTimePropertyEditor(com.google.gwt.i18n.client.DateTimeFormat format)
          Creates a new date time property editor.
DateTimePropertyEditor(java.lang.String pattern)
          Creates a new date time property editor.
 
Method Summary
 java.util.Date convertStringValue(java.lang.String value)
          Converts a string to the typed value.
 com.google.gwt.i18n.client.DateTimeFormat getFormat()
          Returns the date time format.
 java.lang.String getStringValue(java.util.Date value)
          Returns the data as a string.
 boolean isParseStrict()
          Returns true if parsing stictly.
 void setFormat(com.google.gwt.i18n.client.DateTimeFormat format)
          Sets the date time format.
 void setParseStrict(boolean parseStrict)
          True to parse dates strictly (defaults to true).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

format

protected com.google.gwt.i18n.client.DateTimeFormat format

parseStrict

protected boolean parseStrict
Constructor Detail

DateTimePropertyEditor

public DateTimePropertyEditor()
Creates a new date time property editor.


DateTimePropertyEditor

public DateTimePropertyEditor(com.google.gwt.i18n.client.DateTimeFormat format)
Creates a new date time property editor.

Parameters:
format - the date time format

DateTimePropertyEditor

public DateTimePropertyEditor(java.lang.String pattern)
Creates a new date time property editor.

Parameters:
pattern - the pattern used to create a new @link DateTimeFormat.
Method Detail

convertStringValue

public java.util.Date convertStringValue(java.lang.String value)
Description copied from interface: PropertyEditor
Converts a string to the typed value.

Specified by:
convertStringValue in interface PropertyEditor<java.util.Date>
Parameters:
value - the string value
Returns:
the type value or null if value cannot be converted

getFormat

public com.google.gwt.i18n.client.DateTimeFormat getFormat()
Returns the date time format.

Returns:
the date time format

getStringValue

public java.lang.String getStringValue(java.util.Date value)
Description copied from interface: PropertyEditor
Returns the data as a string.

Specified by:
getStringValue in interface PropertyEditor<java.util.Date>
Parameters:
value - the typed value
Returns:
the value as a string

isParseStrict

public boolean isParseStrict()
Returns true if parsing stictly.

Returns:
the parse strict state

setFormat

public void setFormat(com.google.gwt.i18n.client.DateTimeFormat format)
Sets the date time format.

Parameters:
format - the format

setParseStrict

public void setParseStrict(boolean parseStrict)
True to parse dates strictly (defaults to true). See @link DateTimeFormat.parseStrict(String).

Parameters:
parseStrict - true to parse strictly