hastebrot
01/31/2016, 6:08 AMimport javafx.beans.property.Property
import kotlin.reflect.KProperty
class PropertyDelegate<T>(val javafxProperty: Property<T>) {
operator fun getValue(thisRef: Any?,
property: KProperty<*>): T {
return javafxProperty.value
}
operator fun setValue(thisRef: Any?,
property: KProperty<*>,
value: T) {
javafxProperty.value = value
}
}
fun <T> property(javafxProperty: Property<T>) = PropertyDelegate(javafxProperty)