Class RecurrentScheduleField

All Implemented Interfaces:
AttachNotifier, BlurNotifier<CustomField<DateTimeRange>>, DetachNotifier, Focusable<CustomField<DateTimeRange>>, FocusNotifier<CustomField<DateTimeRange>>, HasElement, HasEnabled, HasHelper, HasLabel, HasSize, HasStyle, HasTheme, HasValidation, HasValue<AbstractField.ComponentValueChangeEvent<CustomField<DateTimeRange>,DateTimeRange>,DateTimeRange>, HasValueAndElement<AbstractField.ComponentValueChangeEvent<CustomField<DateTimeRange>,DateTimeRange>,DateTimeRange>, HasTooltip, HasValidationProperties, InputField<AbstractField.ComponentValueChangeEvent<CustomField<DateTimeRange>,DateTimeRange>,DateTimeRange>, HasValidator<DateTimeRange>, Serializable

public class RecurrentScheduleField extends CustomField<DateTimeRange> implements HasValidator<DateTimeRange>
A component to generate TimeInterval instances by customizing a DateTimeRange.
Features:
  • Date range: Select start and end dates with optional maximum span.
  • Days: Choose specific days of the week or predefined groups.
  • Time range: Define start and end times with customizable steps and locale.

Provides validation, customization, and internationalization support for flexible scheduling.

Author:
Flowing Code
See Also:
  • Constructor Details

    • RecurrentScheduleField

      public RecurrentScheduleField()
      Creates a new RecurrentScheduleField with the default error message.
    • RecurrentScheduleField

      public RecurrentScheduleField(String errorMessage)
      Creates a new RecurrentScheduleField with a custom error message.
      Parameters:
      errorMessage - the error message to display when validation fails
    • RecurrentScheduleField

      public RecurrentScheduleField(DateTimeRange defaultValue, String errorMessage)
      Creates a new RecurrentScheduleField with a default value and custom error message.
      Parameters:
      defaultValue - the initial DateTimeRange value
      errorMessage - the error message to display when validation fails
    • RecurrentScheduleField

      public RecurrentScheduleField(DateTimeRange defaultValue)
      Creates a new RecurrentScheduleField with a default value.
      Parameters:
      defaultValue - the initial DateTimeRange value
  • Method Details

    • getValue

      public DateTimeRange getValue()
      Retrieves the current value of the RecurrentScheduleField component.
      Specified by:
      getValue in interface HasValue<AbstractField.ComponentValueChangeEvent<CustomField<DateTimeRange>,DateTimeRange>,DateTimeRange>
      Overrides:
      getValue in class AbstractField<CustomField<DateTimeRange>,DateTimeRange>
      Returns:
      the current DateTimeRange value, or null if the fields are invalid or incomplete
    • generateModelValue

      protected DateTimeRange generateModelValue()
      Specified by:
      generateModelValue in class CustomField<DateTimeRange>
    • setPresentationValue

      protected void setPresentationValue(DateTimeRange dateTimeRange)
      Specified by:
      setPresentationValue in class CustomField<DateTimeRange>
    • getDefaultValidator

      public Validator<DateTimeRange> getDefaultValidator()
      Specified by:
      getDefaultValidator in interface HasValidator<DateTimeRange>
    • setVisible

      public void setVisible(boolean visible)
      Changes this component's visibility state.
      Overrides:
      setVisible in class Component
      Parameters:
      visible - whether this component should be visible
    • setReadOnly

      public void setReadOnly(boolean readOnly)
      Changes this component's read-only state.
      Specified by:
      setReadOnly in interface HasValue<AbstractField.ComponentValueChangeEvent<CustomField<DateTimeRange>,DateTimeRange>,DateTimeRange>
      Specified by:
      setReadOnly in interface HasValueAndElement<AbstractField.ComponentValueChangeEvent<CustomField<DateTimeRange>,DateTimeRange>,DateTimeRange>
      Parameters:
      readOnly - whether this component should be read-only
    • setMaxDaysSpan

      public void setMaxDaysSpan(int max)
      Sets the maximum days distance between start and end dates.
      Parameters:
      max - the maximum distance measured in days
    • setMinDate

      public void setMinDate(LocalDate date)
      Sets the minimum start date.
      Parameters:
      date - the minimum date that can be selected
    • setMaxDate

      public void setMaxDate(LocalDate date)
      Sets the maximum end date.
      Parameters:
      date - the maximum date that can be selected
    • setMinTime

      public void setMinTime(LocalTime time)
      Sets the minimum start time.
      Parameters:
      time - the minimum time that can be selected
    • setMaxTime

      public void setMaxTime(LocalTime time)
      Sets the maximum end time.
      Parameters:
      time - the maximum time that can be selected
    • setWeekDays

      public void setWeekDays(DayOfWeek... weekDaySelector)
      Sets the selected week days.
      Parameters:
      weekDaySelector - the days that will be selected
      note that days not included will be deselected
    • setFirstWeekDay

      public void setFirstWeekDay(DayOfWeek weekDay)
      Sets which day should be placed at the starting or left-most position.
      Parameters:
      weekDay - the starting or left-most day
    • setDatesReadOnly

      public void setDatesReadOnly(boolean readOnly)
      Changes the date pickers' read-only state.
      Parameters:
      readOnly - whether the date pickers should be read-only
    • setDatesVisible

      public void setDatesVisible(boolean visible)
      Changes the date pickers' visibility state.
      Parameters:
      visible - whether the date pickers should be visible
    • setDaysReadOnly

      public void setDaysReadOnly(boolean readOnly)
      Changes the days picker's read-only state.
      Parameters:
      readOnly - whether the days picker should be read-only
    • setDaysVisible

      public void setDaysVisible(boolean visible)
      Changes the days picker's visibility state.
      Parameters:
      visible - whether the days picker should be visible
    • setDaysChipsVisible

      public void setDaysChipsVisible(boolean visible)
      Changes the days chips' visibility state.
      Parameters:
      visible - whether the days chips should be visible
    • setTimesReadOnly

      public void setTimesReadOnly(boolean readOnly)
      Changes the time pickers' read-only state.
      Parameters:
      readOnly - whether the time pickers should be read-only
    • setTimesVisible

      public void setTimesVisible(boolean visible)
      Changes the time pickers' visibility state.
      Parameters:
      visible - whether the time pickers should be visible
    • setTimeChipsVisible

      public void setTimeChipsVisible(boolean visible)
      Changes the time chips' visibility state.
      Parameters:
      visible - whether the time chips should be visible
    • setIndicatorVisible

      public void setIndicatorVisible(boolean visible)
      Changes the left line indicator's visibility state.
      Parameters:
      visible - whether the left indicator should be visible
    • setTimeStep

      public void setTimeStep(Duration step)
      Sets the minimum time gap for the time selection lists.
      Parameters:
      step - the time difference between adjacent lists' items
    • setTimeLocale

      public void setTimeLocale(Locale locale)
      Sets the time locale for the time selection lists.
      Parameters:
      locale - the Locale to use for the time lists' items
    • setI18n

      public void setI18n(RecurrentScheduleFieldI18n i18n)
      Sets the custom text properties for internationalization purposes.
      Parameters:
      i18n - instance to attach
      See Also: