Package com.flowingcode.addons.ycalendar
Class YearCalendar
java.lang.Object
com.vaadin.flow.component.Component
com.flowingcode.addons.ycalendar.AbstractCalendarComponent<YearCalendar>
com.flowingcode.addons.ycalendar.YearCalendar
- All Implemented Interfaces:
AttachNotifier,DetachNotifier,HasElement,HasSize,HasStyle,HasTheme,Serializable
@Tag("fc-year-calendar")
@JsModule("./fc-year-calendar/fc-year-calendar.js")
@Uses(MonthCalendar.class)
public class YearCalendar
extends AbstractCalendarComponent<YearCalendar>
implements HasSize, HasTheme
A component that displays the calendar of a whole year.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds a year value change listener.intgetYear()Return the displayed year.voidRefresh all the dates that are currently displayed.voidrefreshItem(LocalDate date) If the year is currently displayed, refresh the given date.voidsetClassNameGenerator(ValueProvider<LocalDate, String> classNameGenerator) Sets the function that generates CSS class names for days in this calendar.voidsetReadOnly(boolean readOnly) Sets the read-only mode.voidsetYear(int year) Updates the displayed year.Methods inherited from class com.flowingcode.addons.ycalendar.AbstractCalendarComponent
addDateSelectedListener, onAttach, setI18nMethods 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, 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.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, setThemeName
-
Constructor Details
-
YearCalendar
public YearCalendar()
-
-
Method Details
-
setYear
public void setYear(int year) Updates the displayed year.- Parameters:
year- The year to set
-
getYear
public int getYear()Return the displayed year.- Returns:
- The displayed year
-
setReadOnly
public void setReadOnly(boolean readOnly) Sets the read-only mode.- Parameters:
readOnly- Whether the calendar is set to be read-only
-
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- The function that generates CSS class names, can be null
-
refreshAll
public void refreshAll()Refresh all the dates that are currently displayed.- Specified by:
refreshAllin classAbstractCalendarComponent<YearCalendar>
-
refreshItem
If the year is currently displayed, refresh the given date. Otherwise do nothing. -
addYearChangedListener
public Registration addYearChangedListener(ComponentEventListener<YearChangedEvent<YearCalendar>> listener) Adds a year value change listener. The listener is called when the year value changes.- Parameters:
listener- The handler for the year changed event, not null- Returns:
- a registration for the listener
-