carlw
02/24/2017, 6:26 PMcarlw
02/24/2017, 6:27 PMedvin
02/24/2017, 6:28 PMedvin
02/24/2017, 6:28 PMcarlw
02/24/2017, 6:29 PMron
02/24/2017, 7:27 PMron
02/24/2017, 7:31 PMedvin
02/24/2017, 8:02 PMcarlw
02/24/2017, 8:03 PMron
02/24/2017, 8:04 PMron
02/24/2017, 8:20 PMcarlw
02/24/2017, 8:21 PMcarlw
02/24/2017, 8:22 PMcarlw
02/24/2017, 8:23 PMvortex.JPG▾
groostav
02/24/2017, 9:06 PM<VBox>
<CheckBox>
<VBox.margin>
<Insets bottom=1.0 top=1.0 left=1.0 right=1.0/>
</VBox.margin>
</CheckBox>
<VBox>
because of the very happy coincidence that static extension properties match the beans naming convention, this means that with a relatively simple extension function:
object VBoxExtensions {
object margin {
@JvmStatic var FXNode.uniform: Double
get() = TODO()
set(value) = TODO()
}
}
we can then write, in FXML:
<VBox>
<CheckBox VBoxExtensions.margin.uniform="1.0"/>
<VBox>
So I've done this for a couple things and put the results here:
https://gist.github.com/Groostav/78a3ec36bd9b2af49cdc3f6a015ed87c
Does anybody care to show me how I might go about using properties to remove even more of the boiler-plate?groostav
02/24/2017, 9:06 PM@JvmStatic var FXNode.uniform: Double; get() = ...; set() = ...
with a ...uniform: Double by delegateOfSomeKind(things)
, im just not sure howgroostav
02/24/2017, 9:17 PMgroostav
02/24/2017, 9:19 PMron
02/24/2017, 9:31 PMron
02/24/2017, 9:31 PMron
02/24/2017, 9:31 PMron
02/24/2017, 9:32 PMedvin
02/25/2017, 9:59 AMron
02/25/2017, 10:26 AMcarlw
02/25/2017, 12:19 PMgtnarg
02/25/2017, 1:51 PMedvin
02/25/2017, 2:59 PMedvin
02/25/2017, 2:59 PMedvin
02/25/2017, 3:01 PM