org.spiffyui.client.widgets
Class DatePickerTextBox

java.lang.Object
  extended by TextBox
      extended by org.spiffyui.client.widgets.DatePickerTextBox

public class DatePickerTextBox
extends TextBox

This widget uses a simple GWT TextBox and attaches the JQuery UI date picker. When the field gets focus the date picker will become visible.


Constructor Summary
DatePickerTextBox()
          Create a DatePickerTextBox with a rendomly generated ID.
DatePickerTextBox(java.lang.String id)
          Create a DatePickerTextBox with the specified ID.
 
Method Summary
 java.util.Date getDateValue()
          Get the value as a type-safe java.util.Date
 java.lang.String getMaximumDate()
          Gets the minimum date specifier for this date picker
 java.lang.String getMinimumDate()
          Gets the minimum date specifier for this date picker
 boolean isEmpty()
          Convenience method to determine if the value is empty since getDateValue will return null for empty as well as unparseable.
 void onLoad()
           
protected  void onUnload()
           
 void setDateValue(java.util.Date date)
          Sets the current Date value
 void setMaximumDate(java.util.Date date)
          Set a maximum selectable date via a java.util.Date object
 void setMaximumDate(java.lang.String dateSpecifier)
          Set a maximum selectable date via a Date object or as a string in the current dateFormat, or a number of days from today (e.g.
 void setMinimumDate(java.util.Date date)
          Set a minimum selectable date via a java.util.Date object
 void setMinimumDate(java.lang.String dateSpecifier)
          Set a minimum selectable date via a Date object or as a string in the current dateFormat, or a number of days from today (e.g.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatePickerTextBox

public DatePickerTextBox()
Create a DatePickerTextBox with a rendomly generated ID. The ID is required because the JQuery data picker needs a specific ID to connect to.


DatePickerTextBox

public DatePickerTextBox(java.lang.String id)
Create a DatePickerTextBox with the specified ID. The ID is required because the JQuery data picker needs a specific ID to connect to.

Parameters:
id - the id for the text box
Method Detail

onLoad

public void onLoad()

onUnload

protected void onUnload()

setMinimumDate

public void setMinimumDate(java.lang.String dateSpecifier)
Set a minimum selectable date via a Date object or as a string in the current dateFormat, or a number of days from today (e.g. +7) or a string of values and periods ('y' for years, 'm' for months, 'w' for weeks, 'd' for days, e.g. '-1y -1m'), or null for no limit. Code examples setMinimumDate("-20"); setMinimumDate("+1M +10D");

Parameters:
dateSpecifier - the date specifier

setMinimumDate

public void setMinimumDate(java.util.Date date)
Set a minimum selectable date via a java.util.Date object

Parameters:
date - the date specifier

getMinimumDate

public java.lang.String getMinimumDate()
Gets the minimum date specifier for this date picker

Returns:
the minimum date specifier

setMaximumDate

public void setMaximumDate(java.lang.String dateSpecifier)
Set a maximum selectable date via a Date object or as a string in the current dateFormat, or a number of days from today (e.g. +7) or a string of values and periods ('y' for years, 'm' for months, 'w' for weeks, 'd' for days, e.g. '-1y -1m'), or null for no limit. Code examples setMaximumDate("-20"); setMaximumDate("+1M +10D");

Parameters:
dateSpecifier - the date specifier

setMaximumDate

public void setMaximumDate(java.util.Date date)
Set a maximum selectable date via a java.util.Date object

Parameters:
date - the date specifier

getMaximumDate

public java.lang.String getMaximumDate()
Gets the minimum date specifier for this date picker

Returns:
the minimum date specifier

getDateValue

public java.util.Date getDateValue()
Get the value as a type-safe java.util.Date

Returns:
the value in the TextBox as a java.util.Date or null if it was unparseable.

setDateValue

public void setDateValue(java.util.Date date)
Sets the current Date value

Parameters:
date - the date value to set

isEmpty

public boolean isEmpty()
Convenience method to determine if the value is empty since getDateValue will return null for empty as well as unparseable.

Returns:
boolean true if empty