@JsModule(value="./super-date-picker.js")
@Tag(value="super-date-picker")
@CssImport(value="./styles/label-positions.css",
themeFor="vaadin-date-picker-text-field")
public class SuperDatePicker
extends com.vaadin.flow.component.datepicker.DatePicker
implements CanSelectText, CanReceiveSelectionEventsFromClient, WithReceivingSelectionEventsFromClientMixin<SuperDatePicker>, TextSelectionNotifier<SuperDatePicker>, WithLabelPositionableMixin<SuperDatePicker>, WithLocaleMixin<SuperDatePicker>, WithLabelMixin<SuperDatePicker>, WithPlaceholderMixin<SuperDatePicker>, WithDatePatternMixin<SuperDatePicker>, WithValueMixin<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.datepicker.DatePicker,LocalDate>,LocalDate,SuperDatePicker>, WithIdMixin<SuperDatePicker>, WithHelperMixin<SuperDatePicker>, WithHelperPositionableMixin<SuperDatePicker>, WithRequiredMixin<SuperDatePicker>, WithTooltipMixin<SuperDatePicker>
DatePicker that handles I18N also on the client side.com.vaadin.flow.component.datepicker.DatePicker.DatePickerI18ncom.vaadin.flow.component.datepicker.GeneratedVaadinDatePicker.ChangeEvent<R extends com.vaadin.flow.component.datepicker.GeneratedVaadinDatePicker<R,?>>, com.vaadin.flow.component.datepicker.GeneratedVaadinDatePicker.InvalidChangeEvent<R extends com.vaadin.flow.component.datepicker.GeneratedVaadinDatePicker<R,?>>, com.vaadin.flow.component.datepicker.GeneratedVaadinDatePicker.OpenedChangeEvent<R extends com.vaadin.flow.component.datepicker.GeneratedVaadinDatePicker<R,?>>com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<C extends com.vaadin.flow.component.Component,V>com.vaadin.flow.component.HasValue.ValueChangeEvent<V>, com.vaadin.flow.component.HasValue.ValueChangeListener<E extends com.vaadin.flow.component.HasValue.ValueChangeEvent<?>>com.vaadin.flow.component.shared.HasClientValidation.ClientValidatedEventLABEL_POSITION_ATTRIBUTE, LABEL_POSITION_DETAILS_ATTRIBUTEHELPER_ABOVE_THEME_VARIANT| Constructor and Description |
|---|
SuperDatePicker() |
SuperDatePicker(com.vaadin.flow.component.HasValue.ValueChangeListener<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.datepicker.DatePicker,LocalDate>> listener) |
SuperDatePicker(LocalDate initialDate) |
SuperDatePicker(LocalDate initialDate,
com.vaadin.flow.component.HasValue.ValueChangeListener<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.datepicker.DatePicker,LocalDate>> listener) |
SuperDatePicker(LocalDate initialDate,
Locale locale) |
SuperDatePicker(Locale locale) |
SuperDatePicker(String label) |
SuperDatePicker(String label,
com.vaadin.flow.component.HasValue.ValueChangeListener<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.datepicker.DatePicker,LocalDate>> listener) |
SuperDatePicker(String label,
LocalDate initialDate) |
SuperDatePicker(String label,
LocalDate initialDate,
com.vaadin.flow.component.HasValue.ValueChangeListener<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.datepicker.DatePicker,LocalDate>> listener) |
| Modifier and Type | Method and Description |
|---|---|
com.vaadin.flow.shared.Registration |
addTextSelectionListener(TextSelectionListener<SuperDatePicker> listener)
Adds the listener.
|
DatePattern |
getDatePattern()
Returns current date pattern.
|
String |
getFormattedValue()
Returns the current value formatted with current locale or pattern.
|
SuperDatePickerI18n |
getSuperDatePickerI18n()
Returns the current instance of the
SuperDatePickerI18n associated with this object. |
String |
getTooltipText() |
boolean |
isReceivingSelectionEventsFromClient()
Check if client will inform server on selection change.
|
protected void |
onAttach(com.vaadin.flow.component.AttachEvent attachEvent) |
protected void |
onDetach(com.vaadin.flow.component.DetachEvent detachEvent) |
void |
select(int from,
int to)
Selects text starting from index
from (inclusive) and ending at index to (exclusive). |
void |
selectAll()
Selects entire text in the component.
|
void |
selectNone()
Removes the current selection and selects no text.
|
void |
setDatePattern(DatePattern datePattern)
Sets new date pattern to use when displaying and parsing dates.
|
void |
setI18n(com.vaadin.flow.component.datepicker.DatePicker.DatePickerI18n i18n) |
void |
setLabelPosition(LabelPosition position)
Sets the label position to a new one.
|
void |
setLocale(Locale locale)
Sets new locale for this object.
|
void |
setReceivingSelectionEventsFromClient(boolean receivingSelectionEventsFromClient)
Configures sending events by the client-side component.
|
void |
setTooltipText(String title) |
addInvalidChangeListener, addOpenedChangeListener, addValidationStatusChangeListener, close, getDefaultValidator, getErrorMessage, getI18n, getInitialPosition, getLabel, getLocale, getMax, getMin, getName, getPlaceholder, isAutoOpen, isClearButtonVisible, isEnforcedFieldValidationEnabled, isInvalid, isOpened, isRequired, isWeekNumbersVisible, open, setAutoOpen, setClearButtonVisible, setErrorMessage, setInitialPosition, setInvalid, setLabel, setMax, setMin, setName, setOpened, setPlaceholder, setRequired, setRequiredIndicatorVisible, setValue, setWeekNumbersVisible, validateaddChangeListener, addToPrefix, checkValidity, getErrorMessageString, getI18nJsonObject, getInitialPositionString, getLabelString, getMaxAsStringString, getMinAsStringString, getNameString, getPlaceholderString, isAutofocusBoolean, isClearButtonVisibleBoolean, isDisabledBoolean, isInvalidBoolean, isOpenedBoolean, isReadonlyBoolean, isRequiredBoolean, isShowWeekNumbersBoolean, remove, removeAll, setAutofocus, setDisabled, setI18n, setInitialPosition, setMaxAsString, setMinAsString, setReadonly, setShowWeekNumbers, validategetSynchronizationRegistration, hasValidValue, setPresentationValue, setSynchronizedEventaddValueChangeListener, getEmptyValue, getValue, isEmpty, setModelValue, valueEqualsaddListener, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onEnabledStateChanged, set, setElement, setId, setVisibleclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitwithoutReceivingSelectionEventsFromClient, withReceivingSelectionEventsFromClient, withReceivingSelectionEventsFromClientwithLabelPositiongetLabelPositionwithLocalewithLabelwithPlaceholdergetPlaceholder, setPlaceholderwithDatePatternwithValueaddValueChangeListener, clear, getEmptyValue, getOptionalValue, getValue, isEmpty, isReadOnly, isRequiredIndicatorVisible, setReadOnly, setRequiredIndicatorVisible, setValuewithIdwithHelperComponent, withHelperTextgetHelperComponent, getHelperText, setHelperComponent, setHelperTextwithHelperAbove, withHelperAbove, withHelperBelowisHelperAbove, setHelperAbove, setHelperAbove, setHelperBelowwithoutRequired, withRequired, withRequiredisRequired, setRequiredwithTooltipTextgetCssSize, getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFulladdClientValidatedEventListeneraddClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameaddFocusShortcut, blur, focus, getTabIndex, setTabIndexpublic SuperDatePicker()
public SuperDatePicker(Locale locale)
public SuperDatePicker(LocalDate initialDate)
public SuperDatePicker(String label)
public SuperDatePicker(com.vaadin.flow.component.HasValue.ValueChangeListener<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.datepicker.DatePicker,LocalDate>> listener)
public SuperDatePicker(String label, com.vaadin.flow.component.HasValue.ValueChangeListener<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.datepicker.DatePicker,LocalDate>> listener)
public SuperDatePicker(LocalDate initialDate, com.vaadin.flow.component.HasValue.ValueChangeListener<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.datepicker.DatePicker,LocalDate>> listener)
public SuperDatePicker(String label, LocalDate initialDate, com.vaadin.flow.component.HasValue.ValueChangeListener<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.datepicker.DatePicker,LocalDate>> listener)
public final void setLocale(Locale locale)
HasLocalepublic void setDatePattern(DatePattern datePattern)
HasDatePatternsetDatePattern in interface HasDatePatterndatePattern - A pattern to use. Can be null, which will reset the pattern to whatever is supported by default.public DatePattern getDatePattern()
HasDatePatterngetDatePattern in interface HasDatePatternDatePattern. May be null.protected void onAttach(com.vaadin.flow.component.AttachEvent attachEvent)
onAttach in class com.vaadin.flow.component.datepicker.DatePickerprotected void onDetach(com.vaadin.flow.component.DetachEvent detachEvent)
onDetach in class com.vaadin.flow.component.Componentpublic boolean isReceivingSelectionEventsFromClient()
CanReceiveSelectionEventsFromClientisReceivingSelectionEventsFromClient in interface CanReceiveSelectionEventsFromClienttrue, each selection change in the client-side component will result in this component broadcasting a TextSelectionEvent.public void setReceivingSelectionEventsFromClient(boolean receivingSelectionEventsFromClient)
CanReceiveSelectionEventsFromClientsetReceivingSelectionEventsFromClient in interface CanReceiveSelectionEventsFromClientreceivingSelectionEventsFromClient - When false, selecting text in client-side component will not send an event to server-side component. When true, it will.public String getFormattedValue()
null if the current date is null.public void selectAll()
CanSelectTextselectAll in interface CanSelectTextpublic void selectNone()
CanSelectTextselectNone in interface CanSelectTextpublic void select(int from,
int to)
CanSelectTextfrom (inclusive) and ending at index to (exclusive).select in interface CanSelectTextfrom - Starting index (inclusive).to - Ending index (exclusive).public com.vaadin.flow.shared.Registration addTextSelectionListener(TextSelectionListener<SuperDatePicker> listener)
TextSelectionNotifieraddTextSelectionListener in interface TextSelectionNotifier<SuperDatePicker>listener - A listener to add.Registration that can be used to stop listening to the event.public SuperDatePickerI18n getSuperDatePickerI18n()
SuperDatePickerI18n associated with this object.null instance.public void setI18n(com.vaadin.flow.component.datepicker.DatePicker.DatePickerI18n i18n)
setI18n in class com.vaadin.flow.component.datepicker.DatePickerpublic void setTooltipText(String title)
setTooltipText in interface HasTooltippublic String getTooltipText()
getTooltipText in interface HasTooltippublic void setLabelPosition(LabelPosition position)
HasLabelPositionablesetLabelPosition in interface HasLabelPositionableposition - A position to use. Setting null will reset it to the default setting.Copyright © 2023 Miki. All rights reserved.