styleLocalOf

fun <V> styleLocalOf(descriptor: ComponentPropertyDescriptor<*, V>, restores: RestorePolicy = RestorePolicy.EverythingWritten, rewriteOn: String? = null, alsoOverwrites: List<ComponentPropertyDescriptor<*, *>> = emptyList()): SwingStyleProperty<V>

Local style properties inherit their values down the component hierarchy. As stylePropertyOf, for a property a descendant inherits: a styled descendant that sets no value takes the value of the nearest styled ancestor that set one, where descriptor handles the descendant's class. An ancestor that sets null stops the inheritance; its descendants keep their own value. This holds for a nullable style local, since a non-null one such as componentOrientation cannot be set to null. Locals with the same descriptor name share one property; the last declaration wins for the component and its descendants.

Return

the style property that sets the inherited property through descriptor.

Parameters

descriptor

the descriptor of the inherited component property.

restores

the values restored once the style stops setting the property, as in SwingModifier.property.

rewriteOn

the rewrite option of SwingModifier.property; null by default.

alsoOverwrites

the other properties written by this declaration, as in SwingModifier.property.