Class SJFormattedDatePicker
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.BlurNotifier<com.vaadin.flow.component.datepicker.DatePicker>, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.Focusable<com.vaadin.flow.component.datepicker.DatePicker>, com.vaadin.flow.component.FocusNotifier<com.vaadin.flow.component.datepicker.DatePicker>, com.vaadin.flow.component.HasAriaDescription, com.vaadin.flow.component.HasAriaLabel, 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.HasSize, com.vaadin.flow.component.HasStyle, com.vaadin.flow.component.HasTheme, com.vaadin.flow.component.HasValidation, com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.datepicker.DatePicker, LocalDate>, LocalDate>, com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.datepicker.DatePicker, LocalDate>, LocalDate>, com.vaadin.flow.component.shared.HasAllowedCharPattern, com.vaadin.flow.component.shared.HasAutoOpen, com.vaadin.flow.component.shared.HasClearButton, com.vaadin.flow.component.shared.HasPrefix, com.vaadin.flow.component.shared.HasThemeVariant<com.vaadin.flow.component.datepicker.DatePickerVariant>, com.vaadin.flow.component.shared.HasTooltip, com.vaadin.flow.component.shared.HasValidationProperties, com.vaadin.flow.component.shared.InputField<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.datepicker.DatePicker, LocalDate>, LocalDate>, com.vaadin.flow.data.binder.HasValidator<LocalDate>, ComponentMixin, ContainerMixin, EnterClaims.Claimant, JComponentMixin, Serializable
JFormattedTextField when the emulator's
formatter selects SJFormattedDatePicker's peer
family per [SD_sjformatted_family](../../../../../decisions.md#SD_sjformatted_family). Extends Vaadin
DatePicker directly (is-a) so the rendered UI is the native
Vaadin date picker — calendar popup + locale-driven typed-input parsing
— rather than a plain text field with format validation.
R_swing_is_truth sync model — value source-of-truth is the peer
Per [SD_formatted_native_value](../../../../../decisions.md#SD_formatted_native_value) the surrogate's source
of truth for the value is the peer's native getter
(DatePicker.getValue() : LocalDate) — no shadow Object
field. AbstractField.getValue() returns BrowserDateUtils.toDate(super.getValue())
(Date for JDK round-trip); DatePicker.setValue(Object) accepts a JDK
Date (or LocalDate pass-through, or null),
coerces, and writes through to the peer.
PropertyChangeEvent("value", oldDate, newDate)
fires on every value change — both programmatic
(setValue(Date)) and peer-originated (browser date pick). Wired
via DatePicker's HasValue.ValueChangeEvent
subscription, funneled through SHelper.callSwing(Runnable) per R_callswing_envelope. The PCE
carries Date values on both ends; the LocalDate→Date conversion runs
inside the Vaadin listener so PropertyChangeListeners see JDK types.
ActionListener fan-out on Enter + value commit
JDK JFormattedTextField inherits ActionListener-on-Enter from
JTextField — for the SJFormattedDatePicker peer the natural
"commit" signals are (a) Enter on the input subfield and (b) browser
date pick (value-change). Both fire ActionEvent with
source = this and actionCommand = "" (no defined
action command for date input; pure-surrogate users can override
with setActionCommand(String) if migrated logic needs one).
R_vaadin_first drop-and-WARN surface
setColumns(int)/getColumns()— DatePicker has its own width sizing; setColumns has no peer concept. Field-shadow round-trip with WARN on non-zero set per [SD_formatted_no_base_class](../../../../../decisions.md#SD_formatted_no_base_class) (JTextField surface duplicated, drop-and-WARN where Vaadin lacks the concept).setHorizontalAlignment(int)— same as SJTextField's stance (Vaadin DatePicker shadow DOM doesn't expose host text-align). R_match_swing_errors IAE on bad axis preserved; non-LEADING values WARN.- L&F getUI / setUI — WARN-and-noop per the surrogate-wide stance (Vaadin owns the DOM).
focusLostBehavior + the COMMIT / REVERT
constants live inline rather than in a shared SJFormattedFieldMixin:
the surface is too small across the formatted-field family to warrant the
abstraction (R_infra_not_surface, [SD_sjformattedfieldmixin](../../../../../decisions.md#SD_sjformattedfieldmixin)).
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.vaadin.flow.component.datepicker.DatePicker
com.vaadin.flow.component.datepicker.DatePicker.DatePickerI18n, com.vaadin.flow.component.datepicker.DatePicker.InvalidChangeEvent, com.vaadin.flow.component.datepicker.DatePicker.OpenedChangeEventNested classes/interfaces inherited from class com.vaadin.flow.component.AbstractField
com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<C,V> Nested classes/interfaces inherited from interface com.vaadin.flow.component.BlurNotifier
com.vaadin.flow.component.BlurNotifier.BlurEvent<C>Nested classes/interfaces inherited from interface com.vaadin.flow.component.FocusNotifier
com.vaadin.flow.component.FocusNotifier.FocusEvent<C>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>Nested classes/interfaces inherited from interface JComponentMixin
JComponentMixin.ActionStandin -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intMirrorsJFormattedTextField.COMMIT.static final intstatic final intstatic final intFields inherited from interface JComponentMixin
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanTheSJFormattedTextField.claimsEnter()rule: Enter commits an edit and only an unedited field lets it through.protected voidFire ActionEvent with source = this. actionCommand defaults to "" (no natural text representation for a date — formatter-driven stringification lives emulator-side).intR_vaadin_first + Vaadin generics: the inheritedsuper.getValue()returnsLocalDate; anObject getValue()override would erasure-clash withHasValue<C, V>.getValue().intintDeliberate no-op — L&F key.voidvoidsetActionCommand(String command) voidsetColumns(int columns) Field-shadow round-trip only — DatePicker has no columns concept.voidsetDateValue(Date value) Date-typed setter that funnels through the peer's LocalDate setter withpreventPeerEventsguard so the value-change bridge doesn't double-firePropertyChangeEvent("value", ...).voidsetFocusLostBehavior(int behavior) Round-trip storage for the JDKfocusLostBehaviorint.voidsetHorizontalAlignment(int alignment) voidvalidate()Visibility-widening override ofDatePicker.validate()to satisfyComponentMixin's publicvalidate()contract.Methods inherited from class com.vaadin.flow.component.datepicker.DatePicker
addInvalidChangeListener, addOpenedChangeListener, addValidationStatusChangeListener, bindInitialPosition, bindMax, bindMin, close, getAriaDescribedBy, getAriaLabel, getAriaLabelledBy, getDateMetadataProvider, getDefaultValidator, getDisabledDates, getDisabledWeekdays, getFallbackParser, getI18n, getInitialPosition, getLabel, getLocale, getMax, getMin, getName, isDateDisabled, isInputUnparsable, isInputValuePresent, isOpened, isRequired, isRequiredIndicatorVisible, isWeekNumbersVisible, onAttach, open, refreshDateMetadata, setAriaDescribedBy, setAriaLabel, setAriaLabelledBy, setDateMetadataProvider, setDisabledDates, setDisabledWeekdays, setErrorMessage, setFallbackParser, setI18n, setInitialPosition, setLabel, setLocale, setManualValidation, setMax, setMin, setModelValue, setName, setOpened, setRequired, setRequiredIndicatorVisible, setValue, setWeekNumbersVisibleMethods inherited from class com.vaadin.flow.component.AbstractSinglePropertyField
getSynchronizationRegistration, hasValidValue, setPresentationValue, setSynchronizedEventMethods inherited from class com.vaadin.flow.component.AbstractField
addValueChangeListener, bindValue, getEmptyValue, getValue, isEmpty, valueEqualsMethods inherited from class com.vaadin.flow.component.Component
addListener, bindVisible, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getParent, getTestId, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setTestId, setVisible, whenAttachedMethods inherited from class 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 ComponentMixin
_installSwingClass, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, dispatchEvent, doLayout, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getComponentListeners, getCursor, getFocusListeners, getFont, getForeground, getGraphics, getHierarchyBoundsListeners, getHierarchyListeners, getKeyListeners, getLocation, getMaximumSize, getMinimumSize, getMouseListeners, getName, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolTipText, getX, getY, grabFocus, hasFocus, invalidate, isDisplayable, isFocusable, isFocusOwner, isShowing, paint, paintAll, print, printAll, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, revalidate, setBackground, setBounds, setBounds, setCursor, setFocusable, setFont, setForeground, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, transferFocus, transferFocusBackward, transferFocusUpCycle, updateMethods inherited from interface ContainerMixin
addContainerListener, getContainerListeners, getLayout, paintComponents, printComponents, removeContainerListener, setLayoutMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.Focusable
addFocusShortcut, blur, focus, focus, getTabIndex, setTabIndexMethods inherited from interface com.vaadin.flow.component.FocusNotifier
addFocusListenerMethods inherited from interface com.vaadin.flow.component.shared.HasAllowedCharPattern
getAllowedCharPattern, setAllowedCharPatternMethods inherited from interface com.vaadin.flow.component.HasAriaDescription
setAriaDescribedByMethods inherited from interface com.vaadin.flow.component.HasAriaLabel
setAriaLabelledByMethods inherited from interface com.vaadin.flow.component.shared.HasAutoOpen
isAutoOpen, setAutoOpenMethods inherited from interface com.vaadin.flow.component.shared.HasClearButton
bindClearButtonVisible, isClearButtonVisible, setClearButtonVisibleMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
bindEnabled, isEnabledMethods inherited from interface com.vaadin.flow.component.HasHelper
bindHelperText, getHelperComponent, getHelperText, setHelperComponent, setHelperTextMethods inherited from interface com.vaadin.flow.component.HasPlaceholder
bindPlaceholder, getPlaceholder, setPlaceholderMethods inherited from interface com.vaadin.flow.component.shared.HasPrefix
getPrefixComponent, setPrefixComponentMethods inherited from interface com.vaadin.flow.component.HasSize
bindHeight, bindWidth, 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, bindClassName, bindClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameMethods inherited from interface com.vaadin.flow.component.HasTheme
addThemeName, addThemeNames, bindThemeName, bindThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeNameMethods inherited from interface com.vaadin.flow.component.shared.HasThemeVariant
addThemeVariants, bindThemeVariant, bindThemeVariants, removeThemeVariants, setThemeVariant, setThemeVariants, setThemeVariantsMethods inherited from interface com.vaadin.flow.component.shared.HasTooltip
getTooltip, setTooltipMarkdown, setTooltipTextMethods inherited from interface com.vaadin.flow.component.shared.HasValidationProperties
getErrorMessage, isInvalid, setInvalidMethods inherited from interface com.vaadin.flow.component.HasValue
addValueChangeListener, bindValue, clear, getEmptyValue, getOptionalValue, getValue, isEmptyMethods inherited from interface com.vaadin.flow.component.HasValueAndElement
bindReadOnly, bindRequiredIndicatorVisible, isReadOnly, setReadOnlyMethods inherited from interface JComponentMixin
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getLocation, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, isDoubleBuffered, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintImmediately, paintImmediately, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, requestDefaultFocus, resetKeyboardActions, reshape, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setInheritsPopupMenu, setInputMap, setInputVerifier, setNextFocusableComponent, setOpaque, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, updateUI
-
Field Details
-
COMMIT
-
COMMIT_OR_REVERT
public static final int COMMIT_OR_REVERT- See Also:
-
REVERT
public static final int REVERT- See Also:
-
PERSIST
public static final int PERSIST- See Also:
-
-
Constructor Details
-
SJFormattedDatePicker
public SJFormattedDatePicker() -
SJFormattedDatePicker
-
-
Method Details
-
validate
public void validate()Visibility-widening override ofDatePicker.validate()to satisfyComponentMixin's publicvalidate()contract. Vaadin DatePicker declares the inheritedvalidate()asprotected(input validation, not Swing's layout cycle). Same shape SJTextField takes per SD_sjtextfield.- Specified by:
validatein interfaceComponentMixin- Overrides:
validatein classcom.vaadin.flow.component.datepicker.DatePicker
-
getDateValue
R_vaadin_first + Vaadin generics: the inheritedsuper.getValue()returnsLocalDate; anObject getValue()override would erasure-clash withHasValue<C, V>.getValue(). Pure-surrogate users readsuper.getValue()directly; emulator code uses these convenience accessors plusBrowserDateUtils.toLocalDate(Date)/BrowserDateUtils.toDate(LocalDate)for Date↔LocalDate coercion at the boundary per [SD_formatted_native_value](../../../../../decisions.md#SD_formatted_native_value) (peer's native type is the source of truth). -
setDateValue
Date-typed setter that funnels through the peer's LocalDate setter withpreventPeerEventsguard so the value-change bridge doesn't double-firePropertyChangeEvent("value", ...). The PCE fires here once with both old and new as JDKDateso PropertyChangeListeners see consistent JDK types regardless of the write origin. -
getFocusLostBehavior
public int getFocusLostBehavior() -
setFocusLostBehavior
public void setFocusLostBehavior(int behavior) Round-trip storage for the JDKfocusLostBehaviorint. The actual focus-lost commit logic lives on the emulator-side strategy (D_jformattedtextfield) — the surrogate stores the int sogetFocusLostBehaviorround-trips and emulator code can read it back. -
addActionListener
-
removeActionListener
-
getActionListeners
-
fireActionPerformed
protected void fireActionPerformed()Fire ActionEvent with source = this. actionCommand defaults to "" (no natural text representation for a date — formatter-driven stringification lives emulator-side). -
setActionCommand
-
getColumns
public int getColumns() -
setColumns
public void setColumns(int columns) Field-shadow round-trip only — DatePicker has no columns concept. Per [SD_formatted_no_base_class](../../../../../decisions.md#SD_formatted_no_base_class), the JTextField surface is duplicated per surrogate and drops where Vaadin lacks the concept. Negative throws IAE per R_match_swing_errors. -
getHorizontalAlignment
public int getHorizontalAlignment() -
setHorizontalAlignment
public void setHorizontalAlignment(int alignment) -
getUIClassID
Description copied from interface:JComponentMixinDeliberate no-op — L&F key.- Specified by:
getUIClassIDin interfaceJComponentMixin
-
getAccessibleContext
-
claimsEnter
public boolean claimsEnter()TheSJFormattedTextField.claimsEnter()rule: Enter commits an edit and only an unedited field lets it through.- Specified by:
claimsEnterin interfaceEnterClaims.Claimant
-