public class DatePicker extends com.google.gwt.user.client.ui.Composite implements CruxWidget
| Constructor and Description |
|---|
DatePicker() |
| Modifier and Type | Method and Description |
|---|---|
com.google.gwt.event.shared.HandlerRegistration |
addHighlightHandler(com.google.gwt.event.logical.shared.HighlightHandler<Date> handler) |
com.google.gwt.event.shared.HandlerRegistration |
addShowRangeHandler(com.google.gwt.event.logical.shared.ShowRangeHandler<Date> handler) |
com.google.gwt.event.shared.HandlerRegistration |
addShowRangeHandlerAndFire(com.google.gwt.event.logical.shared.ShowRangeHandler<Date> handler)
Adds a show range handler and immediately activate the handler on the
current view.
|
void |
addStyleToDates(String styleName,
Date date)
Add a style name to the given dates.
|
void |
addStyleToDates(String styleName,
Date date,
Date... moreDates)
Add a style name to the given dates.
|
void |
addStyleToDates(String styleName,
Date initDate,
Date finalDate)
Add a style name to the given dates.
|
void |
addStyleToDates(String styleName,
Iterable<Date> dates)
Add a style name to the given dates.
|
void |
addTransientStyleToDates(String styleName,
Date date)
Adds the given style name to the specified dates, which must be visible.
|
void |
addTransientStyleToDates(String styleName,
Date date,
Date... moreDates)
Adds the given style name to the specified dates, which must be visible.
|
void |
addTransientStyleToDates(String styleName,
Iterable<Date> dates)
Adds the given style name to the specified dates, which must be visible.
|
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 DatePicker. |
String |
getBaseStyleName() |
Date |
getCurrentMonth()
Gets the current month the date picker is showing.
|
Date |
getFirstDate()
Returns the first shown date.
|
Date |
getHighlightedDate()
Gets the highlighted date (the one the mouse is hovering over), if any.
|
Date |
getLastDate()
Returns the last shown date.
|
protected org.cruxframework.crux.widgets.client.datepicker.GWTOverriddenCalendarModel |
getModel()
Gets the
GWTOverriddenCalendarModel associated with this date picker. |
org.cruxframework.crux.widgets.client.datepicker.GWTOverriddenMonthSelector |
getMonthSelector()
Gets the
GWTOverriddenMonthSelector associated with this date picker. |
Date |
getMonthToOpen() |
String |
getStyleOfDate(Date date)
Gets the style associated with a date (does not include styles set via
addTransientStyleToDates(java.lang.String, java.util.Date)). |
Date |
getValue()
Returns the selected date, or null if none is selected.
|
org.cruxframework.crux.widgets.client.datepicker.GWTOverriddenCalendarView |
getView()
Gets the
GWTOverriddenCalendarView associated with this date picker. |
int |
getVisibleYearCount()
Returns the number of year to display in the years selection dropdown.
|
boolean |
isDateEnabled(Date date)
Is the visible date enabled?
|
boolean |
isDateVisible(Date date)
Is the date currently shown in the date picker?
|
boolean |
isYearAndMonthDropdownVisible()
Is the year and month selectable via a dropdown?
|
boolean |
isYearArrowsVisible()
Can the user navigate through the years?
|
void |
onLoad() |
protected void |
refreshAll()
Refreshes all components of this date picker.
|
void |
removeStyleFromDates(String styleName,
Date date)
Removes the styleName from the given dates (even if it is transient).
|
void |
removeStyleFromDates(String styleName,
Date date,
Date... moreDates)
Removes the styleName from the given dates (even if it is transient).
|
void |
removeStyleFromDates(String styleName,
Iterable<Date> dates)
Removes the styleName from the given dates (even if it is transient).
|
void |
setCurrentMonth(Date month)
Sets the date picker to show the given month, use
getFirstDate()
and getLastDate() to access the exact date range the date picker
chose to display. |
void |
setMonthToOpen(Date monthToOpen) |
void |
setStyleName(String styleName)
Sets the date picker style name.
|
void |
setTransientEnabledOnDates(boolean enabled,
Date date)
Sets a visible date to be enabled or disabled.
|
void |
setTransientEnabledOnDates(boolean enabled,
Date date,
Date... moreDates)
Sets a visible date to be enabled or disabled.
|
void |
setTransientEnabledOnDates(boolean enabled,
Iterable<Date> dates)
Sets a group of visible dates to be enabled or disabled.
|
protected void |
setup()
Sets up the date picker.
|
void |
setValue(Date newValue)
Sets the
GWTOverriddenDatePicker's value. |
void |
setValue(Date newValue,
boolean fireEvents)
Sets the
GWTOverriddenDatePicker's value. |
void |
setVisibleYearCount(int numberOfYears)
Set the number of years to display in the years selection dropdown.
|
void |
setYearAndMonthDropdownVisible(boolean dropdownVisible)
If the
dropdownVisible is equal to true, the user will be able to change the current month and
the current year of the date picker via two dropdown lists. |
void |
setYearArrowsVisible(boolean yearArrowsVisible)
Set if the user can navigate through the years via a set of backward and forward buttons.
|
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, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEventsaddStyleDependentName, 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, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toStringpublic String getBaseStyleName()
getBaseStyleName in interface CruxWidgetpublic void addStyleToDates(String styleName, Date initDate, Date finalDate)
public Date getMonthToOpen()
public void setMonthToOpen(Date monthToOpen)
public com.google.gwt.event.shared.HandlerRegistration addHighlightHandler(com.google.gwt.event.logical.shared.HighlightHandler<Date> handler)
addHighlightHandler in interface com.google.gwt.event.logical.shared.HasHighlightHandlers<Date>public com.google.gwt.event.shared.HandlerRegistration addShowRangeHandler(com.google.gwt.event.logical.shared.ShowRangeHandler<Date> handler)
addShowRangeHandler in interface com.google.gwt.event.logical.shared.HasShowRangeHandlers<Date>public com.google.gwt.event.shared.HandlerRegistration addShowRangeHandlerAndFire(com.google.gwt.event.logical.shared.ShowRangeHandler<Date> handler)
handler - the handlerpublic void addStyleToDates(String styleName, Date date)
public void addStyleToDates(String styleName, Date date, Date... moreDates)
public void addStyleToDates(String styleName, Iterable<Date> dates)
public void addTransientStyleToDates(String styleName, Date date)
public final void addTransientStyleToDates(String styleName, Date date, Date... moreDates)
public final void addTransientStyleToDates(String styleName, Iterable<Date> dates)
public 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 DatePicker.asEditor in interface com.google.gwt.editor.client.IsEditor<com.google.gwt.editor.client.LeafValueEditor<Date>>public Date getCurrentMonth()
A datepicker may show days not in the current month. It must show all days in the current month.
public final Date getFirstDate()
public final Date getHighlightedDate()
public final Date getLastDate()
public int getVisibleYearCount()
public String getStyleOfDate(Date date)
addTransientStyleToDates(java.lang.String, java.util.Date)).date - the datepublic final Date getValue()
public boolean isDateEnabled(Date date)
date - the date, which must be visiblepublic boolean isDateVisible(Date date)
date - public boolean isYearArrowsVisible()
public boolean isYearAndMonthDropdownVisible()
public void onLoad()
onLoad in class com.google.gwt.user.client.ui.Widgetpublic void removeStyleFromDates(String styleName, Date date)
public void removeStyleFromDates(String styleName, Date date, Date... moreDates)
public void removeStyleFromDates(String styleName, Iterable<Date> dates)
public void setCurrentMonth(Date month)
getFirstDate()
and getLastDate() to access the exact date range the date picker
chose to display.
A datepicker may show days not in the current month. It must show all days in the current month.
month - the month to showpublic void setVisibleYearCount(int numberOfYears)
public void setYearArrowsVisible(boolean yearArrowsVisible)
public void setYearAndMonthDropdownVisible(boolean dropdownVisible)
dropdownVisible is equal to true, the user will be able to change the current month and
the current year of the date picker via two dropdown lists.public void setStyleName(String styleName)
setStyleName in class com.google.gwt.user.client.ui.UIObjectpublic final void setTransientEnabledOnDates(boolean enabled,
Date date)
public final void setTransientEnabledOnDates(boolean enabled,
Date date,
Date... moreDates)
public final void setTransientEnabledOnDates(boolean enabled,
Iterable<Date> dates)
public final void setValue(Date newValue)
GWTOverriddenDatePicker's value.public final void setValue(Date newValue, boolean fireEvents)
GWTOverriddenDatePicker's value.setValue in interface com.google.gwt.user.client.ui.HasValue<Date>newValue - the new value for this date pickerfireEvents - should events be fired.protected final org.cruxframework.crux.widgets.client.datepicker.GWTOverriddenCalendarModel getModel()
GWTOverriddenCalendarModel associated with this date picker.public final org.cruxframework.crux.widgets.client.datepicker.GWTOverriddenMonthSelector getMonthSelector()
GWTOverriddenMonthSelector associated with this date picker.public final org.cruxframework.crux.widgets.client.datepicker.GWTOverriddenCalendarView getView()
GWTOverriddenCalendarView associated with this date picker.protected final void refreshAll()
protected void setup()
Copyright © 2014. All rights reserved.