💡 添加或修改源代码注释⚡️ 优化代码逻辑
This commit is contained in:
parent
422bb59161
commit
8f4448bac2
@ -42,7 +42,7 @@ public class LunchApp extends Application {
|
||||
scene = new Scene(root, width, length);
|
||||
Application.setUserAgentStylesheet(new PrimerLight().getUserAgentStylesheet());
|
||||
scene.getStylesheets().add(Objects.requireNonNull(getClass().getResource("/css/styles.css")).toExternalForm());
|
||||
initUIComponents();
|
||||
initUiComponents();
|
||||
|
||||
|
||||
UIResourceBundle.bindStringProperty(primaryStage.titleProperty(), TextConstants.TITLE);
|
||||
@ -53,7 +53,7 @@ public class LunchApp extends Application {
|
||||
primaryStage.show();
|
||||
}
|
||||
|
||||
private void initUIComponents() {
|
||||
private void initUiComponents() {
|
||||
|
||||
//1. 加载语言
|
||||
LocalizationController.initLocal();
|
||||
|
||||
@ -36,7 +36,6 @@ public class OpenFile implements EventHandler<ActionEvent> {
|
||||
*/
|
||||
@Override
|
||||
public void handle(ActionEvent event) {
|
||||
|
||||
// 创建文件选择器
|
||||
FileChooser fileChooser = new FileChooser();
|
||||
// 显示文件选择对话框,并获取选中的文件
|
||||
|
||||
@ -13,8 +13,8 @@ import static org.jcnc.jnotepad.constants.TextConstants.CHINESE;
|
||||
import static org.jcnc.jnotepad.constants.TextConstants.ENGLISH;
|
||||
|
||||
/**
|
||||
* 本地化配置文件<br>
|
||||
* 注意:该配置文件必须先于快捷键配置文件加载
|
||||
* 本地化控制器<br>
|
||||
* 注意:本地化配置加载应当优先于快捷键配置加载
|
||||
*
|
||||
* @author gewuyou
|
||||
* @see LunchApp
|
||||
|
||||
@ -3,10 +3,8 @@ package org.jcnc.jnotepad.ui;
|
||||
import javafx.beans.property.StringProperty;
|
||||
import javafx.scene.control.TextArea;
|
||||
import javafx.scene.layout.BorderPane;
|
||||
import org.jcnc.jnotepad.app.config.AppConfig;
|
||||
import org.jcnc.jnotepad.controller.config.AppConfigController;
|
||||
import org.jcnc.jnotepad.tool.LogUtil;
|
||||
import org.jcnc.jnotepad.ui.menu.JNotepadMenuBar;
|
||||
import org.jcnc.jnotepad.ui.status.JNotepadStatusBox;
|
||||
import org.jcnc.jnotepad.ui.tab.JNotepadTab;
|
||||
import org.jcnc.jnotepad.ui.tab.JNotepadTabPane;
|
||||
|
||||
@ -145,11 +145,8 @@ public class JNotepadMenuBar extends MenuBar {
|
||||
for (AppConfig.ShortcutKey shortcutKey : shortcutKeyConfigs) {
|
||||
// 保证json的key必须和变量名一致
|
||||
MenuItem menuItem = this.itemMap.get(shortcutKey.getButtonName());
|
||||
if (Objects.isNull(menuItem)) {
|
||||
continue;
|
||||
}
|
||||
String shortKeyValue = shortcutKey.getShortcutKeyValue();
|
||||
if ("".equals(shortKeyValue)) {
|
||||
if (Objects.isNull(menuItem) || "".equals(shortKeyValue)) {
|
||||
continue;
|
||||
}
|
||||
logger.info("功能名称:{}->快捷键:{}", menuItem.getText(), shortKeyValue);
|
||||
@ -290,6 +287,7 @@ public class JNotepadMenuBar extends MenuBar {
|
||||
|
||||
/**
|
||||
* 切换语言
|
||||
*
|
||||
* @param actionEvent 点击事件
|
||||
*/
|
||||
private void toggleLanguage(ActionEvent actionEvent) {
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
<property name="log.maxHistory" value="30"/>
|
||||
<!-- 日志存储路径 -->
|
||||
<property name="log.filePath" value="logs"/>
|
||||
<!--发布0时,请使用下方的路径-->
|
||||
<!--发布时,请使用下方的路径-->
|
||||
<!--<property name="log.filePath" value="${user.home}/.jnotepad/logs"/>-->
|
||||
<!-- 日志的显式格式 -->
|
||||
<property name="log.pattern"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user