Browse Source

REPORT-9741【10.0二轮回归】设计器菜单栏-文件-切换至远程服务器

master
hzzz 6 years ago
parent
commit
2f417d813c
  1. 13
      designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java
  2. 10
      designer-base/src/main/java/com/fr/design/mainframe/TemplatePane.java

13
designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java

@ -22,7 +22,8 @@ import com.fr.workspace.WorkContextCallback;
import com.fr.workspace.Workspace;
import com.fr.workspace.connect.AuthException;
import javax.swing.*;
import javax.swing.JOptionPane;
import javax.swing.UIManager;
import java.awt.event.ActionEvent;
import java.util.HashMap;
import java.util.Iterator;
@ -108,9 +109,8 @@ public class SwitchExistEnv extends MenuDef {
try {
workspace = DesignerWorkspaceGenerator.generate(selectedEnv);
if (workspace == null) {
JOptionPane.showMessageDialog(
DesignerContext.getDesignerFrame(),
Inter.getLocText(new String[]{"FR-Designer_M-SwitchWorkspace", "Failed"}));
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText(new String[]{"FR-Designer_M-SwitchWorkspace", "Failed"}),
null, 0, UIManager.getIcon("OptionPane.errorIcon"));
return;
}
WorkContext.switchTo(workspace, new WorkContextCallback() {
@ -125,9 +125,8 @@ public class SwitchExistEnv extends MenuDef {
}
});
} catch (AuthException exception) {
JOptionPane.showMessageDialog(
DesignerContext.getDesignerFrame(),
Inter.getLocText(new String[]{"Fine-Designer_Basic_Remote_Connect_Auth_Failed"}));
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText(new String[]{"Fine-Designer_Basic_Remote_Connect_Auth_Failed", "Failed"}),
null, 0, UIManager.getIcon("OptionPane.errorIcon"));
}
}
}

10
designer-base/src/main/java/com/fr/design/mainframe/TemplatePane.java

@ -20,6 +20,7 @@ import com.fr.stable.EnvChangedListener;
import com.fr.workspace.WorkContext;
import com.fr.workspace.WorkContextCallback;
import com.fr.workspace.Workspace;
import com.fr.workspace.connect.AuthException;
import javax.swing.*;
import java.awt.*;
@ -135,9 +136,8 @@ public class TemplatePane extends JPanel implements MouseListener {
try {
Workspace workspace = DesignerWorkspaceGenerator.generate(selectedEnv);
if (workspace == null) {
JOptionPane.showMessageDialog(
DesignerContext.getDesignerFrame(),
Inter.getLocText(new String[]{"FR-Designer_M-SwitchWorkspace", "Failed"}));
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText(new String[]{"FR-Designer_M-SwitchWorkspace", "Failed"}),
null, 0, UIManager.getIcon("OptionPane.errorIcon"));
return false;
}
WorkContext.switchTo(workspace, new WorkContextCallback() {
@ -152,8 +152,8 @@ public class TemplatePane extends JPanel implements MouseListener {
template.refreshToolArea();
}
setJLabel(selectedName);
} catch (Exception e) {
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText(new String[]{"M-SwitchWorkspace", "Failed"}),
} catch (AuthException e) {
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText(new String[]{"Fine-Designer_Basic_Remote_Connect_Auth_Failed", "Failed"}),
null, 0, UIManager.getIcon("OptionPane.errorIcon"));
return false;
}

Loading…
Cancel
Save