edvin
05/23/2017, 12:05 PMalexp11223
05/23/2017, 2:13 PMTaskStatus
(for runAsync
, several simultaneous tasks)? Can I just val status = TaskStatus()
? Or I need to use scopes?edvin
05/23/2017, 2:26 PMcarlw
05/23/2017, 2:40 PMedvin
05/23/2017, 2:52 PMedvin
05/23/2017, 2:52 PMcarlw
05/23/2017, 2:59 PMedvin
05/23/2017, 5:36 PMalexp11223
05/23/2017, 6:10 PMval programCodeProperty = SimpleStringProperty()
var programCode by programCodeProperty
and control with ObservableValue<String> textProperty()
is it possible to bind to it? (2-way)
I saw that there is stringBinding
extension function, but I am not sure how to use itcarlw
05/23/2017, 6:17 PMedvin
05/23/2017, 6:17 PMalexp11223
05/23/2017, 6:17 PMedvin
05/23/2017, 6:19 PMObservableValue<String>
? That's not writable.alexp11223
05/23/2017, 6:20 PMreplaceText
function that is used in all examples to fill the controledvin
05/23/2017, 6:21 PMalexp11223
05/23/2017, 6:21 PMedvin
05/23/2017, 6:23 PMedvin
05/23/2017, 6:24 PMprogramCodeProperty.onChange { richText.replaceText(it) }
and richText.textProperty().onChange { programCode = it}
edvin
05/23/2017, 6:24 PMalexp11223
05/23/2017, 6:35 PMreplaceText
every time (when typing a letter, etc.) which is probably not ideal because it causes recomputation of things like syntax highlighting.
This is probably better:
viewModel.programCodeProperty.onChange {
if (it != inputArea.text) {
inputArea.replaceText(it)
}
}
edvin
05/23/2017, 6:37 PMcarlw
05/23/2017, 6:38 PMedvin
05/23/2017, 6:38 PMcarlw
05/23/2017, 6:39 PMalexp11223
05/23/2017, 6:39 PMprogramCode
but also to be able to replace text like this: programCode = newCode
alexp11223
05/23/2017, 7:07 PMval fooProperty = SimpleStringProperty()
var foo by fooProperty
without explicitly specifying foo
type:
val fooProperty = SimpleStringProperty()
var foo: String by fooProperty
edvin
05/23/2017, 7:11 PMedvin
05/23/2017, 7:29 PMaction
functions which aren't passed the ActionEvent
, so that you can bind it to function references.edvin
05/23/2017, 7:29 PMbutton("Save").action { person.save() }
you should be able to write button("Save").action(person::save)
.edvin
05/23/2017, 7:31 PM