Class 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>
  • Field Details

  • Constructor Details

    • DatePickerImpl

      public DatePickerImpl()
  • Method Details

    • createComponent

      protected com.vaadin.ui.InlineDateField createComponent()
    • setDataAwareComponentsTools

      @Autowired public void setDataAwareComponentsTools(DataAwareComponentsTools dataAwareComponentsTools)
    • setDateTimeTransformations

      @Autowired public void setDateTimeTransformations(DateTimeTransformations dateTimeTransformations)
    • setMessages

      @Autowired public void setMessages(Messages messages)
    • getResolution

      public DatePicker.Resolution getResolution()
      Description copied from interface: DatePicker
      Returns resolution of the DatePicker.
      Specified by:
      getResolution in interface DatePicker<V>
      Returns:
      Resolution
    • setResolution

      public void setResolution(DatePicker.Resolution resolution)
      Description copied from interface: DatePicker
      Sets resolution of the DatePicker.
      Specified by:
      setResolution in interface DatePicker<V>
      Parameters:
      resolution - resolution
    • valueBindingConnected

      protected void valueBindingConnected(ValueSource<V> valueSource)
      Overrides:
      valueBindingConnected in class AbstractValueComponent<com.vaadin.ui.InlineDateField,LocalDate,V>
    • convertToModel

      @Nullable protected V convertToModel(@Nullable LocalDate componentRawValue) throws ConversionException
      Overrides:
      convertToModel in class AbstractValueComponent<com.vaadin.ui.InlineDateField,LocalDate,V>
      Throws:
      ConversionException
    • convertToPresentation

      @Nullable protected LocalDate convertToPresentation(@Nullable V modelValue) throws ConversionException
      Overrides:
      convertToPresentation in class AbstractValueComponent<com.vaadin.ui.InlineDateField,LocalDate,V>
      Throws:
      ConversionException
    • convertToLocalDateTime

      protected LocalDateTime convertToLocalDateTime(Object date)
    • convertFromLocalDateTime

      protected Object convertFromLocalDateTime(LocalDateTime localDateTime, Class javaType)
    • getRangeStart

      @Nullable public V getRangeStart()
      Description copied from interface: HasRange
      Return start of range for a certain resolution.
      Specified by:
      getRangeStart in interface HasRange<V>
      Returns:
      start of allowed range
    • setRangeStart

      public void setRangeStart(@Nullable V value)
      Description copied from interface: HasRange
      Set start of range. If the value is set before this date, the component will not validate.
      Specified by:
      setRangeStart in interface HasRange<V>
      Parameters:
      value - allowed start of range
    • getRangeEnd

      @Nullable public V getRangeEnd()
      Description copied from interface: HasRange
      Return end of range for a certain resolution.
      Specified by:
      getRangeEnd in interface HasRange<V>
      Returns:
      end of allowed range
    • setRangeEnd

      public void setRangeEnd(@Nullable V value)
      Description copied from interface: HasRange
      Set end of range. If the value is set after this date, the component will not validate.
      Specified by:
      setRangeEnd in interface HasRange<V>
      Parameters:
      value - end of allowed range
    • focus

      public void focus()
      Description copied from interface: Component.Focusable
      Sets focus to this component
      Specified by:
      focus in interface Component.Focusable
    • getTabIndex

      public int getTabIndex()
      Description copied from interface: Component.Focusable
      Gets the tabulator index of the HasTabIndex component.
      Specified by:
      getTabIndex in interface Component.Focusable
      Returns:
      tab index set for the HasTabIndex component
    • setTabIndex

      public void setTabIndex(int tabIndex)
      Description copied from interface: Component.Focusable
      Sets the tabulator index of the 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.
      Specified by:
      setTabIndex in interface Component.Focusable
      Parameters:
      tabIndex - tab index
    • getDatatype

      @Nullable public Datatype<V> getDatatype()
      Specified by:
      getDatatype in interface HasDatatype<V>
      Returns:
      a datatype that is used by this component
    • setDatatype

      public void setDatatype(Datatype<V> datatype)
      Description copied from interface: HasDatatype
      Sets the given datatype to the component. Its value will be formatted according to this datatype.
      Specified by:
      setDatatype in interface HasDatatype<V>
      Parameters:
      datatype - Datatype instance
    • commit

      public void commit()
      Description copied from interface: Buffered
      Updates all changes since the previous commit to the data source.
      Specified by:
      commit in interface Buffered
      Overrides:
      commit in class AbstractValueComponent<com.vaadin.ui.InlineDateField,LocalDate,V>
    • discard

      public void discard()
      Description copied from interface: Buffered
      Discards all changes since last commit. The object updates its value from the data source.
      Specified by:
      discard in interface Buffered
      Overrides:
      discard in class AbstractValueComponent<com.vaadin.ui.InlineDateField,LocalDate,V>
    • isBuffered

      public boolean isBuffered()
      Specified by:
      isBuffered in interface Buffered
      Overrides:
      isBuffered in class AbstractValueComponent<com.vaadin.ui.InlineDateField,LocalDate,V>
      Returns:
      true if buffered mode is on, false otherwise
    • setBuffered

      public void setBuffered(boolean buffered)
      Description copied from interface: Buffered
      Sets the buffered mode.

      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.

      Specified by:
      setBuffered in interface Buffered
      Overrides:
      setBuffered in class AbstractValueComponent<com.vaadin.ui.InlineDateField,LocalDate,V>
      Parameters:
      buffered - true if buffered mode should be turned on, false otherwise
    • isModified

      public boolean isModified()
      Description copied from interface: Buffered
      Tests if the value stored in the object has been modified since it was last updated from the data source.
      Specified by:
      isModified in interface Buffered
      Overrides:
      isModified in class AbstractValueComponent<com.vaadin.ui.InlineDateField,LocalDate,V>
      Returns:
      true if the value in the object has been modified since the last data source update, false if not.