R - the resolution type which this field is based on (day, month, ...)public abstract class VAbstractTextualDate<R extends Enum<R>> extends VDateField<R> implements com.google.gwt.event.dom.client.ChangeHandler, Focusable, SubPartAware, HandlesAriaCaption, HandlesAriaInvalid, HandlesAriaRequired, com.google.gwt.event.dom.client.KeyDownHandler
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled| Modifier and Type | Field and Description |
|---|---|
boolean |
lenient
For internal use only.
|
com.google.gwt.user.client.ui.TextBox |
text
For internal use only.
|
bufferedDateString, bufferedResolutions, CLASSNAME, client, connector, currentLocale, dts, enabled, readonly, rpc, showISOWeekNumbers| Constructor and Description |
|---|
VAbstractTextualDate(R resoluton) |
| Modifier and Type | Method and Description |
|---|---|
void |
bindAriaCaption(com.google.gwt.user.client.Element captionElement)
Called to bind the provided caption (label in HTML speak) element to the
main input element of the Widget.
|
void |
buildDate()
Updates the text field according to the current date (provided by
VDateField.getDate()). |
protected void |
checkGroupFocus(boolean textFocus)
Checks if the group focus has changed, and sends to the server if needed.
|
protected String |
cleanFormat(String format)
Clean date format string to make it suitable for
getFormatString(). |
protected String |
createFormatString()
Create a format string suitable for the widget in its current state.
|
void |
focus()
Sets focus to this widget.
|
String |
getFormatString()
Gets the date format string for the current locale.
|
String |
getISODate()
Gets the value of the date field as a locale independent ISO date
(yyyy-MM-dd'T'HH:mm:ss or yyyy-MM-dd depending on whether this is a date
field or a date and time field).
|
String |
getPlaceHolder()
Gets the set placeholder this textual date input, or an empty string if
none is set.
|
com.google.gwt.user.client.Element |
getSubPartElement(String subPart)
Locates an element inside a component using the identifier provided in
subPart. |
String |
getSubPartName(com.google.gwt.user.client.Element subElement)
Provides an identifier that identifies the element within the component.
|
protected String |
getText() |
protected boolean |
hasChildFocus()
Returns whether any of the child components has focus.
|
void |
onChange(com.google.gwt.event.dom.client.ChangeEvent event) |
void |
onKeyDown(com.google.gwt.event.dom.client.KeyDownEvent event) |
void |
setAriaInvalid(boolean invalid)
Called to set the element, typically an input element, as invalid.
|
void |
setAriaRequired(boolean required)
Called to set the element, typically an input element, as required.
|
void |
setEnabled(boolean enabled) |
void |
setFormatString(String formatString)
Sets the date format string to use for the text field.
|
void |
setISODate(String isoDate)
Sets the value of the date field as a locale independent ISO date
(yyyy-MM-dd'T'HH:mm:ss or yyyy-MM-dd depending on whether this is a date
field or a date and time field).
|
void |
setPlaceholder(String placeholder)
Sets the placeholder for this textual date input.
|
protected void |
setText(String text) |
void |
setTimeZone(com.google.gwt.i18n.client.TimeZone timeZone)
Sets the time zone for the field.
|
protected void |
updateAndSendBufferedValues()
Deprecated.
Use
updateBufferedResolutions() and
VDateField.sendBufferedValues() instead. |
protected void |
updateBufferedResolutions()
Updates
bufferedResolutions before
sending a response to the server. |
void |
updateBufferedValues()
Update buffered values
VDateField.bufferedDateString and
VDateField.bufferedResolutions that will be sent to the server. |
protected void |
updateStyleNames()
Updates style names for the widget (and its children).
|
doGetResolutions, getClient, getCurrentDate, getCurrentLocale, getCurrentResolution, getDate, getDate, getDateTimeService, getDefaultDate, getId, getResolutions, getResolutionVariable, isEnabled, isReadonly, isShowISOWeekNumbers, isYear, resolutionAsString, sendBufferedValues, setCurrentDate, setCurrentDate, setCurrentLocale, setCurrentResolution, setDate, setDefaultDate, setDefaultDate, setReadonly, setShowISOWeekNumbers, supportsTimeadd, 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 final com.google.gwt.user.client.ui.TextBox text
public boolean lenient
public VAbstractTextualDate(R resoluton)
protected void updateStyleNames()
public String getFormatString()
protected String createFormatString()
public void setFormatString(String formatString)
formatString - the format string to use, or null to force re-creating
the format string from the locale the next time it is neededpublic void bindAriaCaption(com.google.gwt.user.client.Element captionElement)
HandlesAriaCaptionbindAriaCaption in interface HandlesAriaCaptioncaptionElement - Element of the captionpublic void setAriaRequired(boolean required)
HandlesAriaRequiredsetAriaRequired in interface HandlesAriaRequiredrequired - boolean true when the element needs to be set as requiredpublic void setAriaInvalid(boolean invalid)
HandlesAriaInvalidsetAriaInvalid in interface HandlesAriaInvalidinvalid - boolean, true when the element should be marked invalid, false
otherwisepublic void buildDate()
VDateField.getDate()). Takes care of updating text, enabling and disabling
the field, setting/removing readonly status and updating readonly styles.
For internal use only. May be removed or replaced in the future.
TODO: Split part of this into a method that only updates the text as this is what usually is needed except for updateFromUIDL.
public void setTimeZone(com.google.gwt.i18n.client.TimeZone timeZone)
timeZone - the new time zone to usepublic void setEnabled(boolean enabled)
setEnabled in interface com.google.gwt.user.client.ui.HasEnabledsetEnabled in class VDateField<R extends Enum<R>>public void onChange(com.google.gwt.event.dom.client.ChangeEvent event)
onChange in interface com.google.gwt.event.dom.client.ChangeHandlerpublic void updateBufferedValues()
VDateFieldVDateField.bufferedDateString and
VDateField.bufferedResolutions that will be sent to the server.
This method should NOT send values to the server.
This method can be implemented by subclasses to update buffered values from component values.
updateBufferedValues in class VDateField<R extends Enum<R>>@Deprecated protected final void updateAndSendBufferedValues()
updateBufferedResolutions() and
VDateField.sendBufferedValues() instead.bufferedResolutions,
then sends the values to the server.protected void updateBufferedResolutions()
bufferedResolutions before
sending a response to the server.
The method can be overridden by subclasses to provide a custom logic for
date variables to avoid overriding the onChange(ChangeEvent)
method.
Note that this method should not send the buffered values. For that, use
VDateField.sendBufferedValues().
protected String cleanFormat(String format)
getFormatString().format - date format stringgetFormatString()public void focus()
Focusablepublic void setPlaceholder(String placeholder)
placeholder - the placeholder to set, or null to clearpublic String getPlaceHolder()
protected String getText()
protected void setText(String text)
public com.google.gwt.user.client.Element getSubPartElement(String subPart)
SubPartAwaresubPart. The subPart identifier is component specific and
may be any string of characters, numbers, space characters and brackets.getSubPartElement in interface SubPartAwaresubPart - The identifier for the element inside the componentpublic String getSubPartName(com.google.gwt.user.client.Element subElement)
SubPartAwaresubElement is a part of the component and must never be null.
Note!
getSubPartElement(getSubPartName(element)) == element is not
always true. A component can choose to provide a more generic
identifier for any given element if the results of all interactions with
subElement are the same as interactions with the element
identified by the return value. For example a button can return an
identifier for the root element even though a DIV inside the button was
passed as subElement because interactions with the DIV and the
root button element produce the same result.
getSubPartName in interface SubPartAwaresubElement - The element the identifier string should uniquely identifysubElement or null
if no identifier could be provided.public void onKeyDown(com.google.gwt.event.dom.client.KeyDownEvent event)
onKeyDown in interface com.google.gwt.event.dom.client.KeyDownHandlerprotected void checkGroupFocus(boolean textFocus)
textFocus - the focus of the textprotected boolean hasChildFocus()
true if any of the child component has focus,
false otherwisepublic void setISODate(String isoDate)
isoDate - the date to set in ISO8601 format, or null to clear the date
valuepublic String getISODate()
Copyright © 2018 Vaadin Ltd. All rights reserved.