🚩 完善右键上下文菜单功能
This commit is contained in:
parent
6b5449a6d5
commit
cae04fe2a0
@ -3,7 +3,7 @@ package org.jcnc.jnotepad;
|
||||
import javafx.application.Application;
|
||||
import javafx.stage.Stage;
|
||||
import org.jcnc.jnotepad.app.manager.ApplicationManager;
|
||||
import org.jcnc.jnotepad.app.utils.LogUtil;
|
||||
import org.jcnc.jnotepad.app.utils.LoggerUtil;
|
||||
|
||||
|
||||
/**
|
||||
@ -29,7 +29,7 @@ public class JnotepadApp extends Application {
|
||||
public void init() {
|
||||
// 获取当前启动位置a
|
||||
String currentWorkingDirectory = System.getProperty("user.dir");
|
||||
LogUtil.getLogger(this.getClass()).info("当前启动位置:{}", currentWorkingDirectory);
|
||||
LoggerUtil.getLogger(this.getClass()).info("当前启动位置:{}", currentWorkingDirectory);
|
||||
// 设置参数
|
||||
APPLICATION_MANAGER.setApplication(this);
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@ package org.jcnc.jnotepad.api.core.controller.config;
|
||||
|
||||
import org.jcnc.jnotepad.api.core.controller.interfaces.ConfigController;
|
||||
import org.jcnc.jnotepad.app.utils.JsonUtil;
|
||||
import org.jcnc.jnotepad.app.utils.LogUtil;
|
||||
import org.jcnc.jnotepad.app.utils.LoggerUtil;
|
||||
import org.jcnc.jnotepad.app.utils.PopUpUtil;
|
||||
import org.jcnc.jnotepad.controller.exception.AppException;
|
||||
import org.slf4j.Logger;
|
||||
@ -29,7 +29,7 @@ public abstract class BaseConfigController<T> implements ConfigController<T> {
|
||||
protected static final String ROOT_CONFIG_DIR = "config";
|
||||
|
||||
protected static final String SYSTEM_CONFIG_DIR = "system";
|
||||
private final Logger logger = LogUtil.getLogger(getClass());
|
||||
private final Logger logger = LoggerUtil.getLogger(getClass());
|
||||
protected T config;
|
||||
|
||||
/**
|
||||
|
||||
@ -8,7 +8,7 @@ import javafx.scene.control.CheckMenuItem;
|
||||
import javafx.scene.control.MenuItem;
|
||||
import javafx.scene.control.RadioMenuItem;
|
||||
import org.jcnc.jnotepad.app.i18n.UiResourceBundle;
|
||||
import org.jcnc.jnotepad.app.utils.LogUtil;
|
||||
import org.jcnc.jnotepad.app.utils.LoggerUtil;
|
||||
import org.jcnc.jnotepad.controller.config.UserConfigController;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
@ -21,7 +21,7 @@ import java.util.Map;
|
||||
* @author gewuyou
|
||||
*/
|
||||
public abstract class AbstractMenu<T> {
|
||||
protected Logger logger = LogUtil.getLogger(this.getClass());
|
||||
protected Logger logger = LoggerUtil.getLogger(this.getClass());
|
||||
UserConfigController userConfigController = UserConfigController.getInstance();
|
||||
|
||||
/**
|
||||
|
||||
@ -1,9 +1,7 @@
|
||||
package org.jcnc.jnotepad.api.core.views.menu.builder;
|
||||
|
||||
import javafx.beans.property.BooleanProperty;
|
||||
import javafx.collections.ObservableList;
|
||||
import javafx.scene.control.ContextMenu;
|
||||
import javafx.scene.control.Menu;
|
||||
import javafx.scene.control.MenuItem;
|
||||
|
||||
/**
|
||||
@ -52,19 +50,4 @@ public class ContextMenuBuilder extends AbstractMenuBuilder<ContextMenuBuilder,
|
||||
protected ObservableList<MenuItem> getItems() {
|
||||
return contextMenu.getItems();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加菜单
|
||||
*
|
||||
* @param menu 菜单
|
||||
* @param visible 是否隐藏
|
||||
* @return 建造者
|
||||
*/
|
||||
@Override
|
||||
public ContextMenuBuilder addMenu(Menu menu, BooleanProperty visible) {
|
||||
menu.setVisible(visible.get());
|
||||
visible.addListener((observable, oldValue, newValue) -> menu.setVisible(Boolean.TRUE.equals(newValue)));
|
||||
getItems().add(menu);
|
||||
return getBuilder();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
package org.jcnc.jnotepad.app.common.manager;
|
||||
|
||||
import org.jcnc.jnotepad.app.utils.LogUtil;
|
||||
import org.jcnc.jnotepad.app.utils.LoggerUtil;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import java.util.concurrent.*;
|
||||
@ -15,7 +15,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
* @author gewuyou
|
||||
*/
|
||||
public class ThreadPoolManager {
|
||||
private static final Logger logger = LogUtil.getLogger(ThreadPoolManager.class);
|
||||
private static final Logger logger = LoggerUtil.getLogger(ThreadPoolManager.class);
|
||||
/**
|
||||
* 核心线程数
|
||||
*/
|
||||
|
||||
@ -14,7 +14,7 @@ import org.jcnc.jnotepad.app.common.manager.ThreadPoolManager;
|
||||
import org.jcnc.jnotepad.app.config.AppConfig;
|
||||
import org.jcnc.jnotepad.app.i18n.UiResourceBundle;
|
||||
import org.jcnc.jnotepad.app.utils.FileUtil;
|
||||
import org.jcnc.jnotepad.app.utils.LogUtil;
|
||||
import org.jcnc.jnotepad.app.utils.LoggerUtil;
|
||||
import org.jcnc.jnotepad.app.utils.UiUtil;
|
||||
import org.jcnc.jnotepad.controller.ResourceController;
|
||||
import org.jcnc.jnotepad.controller.cache.CacheController;
|
||||
@ -287,7 +287,7 @@ public class ApplicationManager {
|
||||
// 关闭当前应用程序
|
||||
stop();
|
||||
} catch (IOException e) {
|
||||
LogUtil.getLogger("正在重启当前应用程序".getClass());
|
||||
LoggerUtil.getLogger("正在重启当前应用程序".getClass());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -35,7 +35,7 @@ public class ClipboardUtil {
|
||||
*/
|
||||
public static String readTextFromClipboard() {
|
||||
String text = CLIPBOARD.getString();
|
||||
LogUtil.getLogger(ClipboardUtil.class).info("剪切板内容:{}", text);
|
||||
LoggerUtil.getLogger(ClipboardUtil.class).info("剪切板内容:{}", text);
|
||||
return text;
|
||||
}
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@ public class EncodingDetector {
|
||||
* 编码侦测概率阈值,50%
|
||||
*/
|
||||
public static final int THRESHOLD_CONFIDENCE = 50;
|
||||
private static final Logger LOG = LogUtil.getLogger(EncodingDetector.class);
|
||||
private static final Logger LOG = LoggerUtil.getLogger(EncodingDetector.class);
|
||||
|
||||
private EncodingDetector() {
|
||||
}
|
||||
|
||||
@ -6,6 +6,7 @@ import org.jcnc.jnotepad.controller.event.handler.menuitem.OpenFile;
|
||||
import org.jcnc.jnotepad.controller.exception.AppException;
|
||||
import org.jcnc.jnotepad.model.entity.DirFileModel;
|
||||
import org.kordamp.ikonli.javafx.FontIcon;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import java.awt.*;
|
||||
import java.io.*;
|
||||
@ -30,6 +31,11 @@ import static org.kordamp.ikonli.antdesignicons.AntDesignIconsFilled.*;
|
||||
public class FileUtil {
|
||||
private static final MessageDigest MESSAGE_DIGEST_SHA_256;
|
||||
private static final int BUFFER_SIZE = 8192;
|
||||
private static final Logger logger = LoggerUtil.getLogger(FileUtil.class);
|
||||
|
||||
private static final String WINDOWS = "win";
|
||||
|
||||
private static final String MAC = "mac";
|
||||
|
||||
static {
|
||||
try {
|
||||
@ -133,7 +139,7 @@ public class FileUtil {
|
||||
stringBuilder.append(line);
|
||||
}
|
||||
} catch (IOException ignored) {
|
||||
LogUtil.getLogger(OpenFile.class).info("已忽视IO异常!");
|
||||
LoggerUtil.getLogger(OpenFile.class).info("已忽视IO异常!");
|
||||
}
|
||||
return stringBuilder.toString();
|
||||
}
|
||||
@ -162,7 +168,7 @@ public class FileUtil {
|
||||
DirFileModel childDirFileModel = getDirFileModel(f);
|
||||
dirFileModel.getChildFile().add(childDirFileModel);
|
||||
} else {
|
||||
// todo 在此监测文件后缀,设置对应的图标
|
||||
// 在此监测文件后缀,设置对应的图标
|
||||
dirFileModel.getChildFile().add(new DirFileModel(
|
||||
f.getAbsolutePath(), f.getName(), null,
|
||||
getIconCorrespondingToFileName(f.getName()),
|
||||
@ -305,7 +311,7 @@ public class FileUtil {
|
||||
* @return the corresponding icon for the file extension
|
||||
*/
|
||||
public static Node getIconCorrespondingToFileName(String fileName) {
|
||||
// todo 在此根据文件缀名获取对应的图标
|
||||
// 在此根据文件缀名获取对应的图标
|
||||
String fileExtension = fileName.substring(fileName.lastIndexOf(".") + 1);
|
||||
Node orDefault = UiUtil.getIconMap().getOrDefault(fileExtension, FontIcon.of(FILE_UNKNOWN));
|
||||
if (orDefault instanceof FontIcon fontIcon) {
|
||||
@ -317,8 +323,46 @@ public class FileUtil {
|
||||
return orDefault;
|
||||
}
|
||||
|
||||
public static void openTerminal(File file) {
|
||||
//todo @luke 请你在此设置打开文件所在文件夹路径于终端
|
||||
/**
|
||||
* Opens a terminal in the specified folder.
|
||||
*
|
||||
* @param folder the folder in which to open the terminal
|
||||
*/
|
||||
public static void openTerminal(File folder) {
|
||||
if (folder.exists() && folder.isDirectory()) {
|
||||
String os = System.getProperty("os.name").toLowerCase();
|
||||
|
||||
ProcessBuilder processBuilder = getProcessBuilder(folder, os);
|
||||
try {
|
||||
processBuilder.start();
|
||||
} catch (IOException e) {
|
||||
PopUpUtil.errorAlert("打开失败", "打开于终端失败", "错误原因" + e.getMessage(), null, null);
|
||||
}
|
||||
} else {
|
||||
logger.info("文件夹不存在或者不是文件夹");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a ProcessBuilder object based on the provided folder and operating system.
|
||||
*
|
||||
* @param folder the folder to set as the working directory for the ProcessBuilder object
|
||||
* @param os the operating system to determine the appropriate command for the ProcessBuilder object
|
||||
* @return a ProcessBuilder object with the correct command for the specified operating system
|
||||
*/
|
||||
private static ProcessBuilder getProcessBuilder(File folder, String os) {
|
||||
ProcessBuilder processBuilder;
|
||||
if (os.contains(WINDOWS)) {
|
||||
// Windows系统
|
||||
processBuilder = new ProcessBuilder("cmd.exe", "/c", "start", "cmd.exe", "/k", "cd", folder.getAbsolutePath());
|
||||
} else if (os.contains(MAC)) {
|
||||
// macOS系统
|
||||
processBuilder = new ProcessBuilder("open", "-a", "Terminal", folder.getAbsolutePath());
|
||||
} else {
|
||||
// Linux或其他系统
|
||||
processBuilder = new ProcessBuilder("gnome-terminal", "--working-directory=", folder.getAbsolutePath());
|
||||
}
|
||||
return processBuilder;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -10,8 +10,8 @@ import org.slf4j.LoggerFactory;
|
||||
*
|
||||
* @author gewuyou
|
||||
*/
|
||||
public class LogUtil {
|
||||
private LogUtil() {
|
||||
public class LoggerUtil {
|
||||
private LoggerUtil() {
|
||||
}
|
||||
|
||||
/**
|
||||
@ -39,7 +39,7 @@ import static org.jcnc.jnotepad.controller.config.UserConfigController.CONFIG_NA
|
||||
*/
|
||||
public class TabUtil {
|
||||
private static final ApplicationCacheManager CACHE_MANAGER = ApplicationCacheManager.getInstance();
|
||||
private static final Logger logger = LogUtil.getLogger(TabUtil.class);
|
||||
private static final Logger logger = LoggerUtil.getLogger(TabUtil.class);
|
||||
|
||||
private TabUtil() {
|
||||
}
|
||||
@ -75,7 +75,7 @@ public class TabUtil {
|
||||
* 另存为
|
||||
*
|
||||
* @apiNote 将当前选中的标签页进行另存为弹出窗口式的保存。
|
||||
* @see LogUtil
|
||||
* @see LoggerUtil
|
||||
*/
|
||||
public static void saveAsFile(CenterTab tab) {
|
||||
if (tab == null) {
|
||||
@ -321,7 +321,7 @@ public class TabUtil {
|
||||
// 检测文件编码
|
||||
Charset encoding = EncodingDetector.detectEncodingCharset(file);
|
||||
String fileText = getFileText(file, encoding);
|
||||
LogUtil.getLogger(OpenFile.class).info("已调用读取文件功能");
|
||||
LoggerUtil.getLogger(OpenFile.class).info("已调用读取文件功能");
|
||||
textCodeArea.appendText(fileText);
|
||||
// 设置当前标签页关联本地文件 设置标签页关联文件
|
||||
CenterTab tab = new CenterTab(file.getName(), textCodeArea, encoding, file, true);
|
||||
@ -388,9 +388,7 @@ public class TabUtil {
|
||||
.addSeparatorMenuItem(tab.relevancePropertyProperty())
|
||||
.addMenu(new MenuBuilder(OPEN_ON)
|
||||
.addMenuItem(EXPLORER, e -> FileUtil.openExplorer(file))
|
||||
.addMenuItem(TERMINAL, e -> {
|
||||
//todo @luke 请你在此设置打开文件所在文件夹路径于终端
|
||||
})
|
||||
.addMenuItem(TERMINAL, e -> FileUtil.openTerminal(file.getParentFile()))
|
||||
.build(), tab.relevancePropertyProperty())
|
||||
.addSeparatorMenuItem()
|
||||
.addCheckMenuItem(FIXED_TAB,
|
||||
|
||||
@ -3,7 +3,7 @@ package org.jcnc.jnotepad.controller.cache;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import org.jcnc.jnotepad.app.common.manager.ApplicationCacheManager;
|
||||
import org.jcnc.jnotepad.app.utils.JsonUtil;
|
||||
import org.jcnc.jnotepad.app.utils.LogUtil;
|
||||
import org.jcnc.jnotepad.app.utils.LoggerUtil;
|
||||
import org.jcnc.jnotepad.controller.config.AppConfigController;
|
||||
import org.jcnc.jnotepad.model.entity.Cache;
|
||||
import org.slf4j.Logger;
|
||||
@ -28,7 +28,7 @@ public class CacheController {
|
||||
|
||||
private static final ApplicationCacheManager APPLICATION_CACHE_MANAGER = ApplicationCacheManager.getInstance();
|
||||
private static final CacheController INSTANCE = new CacheController();
|
||||
Logger logger = LogUtil.getLogger(this.getClass());
|
||||
Logger logger = LoggerUtil.getLogger(this.getClass());
|
||||
private String cacheDir;
|
||||
|
||||
private CacheController() {
|
||||
|
||||
@ -4,7 +4,7 @@ import javafx.scene.control.MenuItem;
|
||||
import javafx.scene.input.KeyCombination;
|
||||
import org.jcnc.jnotepad.api.core.controller.config.BaseConfigController;
|
||||
import org.jcnc.jnotepad.app.config.UserConfig;
|
||||
import org.jcnc.jnotepad.app.utils.LogUtil;
|
||||
import org.jcnc.jnotepad.app.utils.LoggerUtil;
|
||||
import org.jcnc.jnotepad.model.entity.ShortcutKey;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
@ -35,7 +35,7 @@ public class UserConfigController extends BaseConfigController<UserConfig> {
|
||||
private static final String ALT_S = "alt+s";
|
||||
private static final UserConfigController INSTANCE = new UserConfigController();
|
||||
private final List<Map<String, MenuItem>> menuItems = new ArrayList<>();
|
||||
Logger logger = LogUtil.getLogger(this.getClass());
|
||||
Logger logger = LoggerUtil.getLogger(this.getClass());
|
||||
private String configDir;
|
||||
|
||||
private UserConfigController() {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
package org.jcnc.jnotepad.controller.event.handler.menuitem;
|
||||
|
||||
import javafx.event.ActionEvent;
|
||||
import org.jcnc.jnotepad.app.utils.LogUtil;
|
||||
import org.jcnc.jnotepad.app.utils.LoggerUtil;
|
||||
import org.jcnc.jnotepad.controller.config.UserConfigController;
|
||||
|
||||
import java.io.File;
|
||||
@ -26,7 +26,7 @@ public class OpenConfig extends OpenFile {
|
||||
public void handle(ActionEvent actionEvent) {
|
||||
// 显示文件选择对话框,并获取配置文件
|
||||
File file = UserConfigController.getInstance().getConfigPath().toFile();
|
||||
LogUtil.getLogger(this.getClass()).info("已调用打开配置文件功能, {}", file);
|
||||
LoggerUtil.getLogger(this.getClass()).info("已调用打开配置文件功能, {}", file);
|
||||
// 创建打开文件的任务并启动线程执行任务
|
||||
openFileToTab(file);
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
package org.jcnc.jnotepad.controller.event.handler.menuitem;
|
||||
|
||||
import javafx.event.ActionEvent;
|
||||
import org.jcnc.jnotepad.app.utils.LogUtil;
|
||||
import org.jcnc.jnotepad.app.utils.LoggerUtil;
|
||||
import org.jcnc.jnotepad.ui.views.manager.CenterTabPaneManager;
|
||||
|
||||
import static org.jcnc.jnotepad.app.utils.TabUtil.saveAsFile;
|
||||
@ -24,7 +24,7 @@ public class SaveAsFile extends SaveFile {
|
||||
*/
|
||||
@Override
|
||||
public void handle(ActionEvent event) {
|
||||
LogUtil.getLogger(SaveAsFile.class).info("已调用另存为功能");
|
||||
LoggerUtil.getLogger(SaveAsFile.class).info("已调用另存为功能");
|
||||
saveAsFile(CenterTabPaneManager.getInstance().getSelected());
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@ package org.jcnc.jnotepad.controller.plugin;
|
||||
|
||||
import org.jcnc.jnotepad.app.common.manager.ThreadPoolManager;
|
||||
import org.jcnc.jnotepad.app.utils.JsonUtil;
|
||||
import org.jcnc.jnotepad.app.utils.LogUtil;
|
||||
import org.jcnc.jnotepad.app.utils.LoggerUtil;
|
||||
import org.jcnc.jnotepad.controller.config.PluginConfigController;
|
||||
import org.jcnc.jnotepad.controller.exception.AppException;
|
||||
import org.jcnc.jnotepad.controller.plugin.interfaces.Plugin;
|
||||
@ -32,7 +32,7 @@ public class PluginLoader {
|
||||
private static final PluginLoader INSTANCE = new PluginLoader();
|
||||
|
||||
private static final ExecutorService THREAD_POOL = ThreadPoolManager.getThreadPool();
|
||||
Logger logger = LogUtil.getLogger(this.getClass());
|
||||
Logger logger = LoggerUtil.getLogger(this.getClass());
|
||||
|
||||
/**
|
||||
* 从插件jar包中读取 json 文件到 PluginDescriptor 类
|
||||
|
||||
@ -6,7 +6,7 @@ import javafx.scene.control.Label;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.stage.FileChooser;
|
||||
import javafx.stage.Stage;
|
||||
import org.jcnc.jnotepad.app.utils.LogUtil;
|
||||
import org.jcnc.jnotepad.app.utils.LoggerUtil;
|
||||
import org.jcnc.jnotepad.app.utils.PopUpUtil;
|
||||
import org.jcnc.jnotepad.app.utils.UiUtil;
|
||||
import org.jcnc.jnotepad.controller.plugin.manager.PluginManager;
|
||||
@ -26,7 +26,7 @@ import java.util.Map;
|
||||
*/
|
||||
public class PluginManagerInterface {
|
||||
private static final PluginManagerInterface INSTANCE = new PluginManagerInterface();
|
||||
Logger logger = LogUtil.getLogger(this.getClass());
|
||||
Logger logger = LoggerUtil.getLogger(this.getClass());
|
||||
|
||||
public static PluginManagerInterface getInstance() {
|
||||
return INSTANCE;
|
||||
|
||||
@ -2,7 +2,7 @@ package org.jcnc.jnotepad.controller.plugin.manager;
|
||||
|
||||
import org.jcnc.jnotepad.app.common.manager.ThreadPoolManager;
|
||||
import org.jcnc.jnotepad.app.manager.ApplicationManager;
|
||||
import org.jcnc.jnotepad.app.utils.LogUtil;
|
||||
import org.jcnc.jnotepad.app.utils.LoggerUtil;
|
||||
import org.jcnc.jnotepad.app.utils.PopUpUtil;
|
||||
import org.jcnc.jnotepad.controller.config.PluginConfigController;
|
||||
import org.jcnc.jnotepad.model.entity.PluginDescriptor;
|
||||
@ -34,7 +34,7 @@ public class PluginManager {
|
||||
* 插件类别
|
||||
*/
|
||||
private final Map<String, List<String>> categories = new HashMap<>();
|
||||
Logger logger = LogUtil.getLogger(this.getClass());
|
||||
Logger logger = LoggerUtil.getLogger(this.getClass());
|
||||
/**
|
||||
* 插件信息
|
||||
*/
|
||||
|
||||
@ -10,7 +10,7 @@ import javafx.scene.layout.Priority;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.util.Duration;
|
||||
import org.fxmisc.richtext.StyleClassedTextArea;
|
||||
import org.jcnc.jnotepad.app.utils.LogUtil;
|
||||
import org.jcnc.jnotepad.app.utils.LoggerUtil;
|
||||
|
||||
import java.io.*;
|
||||
import java.nio.charset.Charset;
|
||||
@ -78,7 +78,7 @@ public class CmdTerminalBox extends VBox {
|
||||
.start();
|
||||
cmdInputWriter = new PrintWriter(new OutputStreamWriter(cmdProcess.getOutputStream(), Charset.forName("GBK")));
|
||||
} catch (IOException e) {
|
||||
LogUtil.getLogger(this.getClass()).info("已调用, {}", cmdProcess);
|
||||
LoggerUtil.getLogger(this.getClass()).info("已调用, {}", cmdProcess);
|
||||
}
|
||||
|
||||
// 延迟执行打印当前文件夹路径的语句
|
||||
@ -114,7 +114,7 @@ public class CmdTerminalBox extends VBox {
|
||||
Platform.runLater(() -> appendTextToCmdOutput(outputLine));
|
||||
}
|
||||
} catch (IOException e) {
|
||||
LogUtil.getLogger(this.getClass()).info("已调用, {}", this);
|
||||
LoggerUtil.getLogger(this.getClass()).info("已调用, {}", this);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -10,7 +10,7 @@ import javafx.scene.layout.VBox;
|
||||
import javafx.stage.Stage;
|
||||
import org.jcnc.jnotepad.api.core.component.stage.AbstractPaneStage;
|
||||
import org.jcnc.jnotepad.app.manager.ApplicationManager;
|
||||
import org.jcnc.jnotepad.app.utils.LogUtil;
|
||||
import org.jcnc.jnotepad.app.utils.LoggerUtil;
|
||||
import org.jcnc.jnotepad.app.utils.PopUpUtil;
|
||||
import org.jcnc.jnotepad.app.utils.UiUtil;
|
||||
import org.jcnc.jnotepad.ui.component.stage.topmenu.builder.StageButtonBuilder;
|
||||
@ -23,7 +23,7 @@ import org.slf4j.Logger;
|
||||
*/
|
||||
public class DeveloperDebugPaneStage extends AbstractPaneStage {
|
||||
private static final String DEBUG_STR = "开发者调试: {}启动!";
|
||||
Logger logger = LogUtil.getLogger(this.getClass());
|
||||
Logger logger = LoggerUtil.getLogger(this.getClass());
|
||||
|
||||
/**
|
||||
* 获取舞台图标
|
||||
|
||||
@ -17,7 +17,7 @@ import javafx.stage.Modality;
|
||||
import javafx.stage.Stage;
|
||||
import org.jcnc.jnotepad.api.core.component.stage.AbstractPaneStage;
|
||||
import org.jcnc.jnotepad.app.utils.ClipboardUtil;
|
||||
import org.jcnc.jnotepad.app.utils.LogUtil;
|
||||
import org.jcnc.jnotepad.app.utils.LoggerUtil;
|
||||
import org.jcnc.jnotepad.app.utils.NotificationUtil;
|
||||
import org.jcnc.jnotepad.app.utils.UiUtil;
|
||||
|
||||
@ -130,7 +130,7 @@ public class HelpPaneStage extends AbstractPaneStage {
|
||||
NotificationUtil.infoNotification("软件信息已经复制到剪贴板!");
|
||||
String info = "软件名字:" + APP_NAME + "\t" + "版本:" + VERSION;
|
||||
ClipboardUtil.writeTextToClipboard(info);
|
||||
LogUtil.getLogger(this.getClass()).info("软件信息已经复制到剪贴板:{}", info);
|
||||
LoggerUtil.getLogger(this.getClass()).info("软件信息已经复制到剪贴板:{}", info);
|
||||
|
||||
// 关闭当前的 Stage
|
||||
Stage currentStage = (Stage) ((Button) event.getSource()).getScene().getWindow();
|
||||
@ -191,10 +191,10 @@ public class HelpPaneStage extends AbstractPaneStage {
|
||||
*/
|
||||
private void openWebsite(String url) {
|
||||
try {
|
||||
LogUtil.getLogger(this.getClass()).info("正在打开---{}", url);
|
||||
LoggerUtil.getLogger(this.getClass()).info("正在打开---{}", url);
|
||||
java.awt.Desktop.getDesktop().browse(java.net.URI.create(url));
|
||||
} catch (java.io.IOException e) {
|
||||
LogUtil.getLogger(this.getClass()).info("打开失败---{}", url);
|
||||
LoggerUtil.getLogger(this.getClass()).info("打开失败---{}", url);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -26,7 +26,7 @@ import javafx.stage.Stage;
|
||||
import org.commonmark.parser.Parser;
|
||||
import org.commonmark.renderer.html.HtmlRenderer;
|
||||
import org.jcnc.jnotepad.api.core.component.stage.AbstractPaneStage;
|
||||
import org.jcnc.jnotepad.app.utils.LogUtil;
|
||||
import org.jcnc.jnotepad.app.utils.LoggerUtil;
|
||||
import org.jcnc.jnotepad.app.utils.PopUpUtil;
|
||||
import org.jcnc.jnotepad.app.utils.UiUtil;
|
||||
import org.jcnc.jnotepad.controller.plugin.manager.PluginManager;
|
||||
@ -65,7 +65,7 @@ public class PluginManagementPane extends AbstractPaneStage {
|
||||
/**
|
||||
* 日志记录器
|
||||
*/
|
||||
Logger logger = LogUtil.getLogger(this.getClass());
|
||||
Logger logger = LoggerUtil.getLogger(this.getClass());
|
||||
/**
|
||||
* 自定义分割面板
|
||||
*/
|
||||
|
||||
@ -4,7 +4,7 @@ import javafx.collections.ObservableList;
|
||||
import javafx.geometry.Insets;
|
||||
import javafx.scene.control.Menu;
|
||||
import org.jcnc.jnotepad.api.core.views.manager.AbstractManager;
|
||||
import org.jcnc.jnotepad.app.utils.LogUtil;
|
||||
import org.jcnc.jnotepad.app.utils.LoggerUtil;
|
||||
import org.jcnc.jnotepad.controller.config.UserConfigController;
|
||||
import org.jcnc.jnotepad.ui.views.root.top.menubar.TopMenuBar;
|
||||
import org.jcnc.jnotepad.ui.views.root.top.menubar.menu.*;
|
||||
@ -22,7 +22,7 @@ public class TopMenuBarManager extends AbstractManager<Menu> {
|
||||
private static final TopMenuBarManager INSTANCE = new TopMenuBarManager();
|
||||
private final TopMenuBar topMenuBar = TopMenuBar.getInstance();
|
||||
private final List<Menu> nodeList = new ArrayList<>();
|
||||
Logger logger = LogUtil.getLogger(this.getClass());
|
||||
Logger logger = LoggerUtil.getLogger(this.getClass());
|
||||
UserConfigController userConfigController = UserConfigController.getInstance();
|
||||
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ import javafx.scene.control.CheckMenuItem;
|
||||
import javafx.scene.control.Tab;
|
||||
import org.fxmisc.flowless.VirtualizedScrollPane;
|
||||
import org.jcnc.jnotepad.app.utils.FileUtil;
|
||||
import org.jcnc.jnotepad.app.utils.LogUtil;
|
||||
import org.jcnc.jnotepad.app.utils.LoggerUtil;
|
||||
import org.jcnc.jnotepad.app.utils.TabUtil;
|
||||
import org.jcnc.jnotepad.controller.config.UserConfigController;
|
||||
import org.jcnc.jnotepad.ui.component.module.TextCodeArea;
|
||||
@ -47,7 +47,7 @@ public class CenterTab extends Tab {
|
||||
private final BooleanProperty hasLeftTabsProperty = new SimpleBooleanProperty(false);
|
||||
private final BooleanProperty hasRightTabsProperty = new SimpleBooleanProperty(false);
|
||||
private final BooleanProperty hasOtherTabsProperty = new SimpleBooleanProperty(false);
|
||||
Logger logger = LogUtil.getLogger(this.getClass());
|
||||
Logger logger = LoggerUtil.getLogger(this.getClass());
|
||||
/**
|
||||
* 默认关闭自动换行
|
||||
*/
|
||||
@ -165,10 +165,10 @@ public class CenterTab extends Tab {
|
||||
// 将新的文本内容写入文件
|
||||
writer.write(newValue);
|
||||
// 记录保存操作的日志信息
|
||||
LogUtil.getLogger(this.getClass()).info("正在自动保存---");
|
||||
LoggerUtil.getLogger(this.getClass()).info("正在自动保存---");
|
||||
} catch (IOException ignored) {
|
||||
// 如果发生IO异常,记录忽视的日志信息,但不中断程序执行
|
||||
LogUtil.getLogger(this.getClass()).info("已忽视IO异常!");
|
||||
LoggerUtil.getLogger(this.getClass()).info("已忽视IO异常!");
|
||||
}
|
||||
// 更新最后修改时间
|
||||
tab.setLastModifiedTimeOfAssociatedFile(file.lastModified());
|
||||
|
||||
@ -5,7 +5,7 @@ import javafx.event.EventHandler;
|
||||
import javafx.scene.control.Menu;
|
||||
import javafx.scene.control.MenuItem;
|
||||
import org.jcnc.jnotepad.api.core.views.menu.AbstractBaseMenu;
|
||||
import org.jcnc.jnotepad.app.utils.LogUtil;
|
||||
import org.jcnc.jnotepad.app.utils.LoggerUtil;
|
||||
import org.jcnc.jnotepad.ui.component.module.vbox.BuildPanel;
|
||||
import org.jcnc.jnotepad.ui.views.manager.BuildPanelManager;
|
||||
import org.jcnc.jnotepad.ui.views.manager.CenterTabPaneManager;
|
||||
@ -41,7 +41,7 @@ public class RunTopMenu extends AbstractBaseMenu {
|
||||
try (PrintWriter writer = new PrintWriter(new FileWriter(fileName))) {
|
||||
writer.write(code);
|
||||
} catch (IOException ex) {
|
||||
LogUtil.getLogger(this.getClass()).info("正在写入:{}", code);
|
||||
LoggerUtil.getLogger(this.getClass()).info("正在写入:{}", code);
|
||||
}
|
||||
|
||||
// 编译C代码
|
||||
@ -125,7 +125,7 @@ public class RunTopMenu extends AbstractBaseMenu {
|
||||
System.out.println("编译失败,返回代码:" + compileExitCode);
|
||||
}
|
||||
} catch (IOException | InterruptedException e) {
|
||||
LogUtil.getLogger(this.getClass()).info("编译失败:{}", fileName);
|
||||
LoggerUtil.getLogger(this.getClass()).info("编译失败:{}", fileName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@ title=JNotepad
|
||||
OPEN=打开
|
||||
OPEN_DIRECTORY=打开文件夹
|
||||
BUILD=构建
|
||||
TERMINAL=控制台
|
||||
TERMINAL=终端
|
||||
ABOUT=关于
|
||||
DEVELOPER=开发者
|
||||
HELP=帮助
|
||||
|
||||
@ -14,7 +14,7 @@ HELP=帮助
|
||||
RUN=运行
|
||||
DE_BUG=调试
|
||||
BUILD=构建
|
||||
TERMINAL=控制台
|
||||
TERMINAL=终端
|
||||
ABOUT=关于
|
||||
DEVELOPER=开发者
|
||||
OPEN_CONFIGURATION_FILE=打开配置文件
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user