R - the resolution type which this field is based on (day, month, ...)public abstract class VDateField<R extends Enum<R>> extends com.google.gwt.user.client.ui.FlowPanel implements Field, com.google.gwt.user.client.ui.HasEnabled
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled| Modifier and Type | Field and Description |
|---|---|
static String |
CLASSNAME |
ApplicationConnection |
client
For internal use only.
|
protected String |
currentLocale |
DateTimeService |
dts
For internal use only.
|
protected boolean |
enabled |
String |
paintableId
For internal use only.
|
protected boolean |
readonly |
protected boolean |
showISOWeekNumbers |
| Constructor and Description |
|---|
VDateField(R resolution) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract R[] |
doGetResolutions()
Returns all available resolutions as an array.
|
ApplicationConnection |
getClient() |
Date |
getCurrentDate() |
String |
getCurrentLocale() |
R |
getCurrentResolution() |
Date |
getDate()
Returns a copy of the current date.
|
protected abstract Date |
getDate(Map<R,Integer> dateValues)
Returns a date based on the provided date values map.
|
DateTimeService |
getDateTimeService() |
String |
getId() |
Stream<R> |
getResolutions()
Returns all available resolutions for the field in the ascending order
(which is the same as order of enumeration ordinals).
|
String |
getResolutionVariable(R resolution)
Returns a resolution variable name for the given
resolution. |
boolean |
isEnabled() |
boolean |
isReadonly() |
boolean |
isShowISOWeekNumbers()
Returns whether ISO 8601 week numbers should be shown in the date
selector or not.
|
abstract boolean |
isYear(R resolution)
Checks whether the given
resolution represents an year. |
abstract String |
resolutionAsString()
Returns a current resolution as a string.
|
void |
setCurrentDate(Date date) |
void |
setCurrentDate(Map<R,Integer> dateValues)
Set the current date using a map with date values.
|
void |
setCurrentLocale(String currentLocale) |
void |
setCurrentResolution(R currentResolution) |
protected void |
setDate(Date date)
Sets the current date for this VDateField.
|
void |
setEnabled(boolean enabled) |
void |
setReadonly(boolean readonly) |
void |
setShowISOWeekNumbers(boolean showISOWeekNumbers) |
add, add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getChildren, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, insert, insert, iterator, remove, removeadd, adopt, doAttachChildren, doDetachChildren, orphan, removeaddAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, onLoad, 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, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetWidgetIndexgetWidget, getWidgetCount, getWidgetIndex, removeforEach, spliteratorpublic static final String CLASSNAME
public String paintableId
public ApplicationConnection client
protected String currentLocale
protected boolean readonly
protected boolean enabled
public DateTimeService dts
protected boolean showISOWeekNumbers
public VDateField(R resolution)
public R getCurrentResolution()
public void setCurrentResolution(R currentResolution)
public String getCurrentLocale()
public void setCurrentLocale(String currentLocale)
public Date getCurrentDate()
public void setCurrentDate(Date date)
public void setCurrentDate(Map<R,Integer> dateValues)
The map contains integer representation of values per resolution. The
method should construct a date based on the map and set it via
setCurrentDate(Date)
dateValues - a map with date values to convert into a datepublic boolean isReadonly()
public void setReadonly(boolean readonly)
public boolean isEnabled()
isEnabled in interface com.google.gwt.user.client.ui.HasEnabledpublic void setEnabled(boolean enabled)
setEnabled in interface com.google.gwt.user.client.ui.HasEnabledpublic DateTimeService getDateTimeService()
public String getId()
public ApplicationConnection getClient()
public boolean isShowISOWeekNumbers()
public void setShowISOWeekNumbers(boolean showISOWeekNumbers)
public Date getDate()
setDate(Date) to change
the current date.
For internal use only. May be removed or replaced in the future.
protected void setDate(Date date)
date - The new date to usepublic String getResolutionVariable(R resolution)
resolution.resolution - the given resolutionpublic Stream<R> getResolutions()
The method uses doGetResolutions() to make sure that the order
is the correct one.
doGetResolutions()public abstract String resolutionAsString()
The method is used to generate a style name for the current resolution.
public abstract boolean isYear(R resolution)
resolution represents an year.resolution - the given resolutiontrue if the resolution represents an yearprotected abstract Date getDate(Map<R,Integer> dateValues)
dateValues - a map with date values to convert into a datesetCurrentDate(Map)protected abstract R[] doGetResolutions()
No any order is required (in contrary to getResolutions().
getResolutions()Copyright © 2017 Vaadin Ltd. All rights reserved.