invoke

inline operator fun <T : Component, V> invoke(name: String, noinline read: (component: T) -> V, noinline write: (component: T, value: V) -> Unit): ComponentPropertyDescriptor<T, V>

The property name of components of type T.

Declare it in a function of its own, not inline at a call site, the way SwingModifier.property's own documentation directs: a write written out once gives every widget declaring the property one slot, and a write that captures anything is a fresh instance each pass.

Parameters

name

the Swing property read and write reach.

read

answers with the value a component of type T holds.

write

puts a value onto a component of type T.


The property name that each of accessors declares for its own component type.

Applying the built property to a component none of accessors serves fails with a message naming the served types - whether that application is a direct declaration or an inherited default - the same way applying a single-type property outside its declared component type does; see SwingModifier.property.

Parameters

name

the property every case declares under its own accessors.

accessors

one accessor per component type the property serves, built with accessor.