public class DateBox extends com.google.gwt.user.client.ui.Composite implements com.google.gwt.user.client.ui.HasEnabled, com.google.gwt.user.client.ui.HasValue<Date>, com.google.gwt.editor.client.IsEditor<com.google.gwt.editor.client.LeafValueEditor<Date>>
| Modifier and Type | Class and Description |
|---|---|
static class |
DateBox.DefaultFormat
Default
DateBox.Format class. |
static interface |
DateBox.Format
Implemented by a delegate to handle the parsing and formating of date
values.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_STYLENAME
Default style name.
|
| Constructor and Description |
|---|
DateBox()
Create a date box with a new
DatePicker. |
DateBox(DatePicker picker,
Date date,
DateBox.Format format)
Create a new date box.
|
| Modifier and Type | Method and Description |
|---|---|
com.google.gwt.event.shared.HandlerRegistration |
addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<Date> handler) |
com.google.gwt.editor.client.LeafValueEditor<Date> |
asEditor()
Returns a
TakesValueEditor backed by the DateBox. |
int |
getCursorPos()
Gets the current cursor position in the date box.
|
DatePicker |
getDatePicker()
Gets the date picker.
|
boolean |
getFireNullValues()
Returns true iff the date box will fire
ValueChangeEvents with a
date value of null for invalid or empty string values. |
DateBox.Format |
getFormat()
Gets the format instance used to control formatting and parsing of this
DateBox. |
com.google.gwt.user.client.ui.PopupPanel |
getPopup() |
int |
getTabIndex()
Gets the date box's position in the tab index.
|
com.google.gwt.user.client.ui.TextBox |
getTextBox()
Get text box.
|
Date |
getValue()
Get the date displayed, or null if the text box is empty, or cannot be
interpreted.
|
void |
hideDatePicker()
Hide the date picker.
|
boolean |
isDatePickerShowing()
Returns true if date picker is currently showing, false if not.
|
boolean |
isEnabled()
Returns true if the date box is enabled, false if not.
|
void |
setAccessKey(char key)
Sets the date box's 'access key'.
|
void |
setEnabled(boolean enabled)
Sets whether the date box is enabled.
|
void |
setFireNullValues(boolean fireNullValues)
Sets whether or not the date box will fire
ValueChangeEvents with a
date value of null for invalid or empty string values. |
void |
setFocus(boolean focused)
Explicitly focus/unfocus this widget.
|
void |
setFormat(DateBox.Format format)
Sets the format used to control formatting and parsing of dates in this
DateBox. |
void |
setTabIndex(int index)
Sets the date box's position in the tab index.
|
void |
setValue(Date date)
Set the date.
|
void |
setValue(Date date,
boolean fireEvents) |
void |
showDatePicker()
Parses the current date box's value and shows that date.
|
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidgetaddAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEventsaddStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString, unsinkEventspublic static final String DEFAULT_STYLENAME
public DateBox()
DatePicker.public DateBox(DatePicker picker, Date date, DateBox.Format format)
date - the default date.picker - the picker to drop down from the date boxformat - to use to parse and format datespublic com.google.gwt.event.shared.HandlerRegistration addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<Date> handler)
addValueChangeHandler in interface com.google.gwt.event.logical.shared.HasValueChangeHandlers<Date>public com.google.gwt.editor.client.LeafValueEditor<Date> asEditor()
TakesValueEditor backed by the DateBox.asEditor in interface com.google.gwt.editor.client.IsEditor<com.google.gwt.editor.client.LeafValueEditor<Date>>public int getCursorPos()
public DatePicker getDatePicker()
public boolean getFireNullValues()
ValueChangeEvents with a
date value of null for invalid or empty string values.public DateBox.Format getFormat()
DateBox.public int getTabIndex()
public com.google.gwt.user.client.ui.TextBox getTextBox()
public Date getValue()
public void hideDatePicker()
public boolean isDatePickerShowing()
public boolean isEnabled()
isEnabled in interface com.google.gwt.user.client.ui.HasEnabledpublic void setAccessKey(char key)
key - the date box's access keypublic void setEnabled(boolean enabled)
setEnabled in interface com.google.gwt.user.client.ui.HasEnabledenabled - is the box enabledpublic void setFireNullValues(boolean fireNullValues)
ValueChangeEvents with a
date value of null for invalid or empty string values.public void setFocus(boolean focused)
focused - whether this widget should take focus or release itpublic void setFormat(DateBox.Format format)
DateBox. If this DateBox is not empty, the contents of date
box will be replaced with current contents in the new format.format - the new date formatpublic void setTabIndex(int index)
-1 will cause this widget to
be removed from the tab order.index - the date box's tab indexpublic void setValue(Date date)
public void setValue(Date date, boolean fireEvents)
setValue in interface com.google.gwt.user.client.ui.HasValue<Date>public void showDatePicker()
public com.google.gwt.user.client.ui.PopupPanel getPopup()
Copyright © 2014. All rights reserved.