public class DatePickerImpl<V> extends AbstractField<com.vaadin.ui.InlineDateField,java.time.LocalDate,V> implements DatePicker<V>
DatePicker.Resolution
HasValue.ValueChangeEvent<V>
Component.Alignment, Component.BelongToFrame, Component.Disposable, Component.Editable, Component.Focusable, Component.HasCaption, Component.HasDescription, Component.HasIcon, Component.HasXmlDescriptor, Component.Wrapper
HasContextHelp.ContextHelpIconClickEvent
Modifier and Type | Field and Description |
---|---|
protected DataAwareComponentsTools |
dataAwareComponentsTools |
protected io.jmix.core.metamodel.datatype.Datatype<V> |
datatype |
protected io.jmix.core.DateTimeTransformations |
dateTimeTransformations |
protected V |
rangeEnd |
protected V |
rangeStart |
protected DatePicker.Resolution |
resolution |
editable, parentEditableChangeListener, validators, VALIDATORS_LIST_INITIAL_CAPACITY
internalValue, uiTestIdsSupport, valueBinding
alignment, applicationContext, component, contextHelpIconClickHandler, contextHelpIconClickListener, descriptionAsHtml, element, frame, htmlSanitizerEnabled, icon, ICON_STYLE, id, parent
NAME, TYPE_DATE, TYPE_DATETIME, TYPE_DEFAULT, TYPE_LOCALDATE, TYPE_LOCALDATETIME, TYPE_OFFSETDATETIME
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZE
Constructor and Description |
---|
DatePickerImpl() |
Modifier and Type | Method and Description |
---|---|
void |
commit()
Updates all changes since the previous commit to the data source.
|
protected java.lang.Object |
convertFromLocalDateTime(java.time.LocalDateTime localDateTime,
java.lang.Class javaType) |
protected java.time.LocalDateTime |
convertToLocalDateTime(java.lang.Object date) |
protected V |
convertToModel(java.time.LocalDate componentRawValue) |
protected java.time.LocalDate |
convertToPresentation(V modelValue) |
protected com.vaadin.ui.InlineDateField |
createComponent() |
void |
discard()
Discards all changes since last commit.
|
void |
focus()
Sets focus to this component
|
io.jmix.core.metamodel.datatype.Datatype<V> |
getDatatype() |
V |
getRangeEnd()
Return end of range for a certain resolution.
|
V |
getRangeStart()
Return start of range for a certain resolution.
|
DatePicker.Resolution |
getResolution()
Returns resolution of the DatePicker.
|
int |
getTabIndex()
Gets the tabulator index of the
HasTabIndex component. |
boolean |
isBuffered() |
boolean |
isModified()
Tests if the value stored in the object has been modified since it was
last updated from the data source.
|
void |
setBuffered(boolean buffered)
Sets the buffered mode.
|
void |
setDataAwareComponentsTools(DataAwareComponentsTools dataAwareComponentsTools) |
void |
setDatatype(io.jmix.core.metamodel.datatype.Datatype<V> datatype)
Sets the given
datatype to the component. |
void |
setDateTimeTransformations(io.jmix.core.DateTimeTransformations dateTimeTransformations) |
void |
setMessages(io.jmix.core.Messages messages) |
void |
setRangeEnd(V value)
Set end of range.
|
void |
setRangeStart(V value)
Set start of range.
|
void |
setResolution(DatePicker.Resolution resolution)
Sets resolution of the DatePicker.
|
void |
setTabIndex(int tabIndex)
Sets the tabulator index of the
Focusable component. |
protected void |
valueBindingConnected(ValueSource<V> valueSource) |
addValidator, attachValueChangeListener, getDatatypeConversionErrorMsg, getErrorMessage, getRequiredMessage, getValidators, isEditable, isRequired, isValid, removeValidator, setEditable, setEditableToComponent, setParent, setRequired, setRequiredMessage, setupComponentErrorProvider, triggerValidators, validate
addValueChangeListener, componentValueChanged, fieldValueEquals, getValue, getValueSource, setUiTestId, setUiTestIdsSupport, setValue, setValueSource, setValueToPresentation, valueBindingActivated
addAttachListener, addDetachListener, addStyleName, assignDebugId, attached, detached, getAlignment, getCaption, getComponent, getComposition, getContextHelpIconClickHandler, getContextHelpText, getDebugId, getDescription, getEventHub, getFrame, getHeight, getHeightSizeUnit, getHtmlSanitizer, getIcon, getIconName, getIconResource, getId, getParent, getStyleName, getUiComponentProperties, getUiProperties, getWidth, getWidthSizeUnit, getXmlDescriptor, hasSubscriptions, hasValidationError, isAttached, isCaptionAsHtml, isContextHelpTextHtmlEnabled, isDescriptionAsHtml, isEnabled, isEnabledRecursive, isHtmlSanitizerEnabled, isResponsive, isVisible, isVisibleRecursive, onContextHelpIconClick, publish, removeStyleName, sanitize, setAlignment, setApplicationContext, setCaption, setCaptionAsHtml, setContextHelpIconClickHandler, setContextHelpText, setContextHelpTextHtmlEnabled, setDebugId, setDescription, setDescriptionAsHtml, setEnabled, setFrame, setHeight, setHtmlSanitizerEnabled, setIcon, setIconFromSet, setId, setResponsive, setStyleName, setValidationError, setVisible, setWidth, setXmlDescriptor, unsubscribe, unwrap, unwrapComposition, unwrapCompositionOrNull, unwrapOrNull, withUnwrapped, withUnwrappedComposition
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getValue
getValueSource, setValueSource
addValueChangeListener, clear, getEmptyValue, isEmpty, setValue
isEditable, isEditableWithParent, setEditable
getFrame, setFrame
addStyleName, getAlignment, getHeight, getHeightSizeUnit, getId, getParent, getStyleName, getWidth, getWidthSizeUnit, isEnabled, isEnabledRecursive, isResponsive, isVisible, isVisibleRecursive, removeStyleName, setAlignment, setEnabled, setHeight, setHeightAuto, setHeightFull, setId, setParent, setResponsive, setSizeAuto, setSizeFull, setStyleName, setVisible, setWidth, setWidthAuto, setWidthFull, unwrap, unwrapComposition, unwrapCompositionOrNull, unwrapOrNull, withUnwrapped, withUnwrappedComposition
isValid, isValidateOnCommit, validate
getIcon, setIcon, setIconFromSet
getContextHelpIconClickHandler, getContextHelpText, isContextHelpTextHtmlEnabled, setContextHelpIconClickHandler, setContextHelpText, setContextHelpTextHtmlEnabled
isCaptionAsHtml, setCaptionAsHtml
getCaption, setCaption
getDescription, setDescription
isDescriptionAsHtml, setDescriptionAsHtml
isHtmlSanitizerEnabled, setHtmlSanitizerEnabled
addValidator, addValidators, getValidators, removeValidator
getRequiredMessage, isRequired, setRequired, setRequiredMessage
isFocusable, setFocusable
protected io.jmix.core.DateTimeTransformations dateTimeTransformations
protected DatePicker.Resolution resolution
protected io.jmix.core.metamodel.datatype.Datatype<V> datatype
protected V rangeStart
protected V rangeEnd
protected DataAwareComponentsTools dataAwareComponentsTools
protected com.vaadin.ui.InlineDateField createComponent()
@Autowired public void setDataAwareComponentsTools(DataAwareComponentsTools dataAwareComponentsTools)
@Autowired public void setDateTimeTransformations(io.jmix.core.DateTimeTransformations dateTimeTransformations)
@Autowired public void setMessages(io.jmix.core.Messages messages)
public DatePicker.Resolution getResolution()
DatePicker
getResolution
in interface DatePicker<V>
public void setResolution(DatePicker.Resolution resolution)
DatePicker
setResolution
in interface DatePicker<V>
resolution
- resolutionprotected void valueBindingConnected(ValueSource<V> valueSource)
valueBindingConnected
in class AbstractValueComponent<com.vaadin.ui.InlineDateField,java.time.LocalDate,V>
@Nullable protected V convertToModel(@Nullable java.time.LocalDate componentRawValue) throws ConversionException
convertToModel
in class AbstractValueComponent<com.vaadin.ui.InlineDateField,java.time.LocalDate,V>
ConversionException
@Nullable protected java.time.LocalDate convertToPresentation(@Nullable V modelValue) throws ConversionException
convertToPresentation
in class AbstractValueComponent<com.vaadin.ui.InlineDateField,java.time.LocalDate,V>
ConversionException
protected java.time.LocalDateTime convertToLocalDateTime(java.lang.Object date)
protected java.lang.Object convertFromLocalDateTime(java.time.LocalDateTime localDateTime, java.lang.Class javaType)
@Nullable public V getRangeStart()
HasRange
getRangeStart
in interface HasRange<V>
public void setRangeStart(@Nullable V value)
HasRange
setRangeStart
in interface HasRange<V>
value
- allowed start of range@Nullable public V getRangeEnd()
HasRange
getRangeEnd
in interface HasRange<V>
public void setRangeEnd(@Nullable V value)
HasRange
setRangeEnd
in interface HasRange<V>
value
- end of allowed rangepublic void focus()
Component.Focusable
focus
in interface Component.Focusable
public int getTabIndex()
Component.Focusable
HasTabIndex
component.getTabIndex
in interface Component.Focusable
HasTabIndex
componentpublic void setTabIndex(int tabIndex)
Component.Focusable
Focusable
component.
The tab index property is used to specify the order in which the
fields are focused when the user presses the Tab key. Components with
a defined tab index are focused sequentially first, and then the
components with no tab index.setTabIndex
in interface Component.Focusable
tabIndex
- tab index@Nullable public io.jmix.core.metamodel.datatype.Datatype<V> getDatatype()
getDatatype
in interface HasDatatype<V>
public void setDatatype(io.jmix.core.metamodel.datatype.Datatype<V> datatype)
HasDatatype
datatype
to the component. Its value will be formatted according to this
datatype.setDatatype
in interface HasDatatype<V>
datatype
- Datatype
instancepublic void commit()
Buffered
commit
in interface Buffered
commit
in class AbstractValueComponent<com.vaadin.ui.InlineDateField,java.time.LocalDate,V>
public void discard()
Buffered
discard
in interface Buffered
discard
in class AbstractValueComponent<com.vaadin.ui.InlineDateField,java.time.LocalDate,V>
public boolean isBuffered()
isBuffered
in interface Buffered
isBuffered
in class AbstractValueComponent<com.vaadin.ui.InlineDateField,java.time.LocalDate,V>
true
if buffered mode is on, false
otherwisepublic void setBuffered(boolean buffered)
Buffered
When in buffered mode, an internal buffer will be used to store changes
until Buffered.commit()
is called. Calling Buffered.discard()
will revert
the internal buffer to the value of the data source.
When in non-buffered mode both read and write operations will be done
directly on the data source. In this mode the Buffered.commit()
and
Buffered.discard()
methods serve no purpose.
setBuffered
in interface Buffered
setBuffered
in class AbstractValueComponent<com.vaadin.ui.InlineDateField,java.time.LocalDate,V>
buffered
- true
if buffered mode should be turned on, false
otherwisepublic boolean isModified()
Buffered
isModified
in interface Buffered
isModified
in class AbstractValueComponent<com.vaadin.ui.InlineDateField,java.time.LocalDate,V>
true
if the value in the object has been modified
since the last data source update, false
if not.