SwingNodeUpdater
The receiver of the update block passed to SwingNode: the typed Swing component T is this inside set, update, init and reconcile.
Use set/update for reactive property updates, init for one-time setup after creation, and reconcile for unconditional reconciliation. Listeners are installed through the modifier mechanism - see org.jetbrains.compose.swing.modifier.listener.
Functions
Applies mirror to this node, so the mirror belongs to it - which is what lets MirrorState.report answer a change inside the event that made it rather than from an event of its own.
Declares value onto a widget property whose write is a transition rather than an assignment: write is handed what the widget holds alongside what is declared, so it can write only the part that differs and leave what the rest of the value anchors standing - the caret inside a document, above all. The held value is the one the settlement has already read, so the write costs no second read.
Publishes context on the component, so that a setContent call on a component below it joins this composition - sharing its scope and its CompositionLocals. Without it such a call joins whatever its place in the Swing tree resolves to - the content composition above it, or the one its window shares - so it recomposes with everything else there but sees none of the CompositionLocals this node stands under. A null context leaves the component hosting nothing.
Runs block, with the typed component as this, exactly once: on the pass that creates the node, after the set/update blocks declared above it in the same update lambda have run against the freshly built component. Use it for setup that must happen once at creation but needs a value set/update computed - a value the factory cannot see - and that reconcile would otherwise redo on every composition.