Generate a Scala Trait from a Fxml file.
Gui.fxml:
<AnchorPane fx:id="anchorPane1">
<children>
<Label text="Huhu"/>
</children>
</AnchorPane>
Gui.scala:
trait Gui {
val anchorPane1 = new AnchorPane() {
children = List(
label_2
)
}
val labe_2 = new Label() {
text = "Huhu"
}
}
Example at: https://github.com/Nuriaion/ScalaFxml-example
This is a very early prototype witch probably only works with the fxml file of the exmaple!
- use reflection on scalafx/javafx insted of pattern matching
- parse immport statements of fxml file
- how should the code for a button look? (onAction?)
- ...