Class TextStateStore
java.lang.Object
com.vaadin.swingbridge.surrogates.internal.TextStateStore
State holder for
JTextComponentMixin
(SD_sjtextfield). Same ComponentUtil.setData(Component, SerializableTriConsumer, T, U) pattern as
ButtonStateStore — keeps the mixin self-contained without
forcing every concrete consumer (SJTextField / future SJPasswordField /
SJTextArea) to expose abstract getters/setters as boilerplate.
What does NOT live here
editable— read directly frompeer.isReadOnly()per the R_vaadin_first Vaadin-first stance (SD_vaadin_first_binding). No shadow store needed.listenerListfor ActionListener — JTextField-specific, not shared with JTextArea. Lives on the concrete (SJTextField) per SD_sjpanel's "concrete-specific state stays on the concrete" call.columns/horizontalAlignment/rows/lineWrap— JDK declares these on JTextField and JTextArea individually, not on JTextComponent. Each concrete owns its own.
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe oneCaretview handed out for this component.final List<ChangeListener> final List<CaretListener> Caret listeners, and theChangeListeners aCarettakes — both fan out on every dot/mark move, server-initiated or read back from the browser.Single sharedDocumentListenerthat pushes Document mutations into the peer underpreventPeerEvents.The installedDocument.intSwing's two-value caret model —selectionStart = min(dot, mark),selectionEnd = max(dot, mark), anddot == markmeans a bare caret with nothing selected.intbooleanR_swing_is_truth feedback-loop guard — same shape SJSlider / SJSpinner / :emulators.JTextComponent use.booleanSet once the browser-side selection bridge has been wired, so a second install is a no-op.booleanSet once the client-side selection reporter has been installed on the input element. -
Method Summary
Modifier and TypeMethodDescriptionstatic TextStateStoreof(com.vaadin.flow.component.Component target)
-
Field Details
-
document
-
docToPeer
Single sharedDocumentListenerthat pushes Document mutations into the peer underpreventPeerEvents. Created lazily on first install; persists acrosssetDocumentswaps. Internal glue, not user-supplied API. -
preventPeerEvents
public boolean preventPeerEventsR_swing_is_truth feedback-loop guard — same shape SJSlider / SJSpinner / :emulators.JTextComponent use. Set true before peer writes; cleared infinally; checked at the top of both directional listeners. -
dot
public int dotSwing's two-value caret model —selectionStart = min(dot, mark),selectionEnd = max(dot, mark), anddot == markmeans a bare caret with nothing selected.Write-only mirror: the mixin pushes these to the browser and never reads them back, so a caret the *user* moved leaves them stale. Reads clamp to the Document length —
JTextComponentMixin.getCaretPosition()carries the contract. -
mark
public int mark -
caretListeners
Caret listeners, and theChangeListeners aCarettakes — both fan out on every dot/mark move, server-initiated or read back from the browser.Legitimate under R_vaadin_first (not a shadow cache) because a real Vaadin subscription stands behind them: the
emul-selectionDOM listener the mixin installs on the peer element. -
caretChangeListeners
-
selectionBridgeInstalled
public boolean selectionBridgeInstalledSet once the browser-side selection bridge has been wired, so a second install is a no-op. -
selectionReporterInstalled
public boolean selectionReporterInstalledSet once the client-side selection reporter has been installed on the input element. -
caret
-
-
Method Details
-
of
-