Package com.vaadin.ui

Class AbstractLocalDateTimeField

    • Constructor Detail

      • AbstractLocalDateTimeField

        public AbstractLocalDateTimeField()
        Constructs an empty AbstractLocalDateTimeField with no caption.
      • AbstractLocalDateTimeField

        public AbstractLocalDateTimeField​(java.lang.String caption)
        Constructs an empty AbstractLocalDateTimeField with caption.
        Parameters:
        caption - the caption of the datefield.
      • AbstractLocalDateTimeField

        public AbstractLocalDateTimeField​(java.lang.String caption,
                                          java.time.LocalDateTime value)
        Constructs a new AbstractLocalDateTimeField with the given caption and initial text contents.
        Parameters:
        caption - the caption String for the editor.
        value - the LocalDateTime value.
    • Method Detail

      • getState

        protected com.vaadin.shared.ui.datefield.AbstractTextualDateFieldState getState()
        Description copied from class: AbstractComponent
        Returns the shared state bean with information to be sent from the server to the client. Subclasses should override this method and set any relevant fields of the state returned by super.getState().
        Overrides:
        getState in class AbstractDateField<java.time.LocalDateTime,​com.vaadin.shared.ui.datefield.DateTimeResolution>
        Returns:
        updated component shared state
      • getState

        protected com.vaadin.shared.ui.datefield.AbstractTextualDateFieldState getState​(boolean markAsDirty)
        Description copied from class: AbstractClientConnector
        Returns the shared state for this connector.
        Overrides:
        getState in class AbstractDateField<java.time.LocalDateTime,​com.vaadin.shared.ui.datefield.DateTimeResolution>
        Parameters:
        markAsDirty - true if the connector should automatically be marked dirty, false otherwise
        Returns:
        The shared state for this connector. Never null.
        See Also:
        AbstractClientConnector.getState()
      • getDatePart

        protected int getDatePart​(java.time.LocalDateTime date,
                                  com.vaadin.shared.ui.datefield.DateTimeResolution resolution)
        Description copied from class: AbstractDateField
        Returns a date integer value part for the given date for the given resolution.
        Specified by:
        getDatePart in class AbstractDateField<java.time.LocalDateTime,​com.vaadin.shared.ui.datefield.DateTimeResolution>
        Parameters:
        date - the given date, can be null
        resolution - the resolution to extract a value from the date by, not null
        Returns:
        the integer value part of the date by the given resolution
      • getRangeValidator

        protected RangeValidator<java.time.LocalDateTime> getRangeValidator()
        Description copied from class: AbstractDateField
        Returns a custom date range validator which is applicable for the type T.
        Specified by:
        getRangeValidator in class AbstractDateField<java.time.LocalDateTime,​com.vaadin.shared.ui.datefield.DateTimeResolution>
        Returns:
        the date range validator
      • buildDate

        protected java.time.LocalDateTime buildDate​(java.util.Map<com.vaadin.shared.ui.datefield.DateTimeResolution,​java.lang.Integer> resolutionValues)
        Description copied from class: AbstractDateField
        Builds date by the given resolutionValues which is a map whose keys are resolution and integer values.

        This is the opposite to AbstractDateField.getDatePart(Temporal, Enum).

        Specified by:
        buildDate in class AbstractDateField<java.time.LocalDateTime,​com.vaadin.shared.ui.datefield.DateTimeResolution>
        Parameters:
        resolutionValues - date values to construct a date
        Returns:
        date built from the given map of date values
      • convertFromDate

        protected java.time.LocalDateTime convertFromDate​(java.util.Date date)
        Description copied from class: AbstractDateField
        Converts Date to date type T.
        Specified by:
        convertFromDate in class AbstractDateField<java.time.LocalDateTime,​com.vaadin.shared.ui.datefield.DateTimeResolution>
        Parameters:
        date - a date to convert
        Returns:
        object of type T representing the date
      • convertToDate

        protected java.util.Date convertToDate​(java.time.LocalDateTime date)
        Description copied from class: AbstractDateField
        Converts the object of type T to Date.

        This is the opposite to AbstractDateField.convertFromDate(Date).

        Specified by:
        convertToDate in class AbstractDateField<java.time.LocalDateTime,​com.vaadin.shared.ui.datefield.DateTimeResolution>
        Parameters:
        date - the date of type T
        Returns:
        converted date of type Date
      • adjustToResolution

        protected java.time.LocalDateTime adjustToResolution​(java.time.LocalDateTime date,
                                                             com.vaadin.shared.ui.datefield.DateTimeResolution forResolution)
        Description copied from class: AbstractDateField
        Adjusts the given date to the given resolution. Any values that are more specific than the given resolution are truncated to their default values.
        Specified by:
        adjustToResolution in class AbstractDateField<java.time.LocalDateTime,​com.vaadin.shared.ui.datefield.DateTimeResolution>
        Parameters:
        date - the date to adjust, can be null
        forResolution - the resolution to be used in the adjustment, can be null
        Returns:
        an adjusted date that matches the given resolution, or null if the given date, resolution, or both were null
      • formatDate

        protected java.lang.String formatDate​(java.time.LocalDateTime value)
        Description copied from class: AbstractDateField
        Formats date according to the components locale.
        Specified by:
        formatDate in class AbstractDateField<java.time.LocalDateTime,​com.vaadin.shared.ui.datefield.DateTimeResolution>
        Parameters:
        value - the date or null
        Returns:
        textual representation of the date or empty string for null
      • toType

        protected java.time.LocalDateTime toType​(java.time.temporal.TemporalAccessor temporalAccessor)
        Description copied from class: AbstractDateField
        Converts a temporal value into field-specific data type.
        Specified by:
        toType in class AbstractDateField<java.time.LocalDateTime,​com.vaadin.shared.ui.datefield.DateTimeResolution>
        Parameters:
        temporalAccessor - - source value
        Returns:
        conversion result.