public class DateField extends AbstractLocalDateField
AbstractLocalDateField
,
InlineDateField
,
Serialized FormHasValue.ValueChangeEvent<V>, HasValue.ValueChangeListener<V>
Component.ErrorEvent, Component.Event, Component.Focusable, Component.Listener
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListener
Sizeable.Unit
DESIGN_ATTR_PLAIN_TEXT
SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS
Constructor and Description |
---|
DateField()
Constructs an empty
DateField with no caption. |
DateField(HasValue.ValueChangeListener<LocalDate> valueChangeListener)
Constructs a new
DateField with a value change listener. |
DateField(String caption)
Constructs an empty
DateField with caption. |
DateField(String caption,
HasValue.ValueChangeListener<LocalDate> valueChangeListener)
Constructs a new
DateField with the given caption and a value
change listener. |
DateField(String caption,
LocalDate value)
Constructs a new
DateField with the given caption and
initial text contents. |
DateField(String caption,
LocalDate value,
HasValue.ValueChangeListener<LocalDate> valueChangeListener)
Constructs a new
DateField with the given caption, initial text
contents and a value change listener. |
Modifier and Type | Method and Description |
---|---|
String |
getAssistiveText()
Get the description that explains the usage of the Widget for users of
assistive devices.
|
String |
getPlaceholder()
Returns the current placeholder text.
|
protected LocalDateFieldState |
getState()
Returns the shared state bean with information to be sent from the server
to the client.
|
protected LocalDateFieldState |
getState(boolean markAsDirty)
Returns the shared state for this connector.
|
boolean |
isTextFieldEnabled()
Checks whether the text field is enabled (default) or not.
|
void |
setAssistiveText(String description)
Set a description that explains the usage of the Widget for users of
assistive devices.
|
void |
setPlaceholder(String placeholder)
Sets the placeholder text.
|
void |
setTextFieldEnabled(boolean state)
Enables or disables the text field.
|
buildDate, convertFromDate, convertToDate, formatDate, getDatePart, getRangeValidator, toType
addBlurListener, addFocusListener, afterDate, beforeClientResponse, convertFromDateString, convertToDateString, doSetValue, getAssistiveLabel, getDateFormat, getDateOutOfRangeMessage, getDateStyle, getDateStyles, getDefaultValidator, getDefaultValue, getParseErrorMessage, getRangeEnd, getRangeStart, getResolution, getValue, getZoneId, handleUnparsableDateString, isLenient, isShowISOWeekNumbers, readDesign, reconstructDateFromFields, setAssistiveLabel, setDateFormat, setDateOutOfRangeMessage, setDateStyle, setDefaultValue, setLenient, setLocale, setParseErrorMessage, setRangeEnd, setRangeStart, setResolution, setShowISOWeekNumbers, setValue, setZoneId, writeDesign
addValueChangeListener, createValueChange, focus, getCustomAttributes, getTabIndex, isDifferentValue, isReadOnly, isRequiredIndicatorVisible, setReadOnly, setRequiredIndicatorVisible, setTabIndex, setValue
addContextClickListener, addListener, addShortcutListener, addStyleName, attach, detach, findAncestor, fireComponentErrorEvent, fireComponentEvent, getActionManager, getCaption, getComponentError, getData, getDebugId, getDescription, getErrorMessage, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getWidth, getWidthUnits, isCaptionAsHtml, isConnectorEnabled, isEnabled, isOrHasAncestor, isResponsive, isVisible, removeContextClickListener, removeListener, removeShortcutListener, removeStyleName, setCaption, setCaptionAsHtml, setComponentError, setData, setDebugId, setDescription, setDescription, setEnabled, setHeight, setHeight, setHeightUndefined, setIcon, setId, setParent, setPrimaryStyleName, setResponsive, setSizeFull, setSizeUndefined, setStyleName, setVisible, setWidth, setWidth, setWidthUndefined
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addMethodInvocationToQueue, createState, encodeState, equals, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, hashCode, hasListeners, isAttached, isThis, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource, updateDiffstate
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
clear, getEmptyValue, getOptionalValue, isEmpty
addListener, addStyleName, addStyleNames, attach, getCaption, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isVisible, removeListener, removeStyleName, removeStyleNames, setCaption, setEnabled, setIcon, setId, setParent, setPrimaryStyleName, setStyleName, setStyleName, setVisible
addAttachListener, addDetachListener, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler
getConnectorId
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setHeightUndefined, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthUndefined
public DateField()
DateField
with no caption.public DateField(String caption, LocalDate value)
DateField
with the given caption and
initial text contents.caption
- the caption String
for the editor.value
- the LocalDate value.public DateField(String caption)
DateField
with caption.caption
- the caption of the datefield.public DateField(HasValue.ValueChangeListener<LocalDate> valueChangeListener)
DateField
with a value change listener.
The listener is called when the value of this DateField
is
changed either by the user or programmatically.
valueChangeListener
- the value change listener, not null
public DateField(String caption, HasValue.ValueChangeListener<LocalDate> valueChangeListener)
DateField
with the given caption and a value
change listener.
The listener is called when the value of this DateField
is
changed either by the user or programmatically.
caption
- the caption for the fieldvalueChangeListener
- the value change listener, not null
public DateField(String caption, LocalDate value, HasValue.ValueChangeListener<LocalDate> valueChangeListener)
DateField
with the given caption, initial text
contents and a value change listener.
The listener is called when the value of this DateField
is
changed either by the user or programmatically.
caption
- the caption for the fieldvalue
- the value for the field, not null
valueChangeListener
- the value change listener, not null
public String getPlaceholder()
setPlaceholder(String)
public void setPlaceholder(String placeholder)
placeholder
- the placeholder text to setprotected LocalDateFieldState getState()
AbstractComponent
getState
in class AbstractLocalDateField
protected LocalDateFieldState getState(boolean markAsDirty)
AbstractClientConnector
getState
in class AbstractLocalDateField
markAsDirty
- true if the connector should automatically be marked dirty,
false otherwiseAbstractClientConnector.getState()
public boolean isTextFieldEnabled()
setTextFieldEnabled(boolean)
public void setTextFieldEnabled(boolean state)
state
- true to enable text field, false to disable it.public void setAssistiveText(String description)
description
- String with the descriptionpublic String getAssistiveText()
Copyright © 2018 Vaadin Ltd. All rights reserved.