Extract editor from main fxml and add linenumbers

This commit is contained in:
Oystein Kristoffer Tveit 2021-02-17 21:06:09 +01:00
parent fbcd6d3a87
commit 2d6fdd018f
6 changed files with 19 additions and 8 deletions

View File

@ -1,4 +1,4 @@
package app.components.editor;
package app.controllers;
import java.net.URL;
import java.util.ResourceBundle;
@ -22,7 +22,7 @@ public class EditorController implements Initializable {
* Links the controller to the global model
* @param model The model to be linked
*/
public EditorController(Model model) {
public void setModel(Model model) {
this.model = model;
}

View File

@ -1,4 +1,4 @@
package app.components.fileTree;
package app.controllers.fileTree;
import javafx.fxml.FXML;
import javafx.scene.control.TreeView;

View File

@ -5,5 +5,7 @@ module app {
requires javafx.graphics;
requires org.fxmisc.richtext;
opens app.controllers to javafx.fxml;
exports app;
}

View File

@ -61,11 +61,7 @@
</ScrollPane>
<!-- Editor -->
<VirtualizedScrollPane>
<content>
<CodeArea fx:id="editor"/>
</content>
</VirtualizedScrollPane>
<fx:include source="components/Editor.fxml" fx:id="editorRoot"/>
</items>
</SplitPane>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import org.fxmisc.flowless.VirtualizedScrollPane?>
<?import org.fxmisc.richtext.CodeArea?>
<VirtualizedScrollPane
xmlns="http://javafx.com/javafx/8.0.65"
xmlns:fx="http://javafx.com/fxml/1"
fx:controller="app.controllers.EditorController">
<content>
<CodeArea fx:id="editor"/>
</content>
</VirtualizedScrollPane>