SwingCompositionDiagnostics

The debug-only checks the compositions on one recomposer are held to, installed as an element of the coroutine context that recomposer was built over.

A composition reads it as it is mounted, and one nested under it reads the same element through its parent's effect context - a cell renderer's composition, a menu's, a window's. Nothing installs one in production.

Every call runs on the event dispatch thread, from inside the change pass that provoked it. A violation is reported rather than thrown: a throw from inside a modifier write reaches the apply phase and ends the recomposer for good.

Marked InternalSwingUiApi; it may change or be removed without notice in any release.

Types

Link copied to clipboard

The key this element is read off a coroutine context by.

Properties

Link copied to clipboard
open override val key: CoroutineContext.Key<*>

Functions

Link copied to clipboard
abstract fun declaring(component: Component, node: SwingModifier.Node<*>, element: SwingModifier.NodeElement<*, *>, write: () -> Unit)

Runs write - what one element writes onto component for the slot node holds, whether that is the slot's first write or a later one.

Link copied to clipboard
open override fun <R> fold(initial: R, operation: (R, CoroutineContext.Element) -> R): R
Link copied to clipboard
open operator override fun <E : CoroutineContext.Element> get(key: CoroutineContext.Key<E>): E?
Link copied to clipboard
open override fun minusKey(key: CoroutineContext.Key<*>): CoroutineContext
Link copied to clipboard
open operator fun plus(context: CoroutineContext): CoroutineContext
Link copied to clipboard
abstract fun restoring(component: Component, node: SwingModifier.Node<*>, restore: () -> Unit)

Runs restore - the departing slot node holds putting component back where the modifier found it.