Extract editor from main fxml and add linenumbers
This commit is contained in:
parent
fbcd6d3a87
commit
2d6fdd018f
@ -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;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
package app.components.fileTree;
|
||||
package app.controllers.fileTree;
|
||||
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.TreeView;
|
@ -5,5 +5,7 @@ module app {
|
||||
requires javafx.graphics;
|
||||
requires org.fxmisc.richtext;
|
||||
|
||||
opens app.controllers to javafx.fxml;
|
||||
|
||||
exports app;
|
||||
}
|
||||
|
@ -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>
|
||||
|
13
src/main/resources/fxml/components/Editor.fxml
Normal file
13
src/main/resources/fxml/components/Editor.fxml
Normal 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>
|
Loading…
Reference in New Issue
Block a user