public class DateTimeField extends AbstractLocalDateTimeField
AbstractLocalDateTimeField
,
InlineDateTimeField
,
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 |
---|
DateTimeField()
Constructs an empty
DateTimeField with no caption. |
DateTimeField(HasValue.ValueChangeListener<LocalDateTime> valueChangeListener)
Constructs a new
DateTimeField with a value change listener. |
DateTimeField(String caption)
Constructs an empty
DateTimeField with caption. |
DateTimeField(String caption,
HasValue.ValueChangeListener<LocalDateTime> valueChangeListener)
Constructs a new
DateTimeField with the given caption and a value
change listener. |
DateTimeField(String caption,
LocalDateTime value)
Constructs a new
DateTimeField with the given caption and
initial text contents. |
DateTimeField(String caption,
LocalDateTime value,
HasValue.ValueChangeListener<LocalDateTime> valueChangeListener)
Constructs a new
DateTimeField 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 LocalDateTimeFieldState |
getState()
Returns the shared state bean with information to be sent from the server
to the client.
|
protected LocalDateTimeFieldState |
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.
|
adjustToResolution, 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, isPreventInvalidInput, isShowISOWeekNumbers, readDesign, reconstructDateFromFields, setAssistiveLabel, setDateFormat, setDateOutOfRangeMessage, setDateStyle, setDaylightSavingTimeRange, setDefaultValue, setLenient, setLocale, setParseErrorMessage, setPreventInvalidInput, 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, setHeightFull, setHeightUndefined, setIcon, setId, setParent, setPrimaryStyleName, setResponsive, setSizeFull, setSizeUndefined, setStyleName, setVisible, setWidth, setWidth, setWidthFull, setWidthUndefined
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, 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, 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, setHeightFull, setHeightUndefined, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull, setWidthUndefined
public DateTimeField()
DateTimeField
with no caption.public DateTimeField(String caption, LocalDateTime value)
DateTimeField
with the given caption and
initial text contents.caption
- the caption String
for the editor.value
- the LocalDateTime value.public DateTimeField(String caption)
DateTimeField
with caption.caption
- the caption of the datefield.public DateTimeField(HasValue.ValueChangeListener<LocalDateTime> valueChangeListener)
DateTimeField
with a value change listener.
The listener is called when the value of this DateTimeField
is
changed either by the user or programmatically.
valueChangeListener
- the value change listener, not null
public DateTimeField(String caption, HasValue.ValueChangeListener<LocalDateTime> valueChangeListener)
DateTimeField
with the given caption and a value
change listener.
The listener is called when the value of this DateTimeField
is
changed either by the user or programmatically.
caption
- the caption for the fieldvalueChangeListener
- the value change listener, not null
public DateTimeField(String caption, LocalDateTime value, HasValue.ValueChangeListener<LocalDateTime> valueChangeListener)
DateTimeField
with the given caption, initial
text contents and a value change listener.
The listener is called when the value of this DateTimeField
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 LocalDateTimeFieldState getState()
AbstractComponent
getState
in class AbstractLocalDateTimeField
protected LocalDateTimeFieldState getState(boolean markAsDirty)
AbstractClientConnector
getState
in class AbstractLocalDateTimeField
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 © 2023 Vaadin Ltd. All rights reserved.