From b502d607866868eb68f1ba0aa9cfecba30d3d554 Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Mon, 21 Jan 2019 20:28:02 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-13870=20=E8=BF=9C=E7=A8=8B=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E9=97=AE=E9=A2=98=E4=BB=A5=E5=8F=8A=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/EnvChangeEntrance.java | 1 + .../java/com/fr/design/mainframe/JTemplate.java | 2 +- .../mainframe/socketio/DesignerSocketIO.java | 6 +++++- .../com/fr/start/module/DesignerStartup.java | 8 ++++---- .../fr/start/module/WorkspaceEventPriority.java | 16 ---------------- 5 files changed, 11 insertions(+), 22 deletions(-) delete mode 100644 designer-realize/src/main/java/com/fr/start/module/WorkspaceEventPriority.java diff --git a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java index 38a2629166..110b97563c 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -224,6 +224,7 @@ public class EnvChangeEntrance { @Override public void doCancel() { envListDialog.dispose(); + // todo 断开了但是没选择新的环境,那么尝试重连旧环境,等接口 } }); envListDialog.setVisible(true); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index 3e7b952869..8525023799 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -610,7 +610,7 @@ public abstract class JTemplate> } else { JOptionPane.showMessageDialog( DesignerContext.getDesignerFrame(), - Toolkit.i18nText("Fine-Design_Basic_Template_Status_Locked"), + Toolkit.i18nText("Fine-Design-Basic_Save_Failure"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Message"), JOptionPane.WARNING_MESSAGE); return false; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java index bcf7450e17..dac28a627a 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java @@ -82,6 +82,10 @@ public class DesignerSocketIO { socketIO.get().on(Socket.EVENT_DISCONNECT, new Emitter.Listener() { @Override public void call(Object... objects) { + /* + * todo 远程心跳断开不一定 socketio 断开 和远程紧密相关的业务都绑定在心跳上,切换成心跳断开之后进行提醒, + * socketio 只用推日志和通知配置变更 + */ if (status != Status.Disconnecting) { try { SwingUtilities.invokeAndWait(new Runnable() { @@ -114,7 +118,7 @@ public class DesignerSocketIO { Integer[] ports = WorkContext.getCurrent().get(SocketInfoOperator.class).getPort(); WorkspaceConnection connection = WorkContext.getCurrent().getConnection(); String[] result = new String[ports.length]; - for (int i = 0; i < ports.length; i++ ) { + for (int i = 0; i < ports.length; i++) { result[i] = String.format("%s://%s:%s%s?%s=%s&%s=%s", url.getProtocol(), url.getHost(), diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java b/designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java index 25fdeb77d5..4a3db7b2cc 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java @@ -83,7 +83,7 @@ public class DesignerStartup extends Activator { private void registerEnvListener() { /*切换环境前,关闭所有相关模块,最后执行*/ - listenEvent(WorkspaceEvent.BeforeSwitch, new Listener(WorkspaceEventPriority.MIN) { + listenEvent(WorkspaceEvent.BeforeSwitch, new Listener(Integer.MIN_VALUE) { @Override public void on(Event event, Workspace current) { @@ -91,7 +91,7 @@ public class DesignerStartup extends Activator { } }); /*切换环境后,重新启动所有相关模块,最先执行*/ - listenEvent(WorkspaceEvent.AfterSwitch, new Listener(WorkspaceEventPriority.MAX) { + listenEvent(WorkspaceEvent.AfterSwitch, new Listener(Integer.MAX_VALUE) { @Override public void on(Event event, Workspace current) { @@ -110,7 +110,7 @@ public class DesignerStartup extends Activator { } }); /*切换环境前,存储一下打开的所有文件对象,要先于 关闭相关模块部分 被触发*/ - listenEvent(WorkspaceEvent.BeforeSwitch, new Listener(WorkspaceEventPriority.MAX) { + listenEvent(WorkspaceEvent.BeforeSwitch, new Listener(Integer.MAX_VALUE) { @Override public void on(Event event, Workspace workspace) { HistoryTemplateListCache.getInstance().stash(); @@ -118,7 +118,7 @@ public class DesignerStartup extends Activator { }); /*切换环境后,装载一下打开的所有文件对象,优先级低于默认优先级,要后于 启动相关模块部分 被触发*/ - listenEvent(WorkspaceEvent.AfterSwitch, new Listener(WorkspaceEventPriority.MIN) { + listenEvent(WorkspaceEvent.AfterSwitch, new Listener(Integer.MIN_VALUE) { @Override public void on(Event event, Workspace workspace) { HistoryTemplateListCache.getInstance().load(); diff --git a/designer-realize/src/main/java/com/fr/start/module/WorkspaceEventPriority.java b/designer-realize/src/main/java/com/fr/start/module/WorkspaceEventPriority.java deleted file mode 100644 index a0473f610f..0000000000 --- a/designer-realize/src/main/java/com/fr/start/module/WorkspaceEventPriority.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.fr.start.module; - -/** - * 切换环境事件优先级暂时方案 - * todo 看是不是需要使用另外的类型处理优先级 - */ -public final class WorkspaceEventPriority { - - private WorkspaceEventPriority() { - } - - public static final int MAX = 999; - public static final int MID = 0; - public static final int MIN = -999; - -}