细微修改
This commit is contained in:
parent
239d69ddc3
commit
82bd720d0e
@ -96,6 +96,12 @@ public class ApplicationManager {
|
|||||||
primaryStage.setWidth(scene.getWidth());
|
primaryStage.setWidth(scene.getWidth());
|
||||||
primaryStage.setHeight(scene.getHeight());
|
primaryStage.setHeight(scene.getHeight());
|
||||||
primaryStage.getIcons().add(UiUtil.getAppIcon());
|
primaryStage.getIcons().add(UiUtil.getAppIcon());
|
||||||
|
primaryStage.focusedProperty().addListener((observable, oldValue, newValue) -> {
|
||||||
|
if (Boolean.TRUE.equals(newValue)) {
|
||||||
|
CenterTabPaneManager instance = CenterTabPaneManager.getInstance();
|
||||||
|
instance.checkFileTabStatus(instance.getSelected());
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -134,7 +134,7 @@ public class PluginManager {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 执行加载的插件
|
* 执行加载的插件
|
||||||
* todo 待移除
|
* @deprecated 待删除
|
||||||
*/
|
*/
|
||||||
public void executePlugins() {
|
public void executePlugins() {
|
||||||
for (PluginDescriptor pluginDescriptor : pluginDescriptors) {
|
for (PluginDescriptor pluginDescriptor : pluginDescriptors) {
|
||||||
@ -202,7 +202,7 @@ public class PluginManager {
|
|||||||
appDialog.close();
|
appDialog.close();
|
||||||
// 执行重启操作
|
// 执行重启操作
|
||||||
ApplicationRestarter.restart();
|
ApplicationRestarter.restart();
|
||||||
}, null);
|
}, null, "重启", "以后再说");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -3,10 +3,8 @@ package org.jcnc.jnotepad.views.manager;
|
|||||||
import javafx.collections.ObservableList;
|
import javafx.collections.ObservableList;
|
||||||
import javafx.scene.control.Tab;
|
import javafx.scene.control.Tab;
|
||||||
import javafx.stage.Stage;
|
import javafx.stage.Stage;
|
||||||
import org.jcnc.jnotepad.app.manager.ApplicationManager;
|
|
||||||
import org.jcnc.jnotepad.common.manager.ApplicationCacheManager;
|
import org.jcnc.jnotepad.common.manager.ApplicationCacheManager;
|
||||||
import org.jcnc.jnotepad.common.util.FileUtil;
|
import org.jcnc.jnotepad.common.util.FileUtil;
|
||||||
import org.jcnc.jnotepad.common.util.LogUtil;
|
|
||||||
import org.jcnc.jnotepad.common.util.PopUpUtil;
|
import org.jcnc.jnotepad.common.util.PopUpUtil;
|
||||||
import org.jcnc.jnotepad.controller.config.AppConfigController;
|
import org.jcnc.jnotepad.controller.config.AppConfigController;
|
||||||
import org.jcnc.jnotepad.model.enums.CacheExpirationTime;
|
import org.jcnc.jnotepad.model.enums.CacheExpirationTime;
|
||||||
@ -67,11 +65,6 @@ public class CenterTabPaneManager {
|
|||||||
bottomStatusBoxManager.updateWhenTabSelected();
|
bottomStatusBoxManager.updateWhenTabSelected();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
ApplicationManager.getInstance().getPrimaryStage().focusedProperty().addListener((observable, oldValue, newValue) -> {
|
|
||||||
if (Boolean.TRUE.equals(newValue)) {
|
|
||||||
checkFileTabStatus(getSelected());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -80,10 +73,8 @@ public class CenterTabPaneManager {
|
|||||||
*
|
*
|
||||||
* @apiNote 该方法检查当前文件是否被修改,如果被修改,则返回true
|
* @apiNote 该方法检查当前文件是否被修改,如果被修改,则返回true
|
||||||
*/
|
*/
|
||||||
private void checkFileTabStatus(CenterTab tab) {
|
public void checkFileTabStatus(CenterTab tab) {
|
||||||
if (tab.isRelevance()) {
|
if (tab.isRelevance()) {
|
||||||
LogUtil.getLogger(this.getClass()).info("当前标签页关联文件");
|
|
||||||
|
|
||||||
// 获取当前文本域对象
|
// 获取当前文本域对象
|
||||||
LineNumberTextArea lineNumberTextArea = tab.getLineNumberTextArea();
|
LineNumberTextArea lineNumberTextArea = tab.getLineNumberTextArea();
|
||||||
// 获取当前标签页对应文件上次修改时间
|
// 获取当前标签页对应文件上次修改时间
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user