Browse Source

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

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

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

Loading…
Cancel
Save