Browse Source

REPORT-10263 远程设计权限验收问题1,2

research/10.0
yaoh.wu 6 years ago
parent
commit
eb99b89c1e
  1. 36
      designer-base/src/main/java/com/fr/env/RemoteEnvPane.java

36
designer-base/src/main/java/com/fr/env/RemoteEnvPane.java vendored

@ -1,5 +1,7 @@
package com.fr.env; package com.fr.env;
import com.fr.base.FRContext;
import com.fr.base.ServerConfig;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.border.UITitledBorder; import com.fr.design.border.UITitledBorder;
@ -12,7 +14,7 @@ import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.scrollruler.ModLineBorder; import com.fr.design.scrollruler.ModLineBorder;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.third.guava.base.Strings; import com.fr.third.guava.base.Strings;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
@ -193,6 +195,10 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
fillIndividualField(); fillIndividualField();
} }
}; };
/**
* 测试链接对话框确定取消按钮面板
*/
private JPanel dialogDownPane = new JPanel();
public RemoteEnvPane() { public RemoteEnvPane() {
@ -381,6 +387,16 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
new double[]{PREFERRED, PREFERRED, PREFERRED, PREFERRED}, new double[]{PREFERRED, PREFERRED, PREFERRED, PREFERRED},
new double[]{FILL} new double[]{FILL}
)); ));
setDefaultAppAndServlet();
}
/**
* 设置 app servlet 默认值
*/
private void setDefaultAppAndServlet() {
webAppNameInput.setText(FRContext.getCommonOperator().getAppName());
servletNameInput.setText(ServerConfig.getInstance().getServletName());
} }
@ -512,21 +528,28 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
} else { } else {
message.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Basic_Remote_Connect_Failed")); message.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Basic_Remote_Connect_Failed"));
uiLabel.setIcon(UIManager.getIcon("OptionPane.errorIcon")); uiLabel.setIcon(UIManager.getIcon("OptionPane.errorIcon"));
} }
} catch (InterruptedException | ExecutionException e) { } catch (InterruptedException | ExecutionException e) {
FineLoggerFactory.getLogger().error(e, e.getMessage());
message.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Basic_Remote_Connect_Failed")); message.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Basic_Remote_Connect_Failed"));
uiLabel.setIcon(UIManager.getIcon("OptionPane.errorIcon")); uiLabel.setIcon(UIManager.getIcon("OptionPane.errorIcon"));
} }
dialogDownPane.remove(cancelButton);
dialogDownPane.revalidate();
dialogDownPane.repaint();
} }
}; };
worker.execute(); worker.execute();
initMessageDialog(); initMessageDialog();
okButton.addActionListener(new ActionListener() { okButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
dialog.dispose(); dialog.dispose();
} }
}); });
cancelButton.addActionListener(new ActionListener() { cancelButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
dialog.dispose(); dialog.dispose();
worker.cancel(true); worker.cancel(true);
@ -534,6 +557,7 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
}); });
dialog.addWindowListener(new WindowAdapter() { dialog.addWindowListener(new WindowAdapter() {
@Override
public void windowClosed(WindowEvent e) { public void windowClosed(WindowEvent e) {
worker.cancel(true); worker.cancel(true);
} }
@ -554,17 +578,17 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
okButton.setEnabled(false); okButton.setEnabled(false);
JPanel jp = new JPanel(); JPanel jp = new JPanel();
JPanel upPane = new JPanel(); JPanel upPane = new JPanel();
JPanel downPane = new JPanel(); dialogDownPane = new JPanel();
uiLabel = new UILabel(UIManager.getIcon("OptionPane.informationIcon")); uiLabel = new UILabel(UIManager.getIcon("OptionPane.informationIcon"));
upPane.setLayout(new FlowLayout(FlowLayout.LEFT, 10, 10)); upPane.setLayout(new FlowLayout(FlowLayout.LEFT, 10, 10));
upPane.add(uiLabel); upPane.add(uiLabel);
upPane.add(message); upPane.add(message);
downPane.setLayout(new FlowLayout(FlowLayout.CENTER, 6, 0)); dialogDownPane.setLayout(new FlowLayout(FlowLayout.CENTER, 6, 0));
downPane.add(okButton); dialogDownPane.add(okButton);
downPane.add(cancelButton); dialogDownPane.add(cancelButton);
jp.setLayout(new BoxLayout(jp, BoxLayout.Y_AXIS)); jp.setLayout(new BoxLayout(jp, BoxLayout.Y_AXIS));
jp.add(upPane); jp.add(upPane);
jp.add(downPane); jp.add(dialogDownPane);
dialog.add(jp); dialog.add(jp);
dialog.setResizable(false); dialog.setResizable(false);
dialog.setLocationRelativeTo(SwingUtilities.getWindowAncestor(RemoteEnvPane.this)); dialog.setLocationRelativeTo(SwingUtilities.getWindowAncestor(RemoteEnvPane.this));

Loading…
Cancel
Save