Package io.jmix.ui.component.impl
Class DatePickerImpl<V>
java.lang.Object
io.jmix.ui.component.impl.AbstractComponent<T>
io.jmix.ui.component.impl.AbstractValueComponent<T,P,V>
io.jmix.ui.component.impl.AbstractField<com.vaadin.ui.InlineDateField,LocalDate,V>
io.jmix.ui.component.impl.DatePickerImpl<V>
- All Implemented Interfaces:
AttachNotifier,Buffered,Component,Component.BelongToFrame,Component.Editable,Component.Focusable,Component.HasCaption,Component.HasDescription,Component.HasIcon,Component.HasXmlDescriptor,Component.Wrapper,HasValueSource<V>,DatePicker<V>,Field<V>,HasContextHelp,HasDatatype<V>,HasDebugId,HasHtmlCaption,HasHtmlDescription,HasHtmlSanitizer,HasRange<V>,HasValidator<V>,HasValue<V>,Requirable,Validatable
public class DatePickerImpl<V>
extends AbstractField<com.vaadin.ui.InlineDateField,LocalDate,V>
implements DatePicker<V>
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.jmix.ui.component.Component
Component.Alignment, Component.BelongToFrame, Component.Disposable, Component.Editable, Component.Focusable, Component.HasCaption, Component.HasDescription, Component.HasIcon, Component.HasXmlDescriptor, Component.WrapperNested classes/interfaces inherited from interface io.jmix.ui.component.DatePicker
DatePicker.ResolutionNested classes/interfaces inherited from interface io.jmix.ui.component.HasContextHelp
HasContextHelp.ContextHelpIconClickEventNested classes/interfaces inherited from interface io.jmix.ui.component.HasValue
HasValue.ValueChangeEvent<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DataAwareComponentsToolsprotected DateTimeTransformationsprotected Vprotected Vprotected DatePicker.ResolutionFields inherited from class io.jmix.ui.component.impl.AbstractField
editable, parentEditableChangeListener, validators, VALIDATORS_LIST_INITIAL_CAPACITYFields inherited from class io.jmix.ui.component.impl.AbstractValueComponent
internalValue, uiTestIdsSupport, valueBindingFields inherited from class io.jmix.ui.component.impl.AbstractComponent
alignment, applicationContext, component, contextHelpIconClickHandler, contextHelpIconClickListener, descriptionAsHtml, element, frame, htmlSanitizerEnabled, icon, ICON_STYLE, id, parentFields inherited from interface io.jmix.ui.component.Component
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZEFields inherited from interface io.jmix.ui.component.DatePicker
NAME, TYPE_DATE, TYPE_DATETIME, TYPE_DEFAULT, TYPE_LOCALDATE, TYPE_LOCALDATETIME, TYPE_OFFSETDATETIME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcommit()Updates all changes since the previous commit to the data source.protected ObjectconvertFromLocalDateTime(LocalDateTime localDateTime, Class javaType) protected LocalDateTimeconvertToLocalDateTime(Object date) protected VconvertToModel(LocalDate componentRawValue) protected LocalDateconvertToPresentation(V modelValue) protected com.vaadin.ui.InlineDateFieldvoiddiscard()Discards all changes since last commit.voidfocus()Sets focus to this componentReturn end of range for a certain resolution.Return start of range for a certain resolution.Returns resolution of the DatePicker.intGets the tabulator index of theHasTabIndexcomponent.booleanbooleanTests if the value stored in the object has been modified since it was last updated from the data source.voidsetBuffered(boolean buffered) Sets the buffered mode.voidsetDataAwareComponentsTools(DataAwareComponentsTools dataAwareComponentsTools) voidsetDatatype(Datatype<V> datatype) Sets the givendatatypeto the component.voidsetDateTimeTransformations(DateTimeTransformations dateTimeTransformations) voidsetMessages(Messages messages) voidsetRangeEnd(V value) Set end of range.voidsetRangeStart(V value) Set start of range.voidsetResolution(DatePicker.Resolution resolution) Sets resolution of the DatePicker.voidsetTabIndex(int tabIndex) Sets the tabulator index of theFocusablecomponent.protected voidvalueBindingConnected(ValueSource<V> valueSource) Methods inherited from class io.jmix.ui.component.impl.AbstractField
addValidator, attachValueChangeListener, getDatatypeConversionErrorMsg, getDefaultRequiredMessage, getErrorMessage, getRequiredMessage, getValidators, isEditable, isRequired, isValid, removeValidator, setEditable, setEditableToComponent, setParent, setRequired, setRequiredMessage, setupComponentErrorProvider, triggerValidators, validateMethods inherited from class io.jmix.ui.component.impl.AbstractValueComponent
addValueChangeListener, componentValueChanged, fieldValueEquals, getValue, getValueSource, setUiTestId, setUiTestIdsSupport, setValue, setValueSource, setValueToPresentation, valueBindingActivatedMethods inherited from class io.jmix.ui.component.impl.AbstractComponent
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, withUnwrappedCompositionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.jmix.ui.component.Component
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, withUnwrappedCompositionMethods inherited from interface io.jmix.ui.component.Component.BelongToFrame
getFrame, setFrameMethods inherited from interface io.jmix.ui.component.Component.Editable
isEditable, isEditableWithParent, setEditableMethods inherited from interface io.jmix.ui.component.Component.Focusable
isFocusable, setFocusableMethods inherited from interface io.jmix.ui.component.Component.HasCaption
getCaption, setCaptionMethods inherited from interface io.jmix.ui.component.Component.HasDescription
getDescription, setDescriptionMethods inherited from interface io.jmix.ui.component.Component.HasIcon
getIcon, setIcon, setIconFromSetMethods inherited from interface io.jmix.ui.component.DatePicker
getValueMethods inherited from interface io.jmix.ui.component.HasContextHelp
getContextHelpIconClickHandler, getContextHelpText, isContextHelpTextHtmlEnabled, setContextHelpIconClickHandler, setContextHelpText, setContextHelpTextHtmlEnabledMethods inherited from interface io.jmix.ui.component.HasHtmlCaption
isCaptionAsHtml, setCaptionAsHtmlMethods inherited from interface io.jmix.ui.component.HasHtmlDescription
isDescriptionAsHtml, setDescriptionAsHtmlMethods inherited from interface io.jmix.ui.component.HasHtmlSanitizer
isHtmlSanitizerEnabled, setHtmlSanitizerEnabledMethods inherited from interface io.jmix.ui.component.HasValidator
addValidator, addValidators, getValidators, removeValidatorMethods inherited from interface io.jmix.ui.component.HasValue
addValueChangeListener, clear, getEmptyValue, isEmpty, setValueMethods inherited from interface io.jmix.ui.component.data.HasValueSource
getValueSource, setValueSourceMethods inherited from interface io.jmix.ui.component.Requirable
getRequiredMessage, isRequired, setRequired, setRequiredMessageMethods inherited from interface io.jmix.ui.component.Validatable
isValid, isValidateOnCommit, validate
-
Field Details
-
dateTimeTransformations
-
resolution
-
datatype
-
rangeStart
-
rangeEnd
-
dataAwareComponentsTools
-
-
Constructor Details
-
DatePickerImpl
public DatePickerImpl()
-
-
Method Details
-
createComponent
protected com.vaadin.ui.InlineDateField createComponent() -
setDataAwareComponentsTools
@Autowired public void setDataAwareComponentsTools(DataAwareComponentsTools dataAwareComponentsTools) -
setDateTimeTransformations
-
setMessages
-
getResolution
Description copied from interface:DatePickerReturns resolution of the DatePicker.- Specified by:
getResolutionin interfaceDatePicker<V>- Returns:
- Resolution
-
setResolution
Description copied from interface:DatePickerSets resolution of the DatePicker.- Specified by:
setResolutionin interfaceDatePicker<V>- Parameters:
resolution- resolution
-
valueBindingConnected
- Overrides:
valueBindingConnectedin classAbstractValueComponent<com.vaadin.ui.InlineDateField,LocalDate, V>
-
convertToModel
@Nullable protected V convertToModel(@Nullable LocalDate componentRawValue) throws ConversionException - Overrides:
convertToModelin classAbstractValueComponent<com.vaadin.ui.InlineDateField,LocalDate, V> - Throws:
ConversionException
-
convertToPresentation
@Nullable protected LocalDate convertToPresentation(@Nullable V modelValue) throws ConversionException - Overrides:
convertToPresentationin classAbstractValueComponent<com.vaadin.ui.InlineDateField,LocalDate, V> - Throws:
ConversionException
-
convertToLocalDateTime
-
convertFromLocalDateTime
-
getRangeStart
Description copied from interface:HasRangeReturn start of range for a certain resolution.- Specified by:
getRangeStartin interfaceHasRange<V>- Returns:
- start of allowed range
-
setRangeStart
Description copied from interface:HasRangeSet start of range. If the value is set before this date, the component will not validate.- Specified by:
setRangeStartin interfaceHasRange<V>- Parameters:
value- allowed start of range
-
getRangeEnd
Description copied from interface:HasRangeReturn end of range for a certain resolution.- Specified by:
getRangeEndin interfaceHasRange<V>- Returns:
- end of allowed range
-
setRangeEnd
Description copied from interface:HasRangeSet end of range. If the value is set after this date, the component will not validate.- Specified by:
setRangeEndin interfaceHasRange<V>- Parameters:
value- end of allowed range
-
focus
public void focus()Description copied from interface:Component.FocusableSets focus to this component- Specified by:
focusin interfaceComponent.Focusable
-
getTabIndex
public int getTabIndex()Description copied from interface:Component.FocusableGets the tabulator index of theHasTabIndexcomponent.- Specified by:
getTabIndexin interfaceComponent.Focusable- Returns:
- tab index set for the
HasTabIndexcomponent
-
setTabIndex
public void setTabIndex(int tabIndex) Description copied from interface:Component.FocusableSets the tabulator index of theFocusablecomponent. 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.- Specified by:
setTabIndexin interfaceComponent.Focusable- Parameters:
tabIndex- tab index
-
getDatatype
- Specified by:
getDatatypein interfaceHasDatatype<V>- Returns:
- a datatype that is used by this component
-
setDatatype
Description copied from interface:HasDatatypeSets the givendatatypeto the component. Its value will be formatted according to this datatype.- Specified by:
setDatatypein interfaceHasDatatype<V>- Parameters:
datatype-Datatypeinstance
-
commit
public void commit()Description copied from interface:BufferedUpdates all changes since the previous commit to the data source. -
discard
public void discard()Description copied from interface:BufferedDiscards all changes since last commit. The object updates its value from the data source. -
isBuffered
public boolean isBuffered()- Specified by:
isBufferedin interfaceBuffered- Overrides:
isBufferedin classAbstractValueComponent<com.vaadin.ui.InlineDateField,LocalDate, V> - Returns:
trueif buffered mode is on,falseotherwise
-
setBuffered
public void setBuffered(boolean buffered) Description copied from interface:BufferedSets the buffered mode.When in buffered mode, an internal buffer will be used to store changes until
Buffered.commit()is called. CallingBuffered.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()andBuffered.discard()methods serve no purpose.- Specified by:
setBufferedin interfaceBuffered- Overrides:
setBufferedin classAbstractValueComponent<com.vaadin.ui.InlineDateField,LocalDate, V> - Parameters:
buffered-trueif buffered mode should be turned on,falseotherwise
-
isModified
public boolean isModified()Description copied from interface:BufferedTests if the value stored in the object has been modified since it was last updated from the data source.- Specified by:
isModifiedin interfaceBuffered- Overrides:
isModifiedin classAbstractValueComponent<com.vaadin.ui.InlineDateField,LocalDate, V> - Returns:
trueif the value in the object has been modified since the last data source update,falseif not.
-