NestedStyleProviderScope

The scope of a component that holds children, which may provide a nested style that a styleable descendant component reads and applies.

Inheritors

Properties

Link copied to clipboard
abstract val <T> CompositionLocal<T>.currentValue: T

An extension property that accesses the current value of this composition local in the context of this scope: where the styled component was declared, or for a nested style where its provider was declared. A change of a dynamic local runs the style again.

Functions

Link copied to clipboard

Sets the component's accessible description - a longer localized explanation assistive technologies can read after the name. null clears any description this style set.

Link copied to clipboard

Sets the component's accessible name - the short localized string assistive technologies announce for it. null clears any name this style set. Mirrors AndroidX's semantics { contentDescription = ... }.

Link copied to clipboard

Runs every style the ancestors provided for key, farthest first, against this scope. If no ancestor provides a style for key, calling this is equivalent to an empty style. A scope that is not a subtype of the key's scope does not compile. Applying the same key recursively is prohibited.

Link copied to clipboard
open override fun SwingStyleScope.applyStyle()

Applies this style to the receiving scope.

Link copied to clipboard

Sets background; on a non-opaque component also set opaque to true for it to paint.

Link copied to clipboard
fun ComponentStyleScope.bounds(x: Int, y: Int, width: Int, height: Int)

Sets the component's bounds - its position and size within its parent. Effective in a parent that does not lay its children out (a null layout, or a LayeredPane), where each child positions itself.

Link copied to clipboard

Sets componentOrientation - the component's left-to-right / right-to-left orientation.

Link copied to clipboard

Sets cursor; null restores the inherited cursor.

Link copied to clipboard

Sets isEnabled on this component only, controlling whether it responds to user input and paints in its enabled state. To disable descendants, use provideNestedStyle(AllComponents) { enabled(false) } on a container. The provided style does not disable the container itself, and a descendant's own enabled(true) overrides it.

Link copied to clipboard

Sets isFocusable, declaring whether this component can receive keyboard focus.

Link copied to clipboard

Sets font; null takes the font from the parent container.

Link copied to clipboard

Sets foreground; null takes the color from the parent container.

Link copied to clipboard

Sets the component's actual height to height, keeping its current width, like setSize(width, height). See size (the Int overload) for when this takes effect and how size/width/height compose.

Link copied to clipboard

Sets the component's actual location to point, like setLocation. See location (the Int overload) for how it takes effect only outside a managed layout and how location/x/y compose per axis.

Sets the component's actual location to (x, y) relative to its parent, like setLocation. A layout manager overrides this on its next layout pass, so it takes effect for components positioned by themselves - those in a null layout or a JLayeredPane.

Link copied to clipboard

Sets maximumSize and relays out; null restores the layout-computed maximum size.

fun ComponentStyleScope.maximumSize(width: Int, height: Int)

Sets maximumSize to Dimension(width, height) and relays out.

Link copied to clipboard

Sets minimumSize and relays out; null restores the layout-computed minimum size.

fun ComponentStyleScope.minimumSize(width: Int, height: Int)

Sets minimumSize to Dimension(width, height) and relays out.

Link copied to clipboard

Sets preferredSize and relays out; null restores the layout-computed preferred size.

Sets preferredSize to Dimension(width, height) and relays out.

Link copied to clipboard
abstract fun <V> SwingStyleProperty<V>.provide(value: V)

Sets value for this property. The last write wins.

Link copied to clipboard

Provides style to every descendant that applies key through applyNestedStyle, at any depth. It does not apply to this component. Several ancestors that provide one key all apply, farthest first, so the nearest wins per property.

Link copied to clipboard

Sets the component's actual size to size, like setSize. See size (the Int overload) for when this takes effect and how size/width/height compose.

fun ComponentStyleScope.size(width: Int, height: Int)

Sets the component's actual size to width by height, like setSize. A layout manager overrides this on its next layout pass, so it takes effect for components positioned by themselves - those in a null layout or a JLayeredPane. To influence a managed layout, use preferredSize, minimumSize, or maximumSize instead.

Link copied to clipboard

Sets isVisible - whether the component is shown in its parent's layout.

Link copied to clipboard

Sets the component's actual width to width, keeping its current height, like setSize(width, height). See size (the Int overload) for when this takes effect and how size/width/height compose.

Link copied to clipboard

Sets the component's actual x position to value, keeping its current y, like setLocation(x, y). See location (the Int overload) for how it takes effect only outside a managed layout and how location/x/y compose per axis.

Link copied to clipboard

Sets the component's actual y position to value, keeping its current x, like setLocation(x, y). See location (the Int overload) for how it takes effect only outside a managed layout and how location/x/y compose per axis.