java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.AbstractField<MonthPicker,YearMonth>
com.vaadin.flow.component.AbstractSinglePropertyField<MonthPicker,YearMonth>
org.vaadin.addons.componentfactory.monthpicker.MonthPicker
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.BlurNotifier<MonthPicker>, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.Focusable<MonthPicker>, com.vaadin.flow.component.FocusNotifier<MonthPicker>, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasEnabled, com.vaadin.flow.component.HasHelper, com.vaadin.flow.component.HasLabel, com.vaadin.flow.component.HasPlaceholder, com.vaadin.flow.component.HasStyle, com.vaadin.flow.component.HasValidation, com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<MonthPicker,YearMonth>,YearMonth>, com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<MonthPicker,YearMonth>,YearMonth>, com.vaadin.flow.component.shared.HasAutoOpen, com.vaadin.flow.component.shared.HasClearButton, com.vaadin.flow.component.shared.HasTooltip, Serializable

@Tag("vcf-month-picker") @NpmPackage(value="@vaadin-component-factory/vcf-month-picker", version="3.0.0-beta1") @JsModule("@vaadin-component-factory/vcf-month-picker/dist/src/vcf-month-picker.js") public class MonthPicker extends com.vaadin.flow.component.AbstractSinglePropertyField<MonthPicker,YearMonth> implements com.vaadin.flow.component.HasLabel, com.vaadin.flow.component.shared.HasAutoOpen, com.vaadin.flow.component.shared.HasClearButton, com.vaadin.flow.component.HasPlaceholder, com.vaadin.flow.component.HasHelper, com.vaadin.flow.component.HasValidation, com.vaadin.flow.component.shared.HasTooltip, com.vaadin.flow.component.Focusable<MonthPicker>
Server-side component for the vcf-month-picker element.

The Month Picker component is a calendar-like field that allows users to select a month within a specific year.

This component can be configured with localization options and custom formats for parsing and displaying the selected year-month.

See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    A class that contains internationalization settings for the MonthPicker component.
    static class 
    Event fired when the opened state of the overlay changes.

    Nested classes/interfaces inherited from class com.vaadin.flow.component.AbstractField

    com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<C extends com.vaadin.flow.component.Component,V>

    Nested classes/interfaces inherited from interface com.vaadin.flow.component.BlurNotifier

    com.vaadin.flow.component.BlurNotifier.BlurEvent<C extends com.vaadin.flow.component.Component>

    Nested classes/interfaces inherited from interface com.vaadin.flow.component.FocusNotifier

    com.vaadin.flow.component.FocusNotifier.FocusEvent<C extends com.vaadin.flow.component.Component>

    Nested classes/interfaces inherited from interface com.vaadin.flow.component.HasValue

    com.vaadin.flow.component.HasValue.ValueChangeEvent<V>, com.vaadin.flow.component.HasValue.ValueChangeListener<E extends com.vaadin.flow.component.HasValue.ValueChangeEvent<?>>
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an empty MonthPicker instance with no initial value.
    MonthPicker(YearMonth initialYearMonth)
    Creates a MonthPicker with the given initial value.
  • Method Summary

    Modifier and Type
    Method
    Description
    com.vaadin.flow.shared.Registration
    addOpenedChangeListener(com.vaadin.flow.component.ComponentEventListener<MonthPicker.OpenedChangeEvent> listener)
    Adds a listener for vcf-month-picker-opened-changed events triggered when the overlay is opened or closed.
     
    Returns the current internationalization settings used by the month picker.
    int
    Gets the maximum selectable year.
    int
    Gets the minimum selectable year.
    boolean
     
    boolean
    Returns whether the month picker overlay is currently open.
    void
    setErrorMessage(String errorMessage)
     
    void
    Sets the internationalization (i18n) properties for this month picker.
    void
    setInvalid(boolean invalid)
     
    void
    setMaxYear(int maxYear)
    Sets the maximum selectable year in the month picker.
    void
    setMinYear(int minYear)
    Sets the minimum selectable year in the month picker.

    Methods inherited from class com.vaadin.flow.component.AbstractSinglePropertyField

    getSynchronizationRegistration, hasValidValue, setPresentationValue, setSynchronizedEvent

    Methods inherited from class com.vaadin.flow.component.AbstractField

    addValueChangeListener, getEmptyValue, getValue, isEmpty, setModelValue, setValue, valueEquals

    Methods 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, setVisible

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.vaadin.flow.component.AttachNotifier

    addAttachListener

    Methods inherited from interface com.vaadin.flow.component.BlurNotifier

    addBlurListener

    Methods inherited from interface com.vaadin.flow.component.DetachNotifier

    addDetachListener

    Methods inherited from interface com.vaadin.flow.component.Focusable

    addFocusShortcut, blur, focus, getTabIndex, setTabIndex

    Methods inherited from interface com.vaadin.flow.component.FocusNotifier

    addFocusListener

    Methods inherited from interface com.vaadin.flow.component.shared.HasAutoOpen

    isAutoOpen, setAutoOpen

    Methods inherited from interface com.vaadin.flow.component.shared.HasClearButton

    isClearButtonVisible, setClearButtonVisible

    Methods inherited from interface com.vaadin.flow.component.HasElement

    getElement

    Methods inherited from interface com.vaadin.flow.component.HasEnabled

    isEnabled, setEnabled

    Methods inherited from interface com.vaadin.flow.component.HasHelper

    getHelperComponent, getHelperText, setHelperComponent, setHelperText

    Methods inherited from interface com.vaadin.flow.component.HasLabel

    getLabel, setLabel

    Methods inherited from interface com.vaadin.flow.component.HasPlaceholder

    getPlaceholder, setPlaceholder

    Methods inherited from interface com.vaadin.flow.component.HasStyle

    addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName

    Methods inherited from interface com.vaadin.flow.component.shared.HasTooltip

    getTooltip, setTooltipMarkdown, setTooltipText

    Methods inherited from interface com.vaadin.flow.component.HasValidation

    setManualValidation

    Methods inherited from interface com.vaadin.flow.component.HasValue

    clear, getOptionalValue

    Methods inherited from interface com.vaadin.flow.component.HasValueAndElement

    isReadOnly, isRequiredIndicatorVisible, setReadOnly, setRequiredIndicatorVisible
  • Constructor Details

    • MonthPicker

      public MonthPicker()
      Creates an empty MonthPicker instance with no initial value.
    • MonthPicker

      public MonthPicker(YearMonth initialYearMonth)
      Creates a MonthPicker with the given initial value.
      Parameters:
      initialYearMonth - the initial selected YearMonth
  • Method Details

    • setErrorMessage

      public void setErrorMessage(String errorMessage)
      Specified by:
      setErrorMessage in interface com.vaadin.flow.component.HasValidation
    • getErrorMessage

      public String getErrorMessage()
      Specified by:
      getErrorMessage in interface com.vaadin.flow.component.HasValidation
    • setInvalid

      public void setInvalid(boolean invalid)
      Specified by:
      setInvalid in interface com.vaadin.flow.component.HasValidation
    • isInvalid

      public boolean isInvalid()
      Specified by:
      isInvalid in interface com.vaadin.flow.component.HasValidation
    • setMinYear

      public void setMinYear(int minYear)
      Sets the minimum selectable year in the month picker.
      Parameters:
      minYear - the minimum year
    • getMinYear

      public int getMinYear()
      Gets the minimum selectable year.
      Returns:
      the minimum year
    • setMaxYear

      public void setMaxYear(int maxYear)
      Sets the maximum selectable year in the month picker.
      Parameters:
      maxYear - the maximum year
    • getMaxYear

      public int getMaxYear()
      Gets the maximum selectable year.
      Returns:
      the maximum year
    • getI18n

      public MonthPicker.MonthPickerI18n getI18n()
      Returns the current internationalization settings used by the month picker.
      Returns:
      the MonthPicker.MonthPickerI18n settings
    • seti18n

      public void seti18n(MonthPicker.MonthPickerI18n i18n)
      Sets the internationalization (i18n) properties for this month picker.
      Parameters:
      i18n - the MonthPicker.MonthPickerI18n object with translation settings (must not be null)
    • isOpened

      @Synchronize(property="opened", value="vcf-month-picker-opened-changed") public boolean isOpened()
      Returns whether the month picker overlay is currently open.

      This property is synchronized from the client when the vcf-month-picker-opened-changed event occurs.

      Returns:
      true if open, false otherwise
    • addOpenedChangeListener

      public com.vaadin.flow.shared.Registration addOpenedChangeListener(com.vaadin.flow.component.ComponentEventListener<MonthPicker.OpenedChangeEvent> listener)
      Adds a listener for vcf-month-picker-opened-changed events triggered when the overlay is opened or closed.
      Parameters:
      listener - the event listener
      Returns:
      a Registration for removing the listener