Class ListStateStore

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

public final class ListStateStore extends Object
State holder for SJList (SD_sjlist).

Holds only R_vaadin_first-legitimate state — UI-functionality source-of-truth (the two models) plus machinery (loop guard, the live Vaadin subscription, the click-dispatch stash). No shadow caches: JList's no-Vaadin-counterpart knobs (layout orientation, visibleRowCount, fixedCell sizes, selection chrome, dragEnabled) round-trip on the emulator layer per R_swing_is_truth, the asymmetric split SJToolBar (SD_sjtoolbar) / SJSplitPane (SD_sjsplitpane) established — the surrogate drops them. The JDK selection-mode int isn't stored either: it is reconstructed from selectionModel's getSelectionMode().

Source-of-truth fields per R_swing_is_truth:

Both are JDK types reused per D_event_port_policy — ListDataEvent / ListSelectionEvent are Object-sourced and touch no Component.
  • Field Details

    • model

      public ListModel<?> model
      Source of truth for the list's elements (R_swing_is_truth). Never null after ctor.
    • selectionModel

      public ListSelectionModel selectionModel
      Source of truth for index-based selection state. Never null after ctor.
    • preventPeerEvents

      public boolean preventPeerEvents
      R_swing_is_truth feedback-loop guard. Set during model→peer pushes (push-selection) and during peer→model write-throughs so the cascade doesn't double-fire. Same shape SJTable / SJComboBox take.
    • vaadinSelectionRegistration

      public com.vaadin.flow.shared.Registration vaadinSelectionRegistration
      Vaadin Grid SelectionListener registration that mirrors browser-side selection edits into the selectionModel. Re-installed on setSelectionMode since Vaadin re-creates the Grid's internal selection backing on mode swap.
    • clickIndexStash

      public int clickIndexStash
      Row index of the cell whose item-click is currently being dispatched, or -1 outside a dispatch. Set/cleared around the SMouseListener fan-out in SJList.addMouseListener's item-click wire so SJList.locationToIndex(Point) (and, by delegation, the emulator's) returns the clicked index during the user's mouseClicked handler. A field (not a thread-local): the emulator's re-source may drain the dispatch in a UI fiber, and shared state survives that boundary.
  • Method Details

    • of

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