KeyBindings
KeyBindings is a helper class for FXBean Adapter. It provides Bindings from beans to ui representations.
It contains convenience functions for adding keys to FXBean Adapter and for conversion.
Code Sample
FXML Snippet
<Label id="person"/>
<TextField id="name"/>
<TextField fx:id="age"/>
Scala ViewController Snippet
val bindings = KeyBindings("id", "name", "age", "test")
// Expression Binding Example
bindings.add("person", "${sf:i18n('personText', _self.name(), _self.age())}")
adapter.addBindings(bindings)
Create Bindings
Bindings are created by the value of the id or fx:id attributes in the fxml file.
Note
If node lookup from appication root node does not work, you can fix it by adding a parent Node to FXBeanAdapter.
@FXML
var personBox: VBox = _
Add Converter
adapter.addIntConverter("age")
2.0.1*