Class RecurrentScheduleField
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.AbstractField<CustomField<T>,T>
com.vaadin.flow.component.customfield.CustomField<DateTimeRange>
com.flowingcode.vaadin.addons.recurrentschedulefield.ui.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:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.vaadin.flow.component.AbstractField
AbstractField.ComponentValueChangeEvent<C extends Component,V extends Object> Nested classes/interfaces inherited from interface com.vaadin.flow.component.BlurNotifier
BlurNotifier.BlurEvent<C extends Component>Nested classes/interfaces inherited from interface com.vaadin.flow.component.FocusNotifier
FocusNotifier.FocusEvent<C extends Component>Nested classes/interfaces inherited from interface com.vaadin.flow.component.HasValue
HasValue.ValueChangeEvent<V extends Object>, HasValue.ValueChangeListener<E extends HasValue.ValueChangeEvent<?>> -
Constructor Summary
ConstructorsConstructorDescriptionCreates a newRecurrentScheduleFieldwith the default error message.RecurrentScheduleField(DateTimeRange defaultValue) Creates a newRecurrentScheduleFieldwith a default value.RecurrentScheduleField(DateTimeRange defaultValue, String errorMessage) Creates a newRecurrentScheduleFieldwith a default value and custom error message.RecurrentScheduleField(String errorMessage) Creates a newRecurrentScheduleFieldwith a custom error message. -
Method Summary
Modifier and TypeMethodDescriptionprotected DateTimeRangegetValue()Retrieves the current value of the RecurrentScheduleField component.voidsetDatesReadOnly(boolean readOnly) Changes the date pickers' read-only state.voidsetDatesVisible(boolean visible) Changes the date pickers' visibility state.voidsetDaysChipsVisible(boolean visible) Changes the days chips' visibility state.voidsetDaysReadOnly(boolean readOnly) Changes the days picker's read-only state.voidsetDaysVisible(boolean visible) Changes the days picker's visibility state.voidsetFirstWeekDay(DayOfWeek weekDay) Sets which day should be placed at the starting or left-most position.voidSets the custom text properties for internationalization purposes.voidsetIndicatorVisible(boolean visible) Changes the left line indicator's visibility state.voidsetMaxDate(LocalDate date) Sets the maximum end date.voidsetMaxDaysSpan(int max) Sets the maximum days distance between start and end dates.voidsetMaxTime(LocalTime time) Sets the maximum end time.voidsetMinDate(LocalDate date) Sets the minimum start date.voidsetMinTime(LocalTime time) Sets the minimum start time.protected voidsetPresentationValue(DateTimeRange dateTimeRange) voidsetReadOnly(boolean readOnly) Changes this component's read-only state.voidsetTimeChipsVisible(boolean visible) Changes the time chips' visibility state.voidsetTimeLocale(Locale locale) Sets the time locale for the time selection lists.voidsetTimesReadOnly(boolean readOnly) Changes the time pickers' read-only state.voidsetTimeStep(Duration step) Sets the minimum time gap for the time selection lists.voidsetTimesVisible(boolean visible) Changes the time pickers' visibility state.voidsetVisible(boolean visible) Changes this component's visibility state.voidsetWeekDays(DayOfWeek... weekDaySelector) Sets the selected week days.Methods inherited from class com.vaadin.flow.component.customfield.CustomField
add, addThemeVariants, getLabel, onAttach, remove, removeThemeVariants, setLabel, updateValueMethods inherited from class com.vaadin.flow.component.AbstractField
addValueChangeListener, getEmptyValue, isEmpty, setModelValue, setValue, valueEqualsMethods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setIdMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.BlurNotifier
addBlurListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.Focusable
addFocusShortcut, blur, focus, getTabIndex, setTabIndexMethods inherited from interface com.vaadin.flow.component.FocusNotifier
addFocusListenerMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabledMethods inherited from interface com.vaadin.flow.component.HasHelper
getHelperComponent, getHelperText, setHelperComponent, setHelperTextMethods inherited from interface com.vaadin.flow.component.HasSize
getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFullMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameMethods inherited from interface com.vaadin.flow.component.HasTheme
addThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeNameMethods inherited from interface com.vaadin.flow.component.shared.HasTooltip
getTooltip, setTooltipTextMethods inherited from interface com.vaadin.flow.component.HasValidation
setManualValidationMethods inherited from interface com.vaadin.flow.component.shared.HasValidationProperties
getErrorMessage, isInvalid, setErrorMessage, setInvalidMethods inherited from interface com.vaadin.flow.data.binder.HasValidator
addValidationStatusChangeListenerMethods inherited from interface com.vaadin.flow.component.HasValue
addValueChangeListener, clear, getEmptyValue, getOptionalValue, isEmpty, setValueMethods inherited from interface com.vaadin.flow.component.HasValueAndElement
isReadOnly, isRequiredIndicatorVisible, setRequiredIndicatorVisible
-
Constructor Details
-
RecurrentScheduleField
public RecurrentScheduleField()Creates a newRecurrentScheduleFieldwith the default error message. -
RecurrentScheduleField
Creates a newRecurrentScheduleFieldwith a custom error message.- Parameters:
errorMessage- the error message to display when validation fails
-
RecurrentScheduleField
Creates a newRecurrentScheduleFieldwith a default value and custom error message.- Parameters:
defaultValue- the initialDateTimeRangevalueerrorMessage- the error message to display when validation fails
-
RecurrentScheduleField
Creates a newRecurrentScheduleFieldwith a default value.- Parameters:
defaultValue- the initialDateTimeRangevalue
-
-
Method Details
-
getValue
Retrieves the current value of the RecurrentScheduleField component.- Specified by:
getValuein interfaceHasValue<AbstractField.ComponentValueChangeEvent<CustomField<DateTimeRange>,DateTimeRange>, DateTimeRange> - Overrides:
getValuein classAbstractField<CustomField<DateTimeRange>,DateTimeRange> - Returns:
- the current
DateTimeRangevalue, or null if the fields are invalid or incomplete
-
generateModelValue
- Specified by:
generateModelValuein classCustomField<DateTimeRange>
-
setPresentationValue
- Specified by:
setPresentationValuein classCustomField<DateTimeRange>
-
getDefaultValidator
- Specified by:
getDefaultValidatorin interfaceHasValidator<DateTimeRange>
-
setVisible
public void setVisible(boolean visible) Changes this component's visibility state.- Overrides:
setVisiblein classComponent- Parameters:
visible- whether this component should be visible
-
setReadOnly
public void setReadOnly(boolean readOnly) Changes this component's read-only state.- Specified by:
setReadOnlyin interfaceHasValue<AbstractField.ComponentValueChangeEvent<CustomField<DateTimeRange>,DateTimeRange>, DateTimeRange> - Specified by:
setReadOnlyin interfaceHasValueAndElement<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
Sets the minimum start date.- Parameters:
date- the minimum date that can be selected
-
setMaxDate
Sets the maximum end date.- Parameters:
date- the maximum date that can be selected
-
setMinTime
Sets the minimum start time.- Parameters:
time- the minimum time that can be selected
-
setMaxTime
Sets the maximum end time.- Parameters:
time- the maximum time that can be selected
-
setWeekDays
Sets the selected week days.- Parameters:
weekDaySelector- the days that will be selected
note that days not included will be deselected
-
setFirstWeekDay
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
Sets the minimum time gap for the time selection lists.- Parameters:
step- the time difference between adjacent lists' items
-
setTimeLocale
Sets the time locale for the time selection lists.- Parameters:
locale- theLocaleto use for the time lists' items
-
setI18n
Sets the custom text properties for internationalization purposes.- Parameters:
i18n- instance to attach- See Also:
-