2023年10月28日15:46:44
parent
337dbc2954
commit
7c5818b543
|
|
@ -56,6 +56,7 @@ import java.nio.charset.StandardCharsets;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import static net.imyeyu.timifx.TimiFX.BORDER_EXLEFT;
|
import static net.imyeyu.timifx.TimiFX.BORDER_EXLEFT;
|
||||||
|
|
@ -75,6 +76,9 @@ public class EditorListImplController {
|
||||||
@FXML
|
@FXML
|
||||||
public Menu them_list;
|
public Menu them_list;
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
public MenuItem new_file;
|
||||||
|
|
||||||
public enum Type {
|
public enum Type {
|
||||||
|
|
||||||
JAVA, HTML, GO, JS, CSS, SQL, XML, YML, MARKDOWN
|
JAVA, HTML, GO, JS, CSS, SQL, XML, YML, MARKDOWN
|
||||||
|
|
@ -441,9 +445,21 @@ public class EditorListImplController {
|
||||||
open_dir.setAccelerator(new KeyCodeCombination(KeyCode.D, KeyCodeCombination.CONTROL_DOWN));
|
open_dir.setAccelerator(new KeyCodeCombination(KeyCode.D, KeyCodeCombination.CONTROL_DOWN));
|
||||||
open_dir.setOnAction(event -> open_file_dir());
|
open_dir.setOnAction(event -> open_file_dir());
|
||||||
|
|
||||||
|
new_file.setAccelerator(new KeyCodeCombination(KeyCode.N, KeyCodeCombination.CONTROL_DOWN));
|
||||||
|
new_file.setOnAction(event -> new_file());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
public void new_file(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public String file_name_gen(){
|
||||||
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss");
|
||||||
|
return simpleDateFormat.format(new Date()) + ".txt";
|
||||||
|
}
|
||||||
|
|
||||||
public void open_file() {
|
public void open_file() {
|
||||||
Stage stage = new Stage();
|
Stage stage = new Stage();
|
||||||
FileChooser dc = new FileChooser();
|
FileChooser dc = new FileChooser();
|
||||||
|
|
|
||||||
|
|
@ -139,6 +139,7 @@
|
||||||
<MenuItem fx:id="open_file" mnemonicParsing="false" text="打开文件" />
|
<MenuItem fx:id="open_file" mnemonicParsing="false" text="打开文件" />
|
||||||
<MenuItem fx:id="open_dir" mnemonicParsing="false" text="打开文件夹" />
|
<MenuItem fx:id="open_dir" mnemonicParsing="false" text="打开文件夹" />
|
||||||
<MenuItem fx:id="save" mnemonicParsing="false" text="保存" />
|
<MenuItem fx:id="save" mnemonicParsing="false" text="保存" />
|
||||||
|
<MenuItem fx:id="new_file" mnemonicParsing="false" text="新建" />
|
||||||
</items>
|
</items>
|
||||||
</Menu>
|
</Menu>
|
||||||
<Menu fx:id="them_list" mnemonicParsing="false" text="主题">
|
<Menu fx:id="them_list" mnemonicParsing="false" text="主题">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue