Browse Source

REPORT-44581 远程连接断开后mac选不到对话框只能重启

【问题原因】"文件保存"界面是一个顶层窗口,客户在进行保存操作的时候,远程服务器突然断开,会触发"连接失败"的提示弹窗,提示弹窗会被"文件保存"界面给覆盖掉,表现为选不到提示弹窗
【改动思路】判断当前父窗口是否为"文件保存"弹窗,如果是的话就作为"连接失败"弹窗的父窗口,而因为确认了提示失败之后会跳出"配置工作目录"界面,仍然会被"文件保存"界面覆盖,所以在"配置工作目录"界面EnvChangeEntrance中增加相应的可以传入父窗口的接口,将"文件保存"传入作为父窗口,这样两个界面都不会被"文件保存"界面覆盖
bugfix/10.0
Yvan 4 years ago
parent
commit
972e7f8cd6
  1. 8
      designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java
  2. 8
      designer-base/src/main/java/com/fr/file/FILEChooserPane.java
  3. 15
      designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java

8
designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java

@ -51,6 +51,7 @@ import com.fr.workspace.engine.rpc.WorkspaceProxyPool;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import javax.swing.UIManager; import javax.swing.UIManager;
import java.awt.Window;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
@ -411,8 +412,12 @@ public class EnvChangeEntrance {
} }
public void chooseEnv(final String envName) { public void chooseEnv(final String envName) {
chooseEnv(envName, SwingUtilities.getWindowAncestor(DesignerContext.getDesignerFrame()));
}
public void chooseEnv(final String envName, Window window) {
final EnvListPane envListPane = new EnvListPane(); final EnvListPane envListPane = new EnvListPane();
final BasicDialog envListDialog = envListPane.showWindow(SwingUtilities.getWindowAncestor(DesignerContext.getDesignerFrame())); final BasicDialog envListDialog = envListPane.showWindow(window);
envListPane.populateEnvManager(envName); envListPane.populateEnvManager(envName);
envListDialog.addDialogActionListener(new DialogActionAdapter() { envListDialog.addDialogActionListener(new DialogActionAdapter() {
@ -430,7 +435,6 @@ public class EnvChangeEntrance {
// todo 断开了但是没选择新的环境,那么尝试重连旧环境,等接口 // todo 断开了但是没选择新的环境,那么尝试重连旧环境,等接口
} }
}); });
envListDialog.setAlwaysOnTop(true);
envListDialog.setVisible(true); envListDialog.setVisible(true);
} }

8
designer-base/src/main/java/com/fr/file/FILEChooserPane.java

@ -1774,4 +1774,12 @@ public class FILEChooserPane extends BasicPane {
} }
} }
} }
public boolean isDialogVisible() {
return dialog != null && dialog.isVisible();
}
public UIDialog getDialog() {
return dialog;
}
} }

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

@ -12,6 +12,7 @@ import com.fr.design.ui.util.UIUtil;
import com.fr.event.Event; import com.fr.event.Event;
import com.fr.event.EventDispatcher; import com.fr.event.EventDispatcher;
import com.fr.event.Listener; import com.fr.event.Listener;
import com.fr.file.FILEChooserPane;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.report.RemoteDesignConstants; import com.fr.report.RemoteDesignConstants;
import com.fr.serialization.SerializerHelper; import com.fr.serialization.SerializerHelper;
@ -27,6 +28,7 @@ import io.socket.client.IO;
import io.socket.client.Socket; import io.socket.client.Socket;
import io.socket.emitter.Emitter; import io.socket.emitter.Emitter;
import java.awt.Window;
import java.util.Arrays; import java.util.Arrays;
import javax.swing.*; import javax.swing.*;
import java.io.IOException; import java.io.IOException;
@ -175,17 +177,18 @@ public class DesignerSocketIO {
UIUtil.invokeAndWaitIfNeeded(new Runnable() { UIUtil.invokeAndWaitIfNeeded(new Runnable() {
@Override @Override
public void run() { public void run() {
JDialog jDialog = new JDialog(); // 因为有可能在文件保存界面的时候,弹出连接失败弹窗,为了避免二级弹窗问题,这边对父窗口做个判断
jDialog.setAlwaysOnTop(true); boolean isFileChooserPaneExist = FILEChooserPane.getInstance().isDialogVisible();
jDialog.setVisible(false); Window window = isFileChooserPaneExist ? FILEChooserPane.getInstance().getDialog() : DesignerContext.getDesignerFrame();
FineJOptionPane.showMessageDialog( FineJOptionPane.showMessageDialog(
jDialog, window,
Toolkit.i18nText("Fine-Design_Basic_Remote_Disconnected"), Toolkit.i18nText("Fine-Design_Basic_Remote_Disconnected"),
UIManager.getString("OptionPane.messageDialogTitle"), UIManager.getString("OptionPane.messageDialogTitle"),
JOptionPane.ERROR_MESSAGE, JOptionPane.ERROR_MESSAGE,
UIManager.getIcon("OptionPane.errorIcon")); UIManager.getIcon("OptionPane.errorIcon"));
jDialog.dispose(); // 紧接着弹出的选择工作环境的窗口也判断一下父窗口,否则会被文件保存界面覆盖掉
EnvChangeEntrance.getInstance().chooseEnv(); Window window1 = isFileChooserPaneExist ? FILEChooserPane.getInstance().getDialog() : SwingUtilities.getWindowAncestor(DesignerContext.getDesignerFrame());
EnvChangeEntrance.getInstance().chooseEnv(DesignerEnvManager.getEnvManager().getCurEnvName(), window1);
} }
}); });
} catch (Exception e) { } catch (Exception e) {

Loading…
Cancel
Save