ron
06/25/2018, 8:49 AMedvin
06/25/2018, 8:52 AMedvin
06/25/2018, 9:02 AMron
06/25/2018, 9:02 AMedvin
06/25/2018, 9:03 AMedvin
06/25/2018, 9:04 AMedvin
06/25/2018, 9:10 AMron
06/25/2018, 9:21 AMedvin
06/25/2018, 10:59 AMron
06/25/2018, 11:08 AMedvin
06/25/2018, 11:09 AMvpriscan
06/25/2018, 2:42 PMvpriscan
06/25/2018, 2:43 PMtieskedh
06/25/2018, 2:44 PMtieskedh
06/25/2018, 2:45 PMcarlw
06/25/2018, 2:45 PMtieskedh
06/25/2018, 2:47 PMorangy
orangy
orangy
map
one property to another? Say I have SimpleStringProperty
bound to textarea
, and I want to process it and bind the result to another control. E.g. simple word count application. How do I do it? I’m a bit lost with all the binding. I’m looking at samples, but they either use static content, or onChange
events. Can I write something like `textProperty().bind(textAreaProperty) { countWords(it).toString() }`or something like this? I think I understand the overall concept, but fail to find appropariate APIscarlw
06/25/2018, 4:46 PMcarlw
06/25/2018, 4:47 PMbkenn
06/25/2018, 5:01 PMnumWords.bind( Bindings.createIntegerBinding(Callable{ this.text.split(" ").size }, this.textProperty()) )
you can use numWords.bind(integerBinding(this.textProperty()) { text.split(" ").size })
which I find to be a bit more easier on the eyes.carlw
06/25/2018, 5:01 PMcarlw
06/25/2018, 5:01 PMGary Tierney
06/25/2018, 5:08 PMbkenn
06/25/2018, 5:17 PMRuckus
06/25/2018, 5:47 PMnumWords.bind(textProperty().integerBinding { it?.split(" ")?.size ?: 0 })
tieskedh
06/25/2018, 5:47 PMRuckus
06/25/2018, 5:48 PM