Browse Source

REPORT-13870 远程设计问题以及环境切换问题

bugfix/10.0
yaoh.wu 6 years ago
parent
commit
b502d60786
  1. 1
      designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java
  2. 2
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  3. 6
      designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java
  4. 8
      designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java
  5. 16
      designer-realize/src/main/java/com/fr/start/module/WorkspaceEventPriority.java

1
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);

2
designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

@ -610,7 +610,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
} 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;

6
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(),

8
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<Workspace>(WorkspaceEventPriority.MIN) {
listenEvent(WorkspaceEvent.BeforeSwitch, new Listener<Workspace>(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<Workspace>(WorkspaceEventPriority.MAX) {
listenEvent(WorkspaceEvent.AfterSwitch, new Listener<Workspace>(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<Workspace>(WorkspaceEventPriority.MAX) {
listenEvent(WorkspaceEvent.BeforeSwitch, new Listener<Workspace>(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<Workspace>(WorkspaceEventPriority.MIN) {
listenEvent(WorkspaceEvent.AfterSwitch, new Listener<Workspace>(Integer.MIN_VALUE) {
@Override
public void on(Event event, Workspace workspace) {
HistoryTemplateListCache.getInstance().load();

16
designer-realize/src/main/java/com/fr/start/module/WorkspaceEventPriority.java

@ -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;
}
Loading…
Cancel
Save