public abstract class AbstractLocalDateField extends AbstractDateField<LocalDate,DateResolution>
LocalDate
type.HasValue.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 |
---|
AbstractLocalDateField()
Constructs an empty
AbstractLocalDateField with no caption. |
AbstractLocalDateField(String caption)
Constructs an empty
AbstractLocalDateField with caption. |
AbstractLocalDateField(String caption,
LocalDate value)
Constructs a new
AbstractLocalDateField with the given
caption and initial text contents. |
Modifier and Type | Method and Description |
---|---|
protected LocalDate |
buildDate(Map<DateResolution,Integer> resolutionValues)
Builds date by the given
resolutionValues which is a map whose
keys are resolution and integer values. |
protected LocalDate |
convertFromDate(Date date)
Converts
Date to date type T . |
protected Date |
convertToDate(LocalDate date)
Converts the object of type
T to Date . |
protected String |
formatDate(LocalDate value)
Formats date according to the components locale.
|
protected int |
getDatePart(LocalDate date,
DateResolution resolution)
Returns a date integer value part for the given
date for the
given resolution . |
protected RangeValidator<LocalDate> |
getRangeValidator()
Returns a custom date range validator which is applicable for the type
T . |
protected AbstractTextualDateFieldState |
getState()
Returns the shared state bean with information to be sent from the server
to the client.
|
protected AbstractTextualDateFieldState |
getState(boolean markAsDirty)
Returns the shared state for this connector.
|
protected LocalDate |
toType(TemporalAccessor temporalAccessor)
Converts a temporal value into field-specific data type.
|
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 AbstractLocalDateField()
AbstractLocalDateField
with no caption.public AbstractLocalDateField(String caption)
AbstractLocalDateField
with caption.caption
- the caption of the datefield.protected int getDatePart(LocalDate date, DateResolution resolution)
AbstractDateField
date
for the
given resolution
.getDatePart
in class AbstractDateField<LocalDate,DateResolution>
date
- the given date, can be null
resolution
- the resolution to extract a value from the date by, not
null
protected LocalDate buildDate(Map<DateResolution,Integer> resolutionValues)
AbstractDateField
resolutionValues
which is a map whose
keys are resolution and integer values.
This is the opposite to AbstractDateField.getDatePart(Temporal, Enum)
.
buildDate
in class AbstractDateField<LocalDate,DateResolution>
resolutionValues
- date values to construct a dateprotected RangeValidator<LocalDate> getRangeValidator()
AbstractDateField
T
.getRangeValidator
in class AbstractDateField<LocalDate,DateResolution>
protected AbstractTextualDateFieldState getState()
AbstractComponent
getState
in class AbstractDateField<LocalDate,DateResolution>
protected AbstractTextualDateFieldState getState(boolean markAsDirty)
AbstractClientConnector
getState
in class AbstractDateField<LocalDate,DateResolution>
markAsDirty
- true if the connector should automatically be marked dirty,
false otherwiseAbstractClientConnector.getState()
protected LocalDate convertFromDate(Date date)
AbstractDateField
Date
to date type T
.convertFromDate
in class AbstractDateField<LocalDate,DateResolution>
date
- a date to convertT
representing the date
protected Date convertToDate(LocalDate date)
AbstractDateField
T
to Date
.
This is the opposite to AbstractDateField.convertFromDate(Date)
.
convertToDate
in class AbstractDateField<LocalDate,DateResolution>
date
- the date of type T
Date
protected String formatDate(LocalDate value)
AbstractDateField
formatDate
in class AbstractDateField<LocalDate,DateResolution>
value
- the date or null
null
protected LocalDate toType(TemporalAccessor temporalAccessor)
AbstractDateField
toType
in class AbstractDateField<LocalDate,DateResolution>
temporalAccessor
- - source valueCopyright © 2018 Vaadin Ltd. All rights reserved.