2024年4月11日17:24:12

master
zm 2024-04-11 17:24:22 +08:00
parent 8e71c563f9
commit 41109980e0
1 changed files with 8 additions and 2 deletions

View File

@ -91,7 +91,7 @@ public class EditorListImplController {
public enum Type {
JAVA, HTML, GO, JS, CSS, SQL, XML, YML, MARKDOWN
JAVA, HTML, GO, JS, CSS, SQL, XML, YML, MARKDOWN,PROPERTIES,JSON
}
private TabPane tabPane = null;
@ -511,7 +511,7 @@ public class EditorListImplController {
Stage stage = new Stage();
FileChooser dc = new FileChooser();
dc.setTitle("文件选择");
dc.getExtensionFilters().addAll(new FileChooser.ExtensionFilter("文件类型", "*.java", "*.go", "*.txt", "*.json", "*.sql"));
dc.getExtensionFilters().addAll(new FileChooser.ExtensionFilter("文件类型", "*.*"));
File file = dc.showOpenDialog(stage);
if (file != null) {
refresh(file, 0);
@ -671,6 +671,10 @@ public class EditorListImplController {
type = Type.MARKDOWN;
}
if (extension.equals("properties")) {
type = Type.PROPERTIES;
}
if (type == null) {
type = Type.JAVA;
}
@ -789,6 +793,8 @@ public class EditorListImplController {
case XML -> mode = AceMode.XML;
case SQL -> mode = AceMode.SQL;
case MARKDOWN -> mode = AceMode.MARKDOWN;
case PROPERTIES -> mode = AceMode.PROPERTIES;
case JSON -> mode = AceMode.JSON;
}
//新建编辑器
AceEditor editor = new AceEditor(choose_file.getValue(), mode, EditorListImplController.this.choose_them.get());