Package com.flowingcode.addons.ycalendar
Class InlineDatePicker
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.AbstractField<C,T>
com.vaadin.flow.component.AbstractSinglePropertyField<InlineDatePicker,LocalDate>
com.flowingcode.addons.ycalendar.InlineDatePicker
- All Implemented Interfaces:
AttachNotifier,DetachNotifier,HasElement,HasEnabled,HasSize,HasStyle,HasTheme,HasValue<AbstractField.ComponentValueChangeEvent<InlineDatePicker,,LocalDate>, LocalDate> HasValueAndElement<AbstractField.ComponentValueChangeEvent<InlineDatePicker,,LocalDate>, LocalDate> Serializable
@Tag("fc-inline-date-picker")
@JsModule("./fc-inline-date-picker/fc-inline-date-picker.js")
@Uses(YearMonthField.class) @Uses(MonthCalendar.class)
public class InlineDatePicker
extends AbstractSinglePropertyField<InlineDatePicker,LocalDate>
implements HasSize, HasTheme
- 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.HasValue
HasValue.ValueChangeEvent<V extends Object>, HasValue.ValueChangeListener<E extends HasValue.ValueChangeEvent<?>> -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance of InlineDatePicker initialized with the current date and with week numbers visible. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the state of theshowWeekNumbersproperty of the datepicker.voidRefresh the styles of all dates in the displayed year and month.voidrefreshItem(LocalDate date) Refresh the style of the given date.voidsetClassNameGenerator(ValueProvider<LocalDate, String> classNameGenerator) Sets the function that generates CSS class names for days in this calendar.voidSets the i18n object.voidvoidsetWeekNumbersVisible(boolean weekNumbersVisible) Sets whether week numbers should be visible on the calendar.Methods inherited from class com.vaadin.flow.component.AbstractSinglePropertyField
getSynchronizationRegistration, hasValidValue, setPresentationValue, setSynchronizedEventMethods inherited from class com.vaadin.flow.component.AbstractField
addValueChangeListener, getEmptyValue, getValue, isEmpty, setModelValue, 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, onAttach, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setVisibleMethods 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.DetachNotifier
addDetachListenerMethods 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.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.HasValue
clear, getOptionalValueMethods inherited from interface com.vaadin.flow.component.HasValueAndElement
isReadOnly, isRequiredIndicatorVisible, setReadOnly, setRequiredIndicatorVisible
-
Constructor Details
-
InlineDatePicker
public InlineDatePicker()Creates a new instance of InlineDatePicker initialized with the current date and with week numbers visible.
-
-
Method Details
-
setWeekNumbersVisible
public void setWeekNumbersVisible(boolean weekNumbersVisible) Sets whether week numbers should be visible on the calendar.Notice that displaying week numbers is only supported when i18n.firstDayOfWeek is 1 (Monday).
- Parameters:
weekNumbersVisible-trueif ISO-8601 week numbers should be displayed in the calendar,falseotherwise
-
isWeekNumbersVisible
public boolean isWeekNumbersVisible()Returns the state of theshowWeekNumbersproperty of the datepicker.Note that this property is not synchronized automatically from the client side, so the returned value may not be the same as in client-side code.
- Returns:
- the state of the
showWeekNumbersproperty of the datepicker
-
setI18n
Sets the i18n object.- Parameters:
i18n- theDatepickerI18nobject used to initialize i18n
-
setClassNameGenerator
Sets the function that generates CSS class names for days in this calendar. Returningnullfrom the generator results in no custom class name being set. Multiple class names can be returned from the generator as space-separated.- Parameters:
classNameGenerator- theValueProviderto use for generating class names
-
refreshAll
public void refreshAll()Refresh the styles of all dates in the displayed year and month. -
refreshItem
Refresh the style of the given date.- Parameters:
date- the date to update the style for
-
setValue
- Specified by:
setValuein interfaceHasValue<AbstractField.ComponentValueChangeEvent<InlineDatePicker,LocalDate>, LocalDate> - Overrides:
setValuein classAbstractField<InlineDatePicker,LocalDate>
-