Package net.eksb.kswingutil.ext
Class BindKt
-
- All Implemented Interfaces:
public final class BindKt
-
-
Method Summary
Modifier and Type Method Description final static <T extends Any> Unitbind(Component $self, Property<T> property, Function1<T, Unit> setter)One-way bind a java.awt.Component to a Property. final static <T extends Any> Unitbind(Component $self, MutableProperty<T> property, Function1<T, Unit> setter, Function1<Function1<T, Unit>, Unit> listenerRegister)Two-way bind a Component to a Property. -
-
Method Detail
-
bind
final static <T extends Any> Unit bind(Component $self, Property<T> property, Function1<T, Unit> setter)
One-way bind a java.awt.Component to a Property. This component's property is immediately set to the property's value. Then changes to the property are propagated to this component.
- Parameters:
property- Property to bind fromsetter- lambda to set this component's value.
-
bind
final static <T extends Any> Unit bind(Component $self, MutableProperty<T> property, Function1<T, Unit> setter, Function1<Function1<T, Unit>, Unit> listenerRegister)
Two-way bind a Component to a Property. This component's property is immediately set to the property's value (via setter). Then changes to either are propagated to the other.
- Parameters:
property- Property to bind tosetter- lambda to set this component valuelistenerRegister- lambda to register a NewValueListener with this component
-
-
-
-