com.gwtext.client.widgets
Class DatePicker

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.gwtext.client.widgets.Component
              extended by com.gwtext.client.widgets.DatePicker
All Implemented Interfaces:
com.google.gwt.user.client.EventListener, Observable

public class DatePicker
extends Component

Simple date picker class.


Field Summary
 
Fields inherited from class com.gwtext.client.widgets.Component
config, id
 
Constructor Summary
DatePicker()
          Create a new DatePicker.
DatePicker(com.google.gwt.core.client.JavaScriptObject jsObj)
           
 
Method Summary
 void addListener(DatePickerListener listener)
          Add a Date Picker Listener.
protected  com.google.gwt.core.client.JavaScriptObject create(com.google.gwt.core.client.JavaScriptObject config)
           
protected  com.google.gwt.core.client.JavaScriptObject getConfigPrototype()
           
 boolean getConstrainToViewport()
           
 java.lang.String getDisabledDatesText()
          The tooltip text to display when the date falls on a disabled date (defaults to "").
 java.lang.String[] getDisabledDays()
          An array of days to disable, 0-based.
 java.lang.String getDisabledDaysText()
          The tooltip to display when the date falls on a disabled day (defaults to "").
 java.lang.String getFormat()
          The default date format string which can be overriden for localization support.
 java.util.Date getMaxDate()
          Maximum allowable date.
 java.lang.String getMaxText()
          The error text to display if the maxDate validation fails (defaults to "This date is after the maximum date").
 java.util.Date getMinDate()
          Minimum allowable date.
 java.lang.String getMinText()
          The error text to display if the minDate validation fails (defaults to "This date is before the minimum date").
 java.lang.String[] getMonthNames()
          An array of textual month names which can be overriden for localization support.
 java.lang.String getMonthYearText()
          The header month selector tooltip (defaults to 'Choose a month (Control+Up/Down to move years)').
 java.lang.String getNextText()
          The next month navigation button tooltip (defaults to 'Next Month (Control+Right)').
 java.lang.String getOkText()
          The text to display on the ok button.
 java.lang.String getPrevText()
          The previous month navigation button tooltip (defaults to 'Previous Month (Control+Left)').
 int getStartDay()
          Day index at which the week should begin, 0-based (defaults to 0, which is Sunday).
 java.lang.String getTodayText()
          The text to display on the button that selects the current date (defaults to "Today").
 java.lang.String getTodayTip()
          The tooltip to display for the button that selects the current date (defaults to "{current date} (Spacebar)").
 java.util.Date getValue()
          Get the value of the date picker.
 java.lang.String getXType()
          Gets the xtype for this component as registered with ComponentMgr.
 void setConstrainToViewport(boolean constrainToViewport)
          True to constrain the date picker to the viewport (defaults to true).
 void setDisabledDatesRE(java.lang.String disabledDatesRE)
          Regular expression used to disable a pattern of dates.
 void setDisabledDatesText(java.lang.String disabledDatesText)
          The tooltip text to display when the date falls on a disabled date (defaults to "").
 void setDisabledDays(java.lang.String[] disabledDays)
          An array of days to disable, 0-based.
 void setDisabledDaysText(java.lang.String disabledDaysText)
          The tooltip to display when the date falls on a disabled day (defaults to "")
 void setFormat(java.lang.String format)
          The default date format string which can be overriden for localization support.
 void setMaxDate(java.util.Date maxDate)
          Maximum allowable date.
 void setMaxText(java.lang.String maxText)
          The error text to display if the maxDate validation fails (defaults to "This date is after the maximum date").
 void setMinDate(java.util.Date minDate)
          Minimum allowable date.
 void setMinText(java.lang.String minText)
          The error text to display if the minDate validation fails (defaults to "This date is before the minimum date").
 void setMonthNames(java.lang.String[] monthNames)
          An array of textual month names which can be overriden for localization support.
 void setMonthYearText(java.lang.String monthYearText)
          The header month selector tooltip (defaults to 'Choose a month (Control+Up/Down to move years)').
 void setNextText(java.lang.String nextText)
          The next month navigation button tooltip (defaults to 'Next Month (Control+Right)').
 void setOkText(java.lang.String okText)
          The text to display on the ok button.
 void setPrevText(java.lang.String prevText)
          The previous month navigation button tooltip (defaults to 'Previous Month (Control+Left)').
 void setStartDay(int startDay)
          Day index at which the week should begin, 0-based (defaults to 0, which is Sunday).
 void setTodayText(java.lang.String todayText)
          The text to display on the button that selects the current date (defaults to "Today").
 void setTodayTip(java.lang.String todayTip)
          The tooltip to display for the button that selects the current date (defaults to "{current date} (Spacebar)").
 void setValue(java.util.Date date)
          Set the value of the date picker.
 
Methods inherited from class com.gwtext.client.widgets.Component
addClass, addClassCreated, addEvent, addEvents, addListener, addListener, addListener, addPlugin, addStyleDependentName, addStyleName, afterRender, beforeDestroy, check, checkExtVer, cloneComponent, cloneComponent, cloneConfig, destroy, disable, enable, equals, error, findParentBy, findParentByType, fireEvent, focus, focus, focus, getApplyTo, getAttribute, getAttributeAsBoolean, getAttributeAsFloat, getAttributeAsInt, getAttributeAsJavaScriptObject, getAutoShow, getCls, getComponentJS, getConfig, getConfigAsString, getCtCls, getDisabledClass, getEl, getElement, getElement, getElement, getHideMode, getHideParent, getId, getItemId, getJsObj, getOffsetHeight, getOffsetWidth, getOrCreateJsObj, getOwnerContainer, getRenderTo, getStateEvents, getStateId, getTitle, getXTypes, hashCode, hide, initComponent, isCreated, isDisabled, isHidden, isRendered, isVisible, isXType, isXType, onDestroy, purgeListeners, removeClass, removeStyleDependentName, removeStyleName, render, render, render, render, render, render, resumeEvents, setApplyTo, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAutoEl, setAutoEl, setAutoShow, setCls, setCtCls, setDisabled, setDisabledClass, setEl, setEl, setElement, setHeight, setHideMode, setHideParent, setId, setRenderTo, setRenderToID, setStateEvents, setStateId, setStyle, setStyle, setStyleName, setStylePrimaryName, setTitle, setVisible, setWidth, show, suspendEvents, toString
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
doAttachChildren, doDetachChildren, getParent, isAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
getAbsoluteLeft, getAbsoluteTop, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, setPixelSize, setSize, setStyleName, setStyleName, setStylePrimaryName, setVisible, sinkEvents, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DatePicker

public DatePicker()
Create a new DatePicker.


DatePicker

public DatePicker(com.google.gwt.core.client.JavaScriptObject jsObj)
Method Detail

getConfigPrototype

protected com.google.gwt.core.client.JavaScriptObject getConfigPrototype()
Specified by:
getConfigPrototype in class Component

getXType

public java.lang.String getXType()
Description copied from class: Component
Gets the xtype for this component as registered with ComponentMgr. For a list of all available xtypes, see the Component javadocs.

 
 

TextField field = new TextField(); field.getXType() returns "textfield"

Overrides:
getXType in class Component
Returns:
the xtype

create

protected com.google.gwt.core.client.JavaScriptObject create(com.google.gwt.core.client.JavaScriptObject config)
Specified by:
create in class Component

getValue

public java.util.Date getValue()
Get the value of the date picker.

Returns:
null if no value selected

setValue

public void setValue(java.util.Date date)
Set the value of the date picker.

Parameters:
date - the date

addListener

public void addListener(DatePickerListener listener)
Add a Date Picker Listener.

Parameters:
listener - the listener

setConstrainToViewport

public void setConstrainToViewport(boolean constrainToViewport)
                            throws java.lang.IllegalStateException
True to constrain the date picker to the viewport (defaults to true).

Parameters:
constrainToViewport - true to constrain to view port
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

getConstrainToViewport

public boolean getConstrainToViewport()
Returns:
true if constrin to viewport

setDisabledDatesRE

public void setDisabledDatesRE(java.lang.String disabledDatesRE)
                        throws java.lang.IllegalStateException
Regular expression used to disable a pattern of dates.

Parameters:
disabledDatesRE - regular expression to disable dates
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

setDisabledDatesText

public void setDisabledDatesText(java.lang.String disabledDatesText)
                          throws java.lang.IllegalStateException
The tooltip text to display when the date falls on a disabled date (defaults to "").

Parameters:
disabledDatesText - disabled dates text
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

getDisabledDatesText

public java.lang.String getDisabledDatesText()
The tooltip text to display when the date falls on a disabled date (defaults to "").

Returns:
the disabled dates text

setDisabledDays

public void setDisabledDays(java.lang.String[] disabledDays)
                     throws java.lang.IllegalStateException
An array of days to disable, 0-based. For example, [0, 6] disables Sunday and Saturday.

Parameters:
disabledDays - dates to disable
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

getDisabledDays

public java.lang.String[] getDisabledDays()
An array of days to disable, 0-based. For example, [0, 6] disables Sunday and Saturday.

Returns:
the disabled days

setDisabledDaysText

public void setDisabledDaysText(java.lang.String disabledDaysText)
                         throws java.lang.IllegalStateException
The tooltip to display when the date falls on a disabled day (defaults to "")

Parameters:
disabledDaysText - disabled days text
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

getDisabledDaysText

public java.lang.String getDisabledDaysText()
The tooltip to display when the date falls on a disabled day (defaults to "").

Returns:
the disabled days text

setFormat

public void setFormat(java.lang.String format)
               throws java.lang.IllegalStateException
The default date format string which can be overriden for localization support. The format must be a valid pattern (defaults to 'm/d/y').

Parameters:
format - the date format
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered
See Also:
DateUtil

getFormat

public java.lang.String getFormat()
The default date format string which can be overriden for localization support. The format must be a valid pattern (defaults to 'm/d/y').

Returns:
the date format

setMaxDate

public void setMaxDate(java.util.Date maxDate)
                throws java.lang.IllegalStateException
Maximum allowable date.

Parameters:
maxDate - the max date
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

getMaxDate

public java.util.Date getMaxDate()
Maximum allowable date.

Returns:
the max date

setMaxText

public void setMaxText(java.lang.String maxText)
                throws java.lang.IllegalStateException
The error text to display if the maxDate validation fails (defaults to "This date is after the maximum date").

Parameters:
maxText - the max error text
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

getMaxText

public java.lang.String getMaxText()
The error text to display if the maxDate validation fails (defaults to "This date is after the maximum date").

Returns:
the error text to display if the maxDate validation fails

setMinDate

public void setMinDate(java.util.Date minDate)
                throws java.lang.IllegalStateException
Minimum allowable date.

Parameters:
minDate - the min date
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

getMinDate

public java.util.Date getMinDate()
Minimum allowable date.

Returns:
the min date

setMinText

public void setMinText(java.lang.String minText)
                throws java.lang.IllegalStateException
The error text to display if the minDate validation fails (defaults to "This date is before the minimum date").

Parameters:
minText - the min error text
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

getMinText

public java.lang.String getMinText()
The error text to display if the minDate validation fails (defaults to "This date is before the minimum date").

Returns:
the error text to display if the minDate validation fails

setMonthNames

public void setMonthNames(java.lang.String[] monthNames)
                   throws java.lang.IllegalStateException
An array of textual month names which can be overriden for localization support.

Parameters:
monthNames - the month names
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

getMonthNames

public java.lang.String[] getMonthNames()
An array of textual month names which can be overriden for localization support.

Returns:
the month names

setMonthYearText

public void setMonthYearText(java.lang.String monthYearText)
                      throws java.lang.IllegalStateException
The header month selector tooltip (defaults to 'Choose a month (Control+Up/Down to move years)').

Parameters:
monthYearText - the header month tooltip text
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

getMonthYearText

public java.lang.String getMonthYearText()
The header month selector tooltip (defaults to 'Choose a month (Control+Up/Down to move years)').

Returns:
the header month selector tooltip text

setNextText

public void setNextText(java.lang.String nextText)
                 throws java.lang.IllegalStateException
The next month navigation button tooltip (defaults to 'Next Month (Control+Right)').

Parameters:
nextText - the next button tooltip text
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

getNextText

public java.lang.String getNextText()
The next month navigation button tooltip (defaults to 'Next Month (Control+Right)').

Returns:
the next month navigation button tooltip

setOkText

public void setOkText(java.lang.String okText)
               throws java.lang.IllegalStateException
The text to display on the ok button.

Parameters:
okText - the OK text
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

getOkText

public java.lang.String getOkText()
The text to display on the ok button.

Returns:
the text for the ok button

setPrevText

public void setPrevText(java.lang.String prevText)
                 throws java.lang.IllegalStateException
The previous month navigation button tooltip (defaults to 'Previous Month (Control+Left)').

Parameters:
prevText - the previous month tooltip text
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

getPrevText

public java.lang.String getPrevText()
The previous month navigation button tooltip (defaults to 'Previous Month (Control+Left)').

Returns:
the previous month navigation button tooltip

setStartDay

public void setStartDay(int startDay)
                 throws java.lang.IllegalStateException
Day index at which the week should begin, 0-based (defaults to 0, which is Sunday).

Parameters:
startDay - the start day
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

getStartDay

public int getStartDay()
Day index at which the week should begin, 0-based (defaults to 0, which is Sunday).

Returns:
the day index at which the week should begin, 0-based

setTodayText

public void setTodayText(java.lang.String todayText)
                  throws java.lang.IllegalStateException
The text to display on the button that selects the current date (defaults to "Today").

Parameters:
todayText - the today text
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

getTodayText

public java.lang.String getTodayText()
The text to display on the button that selects the current date (defaults to "Today").

Returns:
the text to display on the button that selects the current date

setTodayTip

public void setTodayTip(java.lang.String todayTip)
                 throws java.lang.IllegalStateException
The tooltip to display for the button that selects the current date (defaults to "{current date} (Spacebar)").

Parameters:
todayTip - the tooltip for current date
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

getTodayTip

public java.lang.String getTodayTip()
The tooltip to display for the button that selects the current date (defaults to "{current date} (Spacebar)").

Returns:
the tooltip to display for the button that selects the current date