OnDemandComposition
A composition of Swing content under parent, with no container of its own.
The content shares the parent's state and CompositionLocals and recomposes when state it reads changes. recompose also runs a pass synchronously, on demand.
The top-level component is in no container of this composition, so no layout reads its parent data and it belongs to no region of this composition. A pass that composes a second top-level component, or a top-level component that names a region or carries parent data, throws IllegalStateException after disposing this composition, the pass on construction included. A failure thrown by the placement of a placed composition does the same. Both leave the caller nothing to dispose. A top-level component that names a region whose parent kind the composition's root does not match is refused while the pass applies, and leaves this composition undisposed: the caller disposes it, and that disposal can throw too.
Created by the constructor without a host, the composition places the component nowhere: recompose returns it to its caller, the way a cell renderer returns the component a widget paints. A component leaving the composition is removed from whatever container it is in.
Must be constructed, recomposed, and disposed on the Event Dispatch Thread.
Constructors
Creates a composition that places nothing: recompose returns its top-level component.
Creates a composition whose top-level component placement places.
Functions
Runs update, then recomposes and applies this composition synchronously, so its Swing subtree is fully materialized before this returns. The write is recorded against this composition so the synchronous recompose sees the change; this takes no frame from a window recomposer.