Class ButtonStateStore

java.lang.Object
com.vaadin.swingbridge.surrogates.internal.ButtonStateStore

public final class ButtonStateStore extends Object
State holder for AbstractButtonMixin.

Scoped per R_vaadin_first: UI-functional state or state the store-less path genuinely can't reconstruct lives here. Setters for the rest — six state-conditional icons, border-painted / content-area-filled / focus-painted / rollover-enabled, margin, displayedMnemonicIndex, multiClickThreshhold — route through SHelper.onUnimplemented and drop the value; their getters return the JDK default.

Layout fields are not stored here. The four alignment / text-position setters and iconTextGap write CSS inline on the host (Vaadin Button is already display: inline-flex per Lumo) and the matching getters lossy-parse CSS back — same shape as setBorder / getBorder per SD_border_css_lossy. R_vaadin_first explicitly accepts the LEADING ↔ LEFT and "vertical-text-position-non-CENTER masks horizontal-text-position" lossy round-trips; storing them just to dodge the loss would be the "shadow cache so the setter round-trips through its own getter" R_vaadin_first forbids.

text is not stored: setText/getText were lifted to abstract on AbstractButtonMixin, so each concrete surrogate routes through its parent Vaadin component's HasText (e.g. SJButton's inherited Button.getText() reads textNode). The R_vaadin_first lossy setText(null) → getText() == "" round-trip is the contract on the surrogate side; the emulator layer preserves null on its own field shadow per R_swing_is_truth.

  • Field Details

    • actionCommand

      public String actionCommand
      No Vaadin analog; drives ActionEvent payload.
    • hideActionText

      public boolean hideActionText
      No Vaadin analog; affects setAction NAME propagation.
    • mnemonic

      public int mnemonic
      Shortcuts is write-only; VK round-trip + install state.
    • mnemonicRegistration

      public com.vaadin.flow.shared.Registration mnemonicRegistration
      Handle to tear down the previous Shortcuts install.
    • action

      public Action action
      Currently installed Action; null when none.
    • actionPropertyChangeListener

      public PropertyChangeListener actionPropertyChangeListener
      Listener on action that routes per-property mutations back to the button.
    • model

      public ButtonModel model
      Source of truth for armed/pressed/selected/enabled — drives all three fire-families.
    • modelInstall

      public com.vaadin.flow.shared.Registration modelInstall
      Single teardown handle for the three bridge listeners (ChangeListener / ActionListener / ItemListener) the mixin installs on model to re-fire model events at the button level. remove() detaches all three. Bridge listeners are internal glue, not user-supplied API — see class javadoc for why this isn't in Registrations.
    • listenerList

      public final EventListenerList listenerList
      Type-keyed listener lists for ActionListener / ChangeListener / ItemListener fan-out.
  • Method Details

    • of

      public static ButtonStateStore of(com.vaadin.flow.component.Component target)