public class DatePicker extends TextButtonPanel<Date> implements CalendarListener<Calendar>, com.google.gwt.event.dom.client.HasChangeHandlers
Modifier and Type | Class and Description |
---|---|
protected class |
DatePicker.OpenCalendarClickHandler
This is an open calendar evbent handler implementation.
|
TextButtonPanel.EnterAction
Constructor and Description |
---|
DatePicker()
Creates an instance of this class and does nothing else.
|
DatePicker(Date initialDate)
Creates an instance of this class.
|
Modifier and Type | Method and Description |
---|---|
com.google.gwt.event.shared.HandlerRegistration |
addChangeHandler(com.google.gwt.event.dom.client.ChangeHandler handler) |
protected void |
addComponentListeners()
This method adds different listeners to elements of the widget.
|
com.google.gwt.event.shared.HandlerRegistration |
addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<Date> handler)
Adds a value change handler to the component that will be invoked only if
HasValue.setValue(Object, boolean) has the second parameter = true . |
void |
display()
Deprecated.
you don't have to invoke this method any more
|
protected Calendar |
getCalendar()
Getter for property 'calendar'.
|
protected com.google.gwt.user.client.ui.PopupPanel |
getCalendarPanel()
Getter for property 'calendarPanel'.
|
Date |
getDate()
Deprecated.
use
getValue() instead. |
protected String |
getDefaultImageName()
This method should returns a default button image name.
|
protected com.google.gwt.i18n.client.DateTimeFormat |
getFormat()
Getter for property 'format'.
|
String |
getTextualDate()
Gets a textual representation of the date using format properties.
|
Date |
getValue()
Similar to
getDate() |
boolean |
isTimeVisible()
Getter for property 'timeVisible'.
|
void |
onCancel(Calendar sender)
This method is invoked on cancel.
|
void |
onChange(Calendar sender,
Date oldValue)
This method is invoked when a user chooses a date.
|
protected void |
prepareSelectedValue()
Prepares the selected value box for displaying.
|
void |
setDate(Date date)
Deprecated.
use
setValue(Date) instead. |
void |
setFormat(String format)
Sets a format string for the displaying date and time.
|
void |
setTimeVisible(boolean timeVisible)
Setter for property 'timeVisible'.
|
void |
setValue(Date value)
Similar to
setDate(Date) and doesn't send any event |
void |
setValue(Date value,
boolean fireEvents)
|
cleanSelection, getChoiceButton, getChoiceButtonImage, getEnterAction, getHeight, getLayout, getLockingPanel, getMaxLength, getSelectedValue, getWidth, isChoiceButtonVisible, isCustomTextAllowed, isEnabled, isLocked, lock, prepareChoiceButton, setChoiceButtonImage, setChoiceButtonVisible, setCustomTextAllowed, setEnabled, setEnterAction, setHeight, setLocked, setMaxLength, setTabIndex, setWidth, unlock
add, getContainerElement, getWidget, iterator, remove, setWidget, setWidget
add, adopt, adopt, clear, disown, doAttachChildren, doDetachChildren, orphan, remove
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, sinkBitlessEvent, toString, unsinkEvents
public DatePicker()
public DatePicker(Date initialDate)
initialDate
- is an initial date.public boolean isTimeVisible()
public void setTimeVisible(boolean timeVisible)
timeVisible
- Value to set for property 'timeVisible'.public void onChange(Calendar sender, Date oldValue)
onChange
in interface CalendarListener<Calendar>
sender
- is a calendar which sent the event.oldValue
- is an old date value.public void onCancel(Calendar sender)
onCancel
in interface CalendarListener<Calendar>
sender
- is a calendar which sent the event.public com.google.gwt.event.shared.HandlerRegistration addChangeHandler(com.google.gwt.event.dom.client.ChangeHandler handler)
addChangeHandler
in interface com.google.gwt.event.dom.client.HasChangeHandlers
public Date getDate()
getValue()
instead.public void setDate(Date date)
setValue(Date)
instead.date
- is a date to set.public void display()
display
in interface AdvancedWidget
display
in class TextButtonPanel<Date>
public String getTextualDate()
public void setFormat(String format)
DateTimeFormat
class.format
- is a format string.public void setValue(Date value)
setDate(Date)
and doesn't send any eventpublic void setValue(Date value, boolean fireEvents)
setValue
in interface com.google.gwt.user.client.ui.HasValue<Date>
public com.google.gwt.event.shared.HandlerRegistration addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<Date> handler)
HasValue.setValue(Object, boolean)
has the second parameter = true
.
Note that the widget doesn't fire the event if you don't use the method specified above.addValueChangeHandler
in interface com.google.gwt.event.logical.shared.HasValueChangeHandlers<Date>
protected void prepareSelectedValue()
prepareSelectedValue
in class TextButtonPanel<Date>
protected String getDefaultImageName()
getDefaultImageName
in class TextButtonPanel<Date>
protected void addComponentListeners()
addComponentListeners
in class TextButtonPanel<Date>
protected Calendar getCalendar()
protected com.google.gwt.user.client.ui.PopupPanel getCalendarPanel()
protected com.google.gwt.i18n.client.DateTimeFormat getFormat()
Copyright © 2008–2013. All rights reserved.