Browse Source

Pull request #1753: REPORT-33575 远程连接启用https的环境,服务器关掉之后没有跳出切换工作目录的弹窗 && REPORT-33454 切换远程目录成功,弹窗提示切换失败

Merge in DESIGN/design from ~HADES/design:release/10.0 to release/10.0

* commit '01ba3bf406c16027f3da12d8c642937b73fff53e':
  REPORT-33575 改下方法名称
  REPORT-33575 远程连接启用https的环境,服务器关掉之后没有跳出切换工作目录的弹窗 && REPORT-33454 切换远程目录成功,弹窗提示切换失败
feature/big-screen
Hades 5 years ago
parent
commit
1611d83cd6
  1. 54
      designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java
  2. 3
      designer-realize/src/main/java/com/fr/design/widget/CellWidgetCardPane.java

54
designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java

@ -2,13 +2,16 @@ package com.fr.design.mainframe.socketio;
import com.fr.config.RemoteConfigEvent;
import com.fr.decision.webservice.utils.DecisionServiceConstants;
import com.fr.design.DesignerEnvManager;
import com.fr.design.EnvChangeEntrance;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.loghandler.DesignerLogger;
import com.fr.design.ui.util.UIUtil;
import com.fr.event.Event;
import com.fr.event.EventDispatcher;
import com.fr.event.Listener;
import com.fr.log.FineLoggerFactory;
import com.fr.report.RemoteDesignConstants;
import com.fr.serialization.SerializerHelper;
@ -16,6 +19,7 @@ import com.fr.stable.ArrayUtils;
import com.fr.third.apache.log4j.spi.LoggingEvent;
import com.fr.workspace.WorkContext;
import com.fr.workspace.Workspace;
import com.fr.workspace.WorkspaceEvent;
import com.fr.workspace.base.WorkspaceConstants;
import com.fr.workspace.connect.WorkspaceConnection;
import com.fr.workspace.server.socket.SocketInfoOperator;
@ -30,6 +34,20 @@ import java.net.URL;
public class DesignerSocketIO {
static {
EventDispatcher.listen(WorkspaceEvent.LostConnect, new Listener<Workspace>() {
@Override
public void on(Event event, Workspace param) {
// 远程设计websocket不支持wss 所以断开无法提醒
// 使用远程设计的心跳断开来提醒断开
if (DesignerEnvManager.getEnvManager().isHttps()) {
showConnectionLostDialog();
}
}
});
}
enum Status {
Connected,
Disconnected,
@ -143,27 +161,31 @@ public class DesignerSocketIO {
* socket 只用推日志和通知配置变更
*/
if (status != Status.Disconnecting) {
try {
UIUtil.invokeAndWaitIfNeeded(new Runnable() {
@Override
public void run() {
FineJOptionPane.showMessageDialog(
DesignerContext.getDesignerFrame(),
Toolkit.i18nText("Fine-Design_Basic_Remote_Disconnected"),
UIManager.getString("OptionPane.messageDialogTitle"),
JOptionPane.ERROR_MESSAGE,
UIManager.getIcon("OptionPane.errorIcon"));
EnvChangeEntrance.getInstance().chooseEnv();
}
});
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
showConnectionLostDialog();
}
status = Status.Disconnected;
}
};
private static void showConnectionLostDialog() {
try {
UIUtil.invokeAndWaitIfNeeded(new Runnable() {
@Override
public void run() {
FineJOptionPane.showMessageDialog(
DesignerContext.getDesignerFrame(),
Toolkit.i18nText("Fine-Design_Basic_Remote_Disconnected"),
UIManager.getString("OptionPane.messageDialogTitle"),
JOptionPane.ERROR_MESSAGE,
UIManager.getIcon("OptionPane.errorIcon"));
EnvChangeEntrance.getInstance().chooseEnv();
}
});
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
//配置变更监听器
private static final Emitter.Listener modifyConfig = new Emitter.Listener() {
@Override

3
designer-realize/src/main/java/com/fr/design/widget/CellWidgetCardPane.java

@ -136,6 +136,9 @@ public class CellWidgetCardPane extends BasicPane {
//todo
}
});
if (rn == null) {
return;
}
DataModify<? extends Widget> definePane = rn.getDefinePane();
attriCardPane.add(definePane.toSwingComponent(), rn.getCardName());
attriCardLayout.show(attriCardPane, rn.getCardName());

Loading…
Cancel
Save