Class ListStateStore
java.lang.Object
com.vaadin.swingbridge.surrogates.internal.ListStateStore
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:
model— installedListModel; the list's elements.selectionModel— installedListSelectionModel; index-based selection (the same vocabulary Vaadin Grid's Integer-keyed selection carries, so the bridge is direct).
ListDataEvent /
ListSelectionEvent are Object-sourced and touch no Component.-
Field Summary
FieldsModifier and TypeFieldDescriptionintRow index of the cell whose item-click is currently being dispatched, or-1outside a dispatch.ListModel<?> Source of truth for the list's elements (R_swing_is_truth).booleanR_swing_is_truth feedback-loop guard.booleanWhether an owner shiftsselectionModelacross the model's inserts and removals itself.Source of truth for index-based selection state.com.vaadin.flow.shared.RegistrationVaadin GridSelectionListenerregistration that mirrors browser-side selection edits into theselectionModel. -
Method Summary
Modifier and TypeMethodDescriptionstatic ListStateStoreof(com.vaadin.flow.component.Component target)
-
Field Details
-
model
Source of truth for the list's elements (R_swing_is_truth). Never null after ctor. -
selectionModel
Source of truth for index-based selection state. Never null after ctor. -
preventPeerEvents
public boolean preventPeerEventsR_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 vaadinSelectionRegistrationVaadin GridSelectionListenerregistration that mirrors browser-side selection edits into theselectionModel. Re-installed onsetSelectionModesince Vaadin re-creates the Grid's internal selection backing on mode swap. -
clickIndexStash
public int clickIndexStashRow index of the cell whose item-click is currently being dispatched, or-1outside a dispatch. Set/cleared around theSMouseListenerfan-out inSJList.addMouseListener's item-click wire soSJList.locationToIndex(Point)(and, by delegation, the emulator's) returns the clicked index during the user'smouseClickedhandler. 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. -
selectionAdjustedByOwner
public boolean selectionAdjustedByOwnerWhether an owner shiftsselectionModelacross the model's inserts and removals itself.
-
-
Method Details
-
of
-