Class 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 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

      public void setClassNameGenerator(ValueProvider<LocalDate,String> classNameGenerator)
      Sets the function that generates CSS class names for days in this calendar. Returning null from 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:
      refreshAll in class AbstractCalendarComponent<YearCalendar>
    • refreshItem

      public void refreshItem(LocalDate date)
      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