Class MonthPicker
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 ClassesModifier and TypeClassDescriptionstatic classA class that contains internationalization settings for theMonthPickercomponent.static classEvent 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
ConstructorsConstructorDescriptionCreates an empty MonthPicker instance with no initial value.MonthPicker(YearMonth initialYearMonth) Creates a MonthPicker with the given initial value. -
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.shared.RegistrationaddOpenedChangeListener(com.vaadin.flow.component.ComponentEventListener<MonthPicker.OpenedChangeEvent> listener) Adds a listener forvcf-month-picker-opened-changedevents triggered when the overlay is opened or closed.getI18n()Returns the current internationalization settings used by the month picker.intGets the maximum selectable year.intGets the minimum selectable year.booleanbooleanisOpened()Returns whether the month picker overlay is currently open.voidsetErrorMessage(String errorMessage) voidSets the internationalization (i18n) properties for this month picker.voidsetInvalid(boolean invalid) voidsetMaxYear(int maxYear) Sets the maximum selectable year in the month picker.voidsetMinYear(int minYear) Sets the minimum selectable year in the month picker.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, 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, 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.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.shared.HasAutoOpen
isAutoOpen, setAutoOpenMethods inherited from interface com.vaadin.flow.component.shared.HasClearButton
isClearButtonVisible, setClearButtonVisibleMethods 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.HasLabel
getLabel, setLabelMethods inherited from interface com.vaadin.flow.component.HasPlaceholder
getPlaceholder, setPlaceholderMethods 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.shared.HasTooltip
getTooltip, setTooltipMarkdown, setTooltipTextMethods inherited from interface com.vaadin.flow.component.HasValidation
setManualValidationMethods inherited from interface com.vaadin.flow.component.HasValue
clear, getOptionalValueMethods 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
Creates a MonthPicker with the given initial value.- Parameters:
initialYearMonth- the initial selectedYearMonth
-
-
Method Details
-
setErrorMessage
- Specified by:
setErrorMessagein interfacecom.vaadin.flow.component.HasValidation
-
getErrorMessage
- Specified by:
getErrorMessagein interfacecom.vaadin.flow.component.HasValidation
-
setInvalid
public void setInvalid(boolean invalid) - Specified by:
setInvalidin interfacecom.vaadin.flow.component.HasValidation
-
isInvalid
public boolean isInvalid()- Specified by:
isInvalidin interfacecom.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
Returns the current internationalization settings used by the month picker.- Returns:
- the
MonthPicker.MonthPickerI18nsettings
-
seti18n
Sets the internationalization (i18n) properties for this month picker.- Parameters:
i18n- theMonthPicker.MonthPickerI18nobject with translation settings (must not benull)
-
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-changedevent occurs.- Returns:
trueif open,falseotherwise
-
addOpenedChangeListener
public com.vaadin.flow.shared.Registration addOpenedChangeListener(com.vaadin.flow.component.ComponentEventListener<MonthPicker.OpenedChangeEvent> listener) Adds a listener forvcf-month-picker-opened-changedevents triggered when the overlay is opened or closed.- Parameters:
listener- the event listener- Returns:
- a
Registrationfor removing the listener
-