Custom UI elements are now initialised in FXML

parent 096700b2
Pipeline #7139 passed with stages
in 6 minutes and 15 seconds
......@@ -196,9 +196,6 @@ internal class MainPane(private val stage: Window) : AnchorPane() {
@FXML
private lateinit var fileTree: TreeView<FileWrapper>
@FXML
private lateinit var codeTextArea: TextArea
/**
* The text area used to display any console output.
*
......@@ -232,7 +229,8 @@ internal class MainPane(private val stage: Window) : AnchorPane() {
* @author Konstantin Kopper
* @since 2.0.0
*/
private val codeArea = PseuCoArea()
@FXML
private lateinit var codeArea: PseuCoArea
/**
* The console wrapping the [consoleTextArea].
......@@ -267,25 +265,6 @@ internal class MainPane(private val stage: Window) : AnchorPane() {
* @since 2.0.0
*/
fun initialize() {
// Add CodeArea
this.codeAnchor.children.apply {
clear()
this += this@MainPane.codeArea
}
this.codeArea.also {
AnchorPane.setTopAnchor(it, .0)
AnchorPane.setRightAnchor(it, .0)
AnchorPane.setBottomAnchor(it, .0)
AnchorPane.setLeftAnchor(it, .0)
}
// Manage code area settings
this.codeArea.apply {
id = "codeArea"
isDisable = true
}
// Set icons for buttons
this.newButton.apply {
text = FontAwesome.FA_FILE_O
......
......@@ -14,6 +14,8 @@
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.text.TextFlow?>
<?import fxGui.main.PseuCoArea?>
<fx:root fx:id="rootPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="400.0" minWidth="600.0" prefHeight="600.0" prefWidth="900.0" type="javafx.scene.layout.AnchorPane" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
<children>
<VBox AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
......@@ -57,7 +59,7 @@
<items>
<AnchorPane fx:id="codeAnchor" minHeight="0.0" minWidth="0.0">
<children>
<TextArea fx:id="codeTextArea" promptText="Enter pseuCo code here." AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
<PseuCoArea fx:id="codeArea" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" disable="true" />
</children>
</AnchorPane>
<AnchorPane fx:id="consoleAnchor" minHeight="0.0" minWidth="0.0">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment