ju 7 years ago
parent
commit
2395ebd51f
  1. 8
      designer-base/src/com/fr/design/env/DesignerWorkspaceInfo.java
  2. 4
      designer-base/src/com/fr/design/env/RemoteWorkspace.java
  3. 2
      designer-base/src/com/fr/env/EnvListPane.java
  4. 187
      designer-base/src/com/fr/env/RemoteEnvPane.java
  5. 377
      designer-base/src/com/fr/env/RemoteEnvPane2.java

8
designer-base/src/com/fr/design/env/DesignerWorkspaceInfo.java vendored

@ -85,12 +85,11 @@ public class DesignerWorkspaceInfo implements XMLable {
if (reader.isChildNode()) {
String tagName = reader.getTagName();
if ("Connection".equals(tagName)) {
String ip = reader.getAttrAsString("ip", StringUtils.EMPTY);
int port = reader.getAttrAsInt("port", DEFAULT_RPC_PORT);
String url = reader.getAttrAsString("url", StringUtils.EMPTY);
String username = reader.getAttrAsString("username", StringUtils.EMPTY);
//密码解密
String password = SecurityToolbox.decrypt(reader.getAttrAsString("password", StringUtils.EMPTY));
this.connection = new WorkspaceConnection(ip, port, username, password);
this.connection = new WorkspaceConnection(url, username, password);
}
}
}
@ -103,8 +102,7 @@ public class DesignerWorkspaceInfo implements XMLable {
writer.attr("type", type.toString());
if (this.connection != null) {
writer.startTAG("Connection");
writer.attr("ip", connection.getIp());
writer.attr("port", connection.getPort());
writer.attr("url", connection.getUrl());
writer.attr("username", connection.getUserName());
writer.attr("password", SecurityToolbox.encrypt(connection.getPassword()));
writer.end();

4
designer-base/src/com/fr/design/env/RemoteWorkspace.java vendored

@ -5,7 +5,7 @@ import com.fr.report.util.RemoteDesignAuthenticateUtils;
import com.fr.workspace.Workspace;
import com.fr.workspace.connect.WorkspaceClient;
import com.fr.workspace.connect.WorkspaceConnection;
import com.fr.workspace.engine.WorkspaceServerContext;
import com.fr.workspace.server.WorkspaceServerContext;
/**
* Created by juhaoyu on 2018/6/14.
@ -22,7 +22,7 @@ public class RemoteWorkspace implements Workspace {
RemoteWorkspace(WorkspaceClient client, WorkspaceConnection connection) {
this.client = client;
this.address = connection.getIp() + ":" + connection.getPort();
this.address = connection.getUrl();
this.userName = connection.getUserName();
}

2
designer-base/src/com/fr/env/EnvListPane.java vendored

@ -59,7 +59,7 @@ public class EnvListPane extends JListControlPane {
NameableCreator local = new NameObjectCreator(Inter.getLocText("Env-Local_Directory"), "com/fr/design/images/data/bind/localconnect.png",
DesignerWorkspaceInfo.class, LocalEnvPane.class);
NameableCreator remote = new NameObjectCreator(Inter.getLocText("Env-Remote_Server"), "com/fr/design/images/data/bind/distanceconnect.png",
DesignerWorkspaceInfo.class, RemoteEnvPane2.class);
DesignerWorkspaceInfo.class, RemoteEnvPane.class);
return new NameableCreator[]{local, remote};
}

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

@ -1,11 +1,10 @@
package com.fr.env;
import com.fr.base.FRContext;
import com.fr.design.DesignerEnvManager;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.border.UITitledBorder;
import com.fr.design.dialog.InformationWarnPane;
import com.fr.design.env.DesignerWorkspaceInfo;
import com.fr.design.env.DesignerWorkspaceType;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
@ -14,25 +13,45 @@ import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.scrollruler.ModLineBorder;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.stable.ProductConstants;
import com.fr.stable.StringUtils;
import javax.swing.*;
import com.fr.third.guava.base.Strings;
import com.fr.workspace.WorkContext;
import com.fr.workspace.connect.WorkspaceConnection;
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.JDialog;
import javax.swing.JFileChooser;
import javax.swing.JPanel;
import javax.swing.JTextPane;
import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
import javax.swing.SwingWorker;
import javax.swing.ToolTipManager;
import javax.swing.UIManager;
import javax.swing.border.EmptyBorder;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import java.awt.*;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dialog;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.File;
import static com.fr.design.layout.TableLayout.FILL;
import static com.fr.design.layout.TableLayout.PREFERRED;
import static com.fr.third.guava.base.Optional.fromNullable;
/**
* @author yaohwu
@ -41,6 +60,11 @@ public class RemoteEnvPane extends BasicBeanPane<DesignerWorkspaceInfo> {
private static final Color TIPS_FONT_COLOR = new Color(0x8f8f92);
private JDialog dialog;
private UILabel message;
private UIButton okButton;
private UIButton cancelButton;
/**
* 是否启用 https 勾选框
*/
@ -180,7 +204,7 @@ public class RemoteEnvPane extends BasicBeanPane<DesignerWorkspaceInfo> {
// 服务器地址地址
JPanel configPanel = new JPanel(new BorderLayout());
final JPanel configPanel = new JPanel(new BorderLayout());
configPanel.setBorder(
BorderFactory.createCompoundBorder(
new EmptyBorder(15, 0, 0, 0),
@ -222,9 +246,7 @@ public class RemoteEnvPane extends BasicBeanPane<DesignerWorkspaceInfo> {
testConnectionButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent ev) {
if (testConnection()) {
JOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(RemoteEnvPane.this), Inter.getLocText("Datasource-Connection_successfully"));
}
tryConnectRemoteEnv();
}
});
testPanel.add(testConnectionButton);
@ -240,35 +262,33 @@ public class RemoteEnvPane extends BasicBeanPane<DesignerWorkspaceInfo> {
@Override
public void populateBean(DesignerWorkspaceInfo ob) {
if (StringUtils.isEmpty(ob.getPath())) {
remoteEnvURL = RemoteEnvURL.createDefaultURL();
} else {
remoteEnvURL = new RemoteEnvURL(ob.getPath());
}
WorkspaceConnection connection = ob.getConnection();
this.remoteEnvURL = Strings.isNullOrEmpty(connection.getUrl())
? RemoteEnvURL.createDefaultURL()
: new RemoteEnvURL(connection.getUrl());
fillRemoteEnvURLField();
fillIndividualField();
httpsCheckbox.setSelected(remoteEnvURL.getHttps());
httpsCheckbox.setSelected(this.remoteEnvURL.getHttps());
DesignerEnvManager.getEnvManager().setHttps(remoteEnvURL.getHttps());
fileChooserButton.setEnabled(remoteEnvURL.getHttps());
DesignerEnvManager.getEnvManager().setHttps(this.remoteEnvURL.getHttps());
fileChooserButton.setEnabled(this.remoteEnvURL.getHttps());
updateHttpsConfigPanel();
String username = ob.getConnection().getUserName();
String pwd = ob.getConnection().getPassword();
this.usernameInput.setText(username == null ? StringUtils.EMPTY : pwd);
this.passwordInput.setText(pwd == null ? StringUtils.EMPTY : pwd);
this.usernameInput.setText(fromNullable(connection.getUserName()).or(StringUtils.EMPTY));
this.passwordInput.setText(fromNullable(connection.getPassword()).or(StringUtils.EMPTY));
}
@Override
public DesignerWorkspaceInfo updateBean() {
String path = remoteEnvURL.getURL();
String user = this.usernameInput.getText();
String password = new String(this.passwordInput.getPassword());
// return DesignerWorkspaceInfo.createRemote();
return null;
//return new RemoteEnvConfig(path, user, password);
WorkspaceConnection connection = new WorkspaceConnection(
this.remoteEnvURL.getURL(),
this.usernameInput.getText(),
new String(this.passwordInput.getPassword()));
DesignerWorkspaceInfo config = new DesignerWorkspaceInfo();
config.setConnection(connection);
config.setType(DesignerWorkspaceType.Remote);
return config;
}
@Override
@ -446,50 +466,77 @@ public class RemoteEnvPane extends BasicBeanPane<DesignerWorkspaceInfo> {
return inputPanel;
}
private void tryConnectRemoteEnv() {
final SwingWorker<Void, Void> worker = new SwingWorker<Void, Void>() {
private void setHttpsParas() {
System.setProperty("javax.net.ssl.trustStore", this.certPathInput.getText());
System.setProperty("javax.net.ssl.trustStorePassword", new String(this.certSecretKeyInput.getPassword()));
DesignerEnvManager manager = DesignerEnvManager.getEnvManager();
manager.setCertificatePath(this.certPathInput.getText());
manager.setCertificatePass(new String(this.certSecretKeyInput.getPassword()));
manager.setHttps(this.httpsCheckbox.isSelected());
}
@Override
protected Void doInBackground() throws Exception {
private boolean testConnection() {
String url = remoteEnvURL.getURL();
//RemoteEnv env = new RemoteEnv(url, usernameInput.getText(), new String(passwordInput.getPassword()));
boolean connect = false;
try {
if (StringUtils.isNotEmpty(url)) {
if (remoteEnvURL.getHttps()) {
setHttpsParas();
}
// connect = env.testConnectionWithOutRegisteServer(this);
final DesignerWorkspaceInfo remoteEnv = updateBean();
WorkContext.getConnector().testConnection(remoteEnv.getConnection());
return null;
}
} catch (Exception e) {
JOptionPane.showMessageDialog(
this,
Inter.getLocText("Datasource-Connection_failed"),
UIManager.getString("OptionPane.messageDialogTitle", this.getLocale()),
JOptionPane.ERROR_MESSAGE
);
FRContext.getLogger().error(e.getMessage(), e);
}
if (connect) {
try {
String remoteVersion = "";
if (StringUtils.isBlank(remoteVersion) || ComparatorUtils.compare(remoteVersion, ProductConstants.DESIGNER_VERSION) < 0) {
String info = Inter.getLocText("Server-version-tip") + "。";
String moreInfo = Inter.getLocText("Server-version-tip-moreInfo") + "。";
new InformationWarnPane(info, moreInfo, Inter.getLocText("Tooltips")).show();
return false;
@Override
protected void done() {
okButton.setEnabled(true);
try {
get();
message.setText(Inter.getLocText("Fine-Designer_Basic_Remote_Connect_Successful"));
} catch (Exception e) {
message.setText(Inter.getLocText("Fine-Designer_Basic_Remote_Connect_Failed"));
}
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
}
}
return connect;
};
worker.execute();
initMessageDialog();
okButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
dialog.dispose();
}
});
cancelButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
dialog.dispose();
worker.cancel(true);
}
});
dialog.addWindowListener(new WindowAdapter() {
public void windowClosed(WindowEvent e) {
worker.cancel(true);
}
});
dialog.setVisible(true);
dialog.dispose();
}
private void initMessageDialog() {
message.setText(Inter.getLocText("Fine-Designer_Basic_Remote_Env_Try") + "...");
message.setBorder(BorderFactory.createEmptyBorder(8, 5, 0, 0));
okButton.setEnabled(false);
dialog = new JDialog((Dialog) SwingUtilities.getWindowAncestor(RemoteEnvPane.this), Inter.getLocText("Datasource-Test_Connection"), true);
dialog.setSize(new Dimension(268, 118));
okButton.setEnabled(false);
JPanel jp = new JPanel();
JPanel upPane = new JPanel();
JPanel downPane = new JPanel();
UILabel uiLabel = new UILabel(UIManager.getIcon("OptionPane.informationIcon"));
upPane.setLayout(new FlowLayout(FlowLayout.LEFT, 10, 10));
upPane.add(uiLabel);
upPane.add(message);
downPane.setLayout(new FlowLayout(FlowLayout.CENTER, 6, 0));
downPane.add(okButton);
downPane.add(cancelButton);
jp.setLayout(new BoxLayout(jp, BoxLayout.Y_AXIS));
jp.add(upPane);
jp.add(downPane);
dialog.add(jp);
dialog.setResizable(false);
dialog.setLocationRelativeTo(SwingUtilities.getWindowAncestor(RemoteEnvPane.this));
}
/**

377
designer-base/src/com/fr/env/RemoteEnvPane2.java vendored

@ -1,192 +1,185 @@
package com.fr.env;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.border.UITitledBorder;
import com.fr.design.env.DesignerWorkspaceInfo;
import com.fr.design.env.DesignerWorkspaceType;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ipasswordfield.UIPassWordField;
import com.fr.design.gui.itextfield.UIIntNumberField;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.Inter;
import com.fr.workspace.WorkContext;
import com.fr.workspace.connect.WorkspaceConnection;
import javax.swing.*;
import javax.swing.border.EmptyBorder;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
/**
* 远程环境设置界面暂时命名为2待做完功能直接替代掉老的RemoteEnvPane
*/
public class RemoteEnvPane2 extends BasicBeanPane<DesignerWorkspaceInfo> {
private UITextField hostTextField;
private UIIntNumberField portTextField;
private UITextField usernameTextField;
private UIPassWordField passwordTextField;
private JDialog dialog;
private UILabel message;
private UIButton okButton;
private UIButton cancelButton;
public RemoteEnvPane2() {
initComponents();
}
private void initComponents() {
setLayout(new BorderLayout());
JPanel contentPanel = new JPanel(new BorderLayout());
add(contentPanel, BorderLayout.CENTER);
contentPanel.setBorder(
BorderFactory.createCompoundBorder(
new EmptyBorder(6, 0, 0, 0),
UITitledBorder.createBorderWithTitle(Inter.getLocText("Fine-Designer_Basic_Remote_Env_Config")))
);
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] rowSize = new double[]{p, p, p, p, p};
double[] columnSize = new double[]{p, f};
UIButton testConnectionButton = new UIButton(Inter.getLocText("Fine-Designer_Basic_Remote_Env_Try"));
hostTextField = new UITextField();
hostTextField.setPlaceholder("192.168.100.200");
portTextField = new UIIntNumberField();
portTextField.setPlaceholder("39999");
JPanel valuePane = TableLayoutHelper.createTableLayoutPane(
new Component[][]{
{new UILabel(Inter.getLocText("Fine-Designer_Basic_Remote_Env_Host") + ":", SwingConstants.RIGHT), hostTextField},
{new UILabel(Inter.getLocText("Fine-Designer_Basic_Remote_Env_Port") + ":", SwingConstants.RIGHT),portTextField},
{new UILabel(Inter.getLocText("Fine-Designer_Basic_Remote_Env_User") + ":", SwingConstants.RIGHT), usernameTextField = new UITextField()},
{new UILabel(Inter.getLocText("Fine-Designer_Basic_Remote_Env_Password") + ":", SwingConstants.RIGHT), passwordTextField = new UIPassWordField()},
{null, GUICoreUtils.createFlowPane(testConnectionButton, FlowLayout.LEFT)}
},
rowSize, columnSize
);
testConnectionButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
tryConnectRemoteEnv();
}
});
contentPanel.add(valuePane, BorderLayout.CENTER);
message = new UILabel();
okButton = new UIButton(Inter.getLocText("OK"));
cancelButton = new UIButton(Inter.getLocText("Cancel"));
}
private void tryConnectRemoteEnv() {
final SwingWorker<Void, Void> worker = new SwingWorker<Void, Void>() {
@Override
protected Void doInBackground() throws Exception {
final DesignerWorkspaceInfo remoteEnv = updateBean();
WorkContext.getConnector().testConnection(remoteEnv.getConnection());
return null;
}
@Override
protected void done() {
okButton.setEnabled(true);
try {
get();
message.setText(Inter.getLocText("Fine-Designer_Basic_Remote_Connect_Successful"));
} catch (Exception e) {
message.setText(Inter.getLocText("Fine-Designer_Basic_Remote_Connect_Failed"));
}
}
};
worker.execute();
initMessageDialog();
okButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
dialog.dispose();
}
});
cancelButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
dialog.dispose();
worker.cancel(true);
}
});
dialog.addWindowListener(new WindowAdapter() {
public void windowClosed(WindowEvent e) {
worker.cancel(true);
}
});
dialog.setVisible(true);
dialog.dispose();
}
private void initMessageDialog() {
message.setText(Inter.getLocText("Fine-Designer_Basic_Remote_Env_Try") + "...");
message.setBorder(BorderFactory.createEmptyBorder(8, 5, 0, 0));
okButton.setEnabled(false);
dialog = new JDialog((Dialog) SwingUtilities.getWindowAncestor(RemoteEnvPane2.this), Inter.getLocText("Datasource-Test_Connection"), true);
dialog.setSize(new Dimension(268, 118));
okButton.setEnabled(false);
JPanel jp = new JPanel();
JPanel upPane = new JPanel();
JPanel downPane = new JPanel();
UILabel uiLabel = new UILabel(UIManager.getIcon("OptionPane.informationIcon"));
upPane.setLayout(new FlowLayout(FlowLayout.LEFT, 10, 10));
upPane.add(uiLabel);
upPane.add(message);
downPane.setLayout(new FlowLayout(FlowLayout.CENTER, 6, 0));
downPane.add(okButton);
downPane.add(cancelButton);
jp.setLayout(new BoxLayout(jp, BoxLayout.Y_AXIS));
jp.add(upPane);
jp.add(downPane);
dialog.add(jp);
dialog.setResizable(false);
dialog.setLocationRelativeTo(SwingUtilities.getWindowAncestor(RemoteEnvPane2.this));
}
@Override
protected String title4PopupWindow() {
return "RemoteEnv";
}
@Override
public void populateBean(DesignerWorkspaceInfo config) {
if (config == null) {
return;
}
WorkspaceConnection connection = config.getConnection();
if (connection != null) {
hostTextField.setText(connection.getIp());
if (connection.getPort() != 0) {
portTextField.setValue(connection.getPort());
}
usernameTextField.setText(connection.getUserName());
passwordTextField.setText(connection.getPassword());
}
}
@Override
public DesignerWorkspaceInfo updateBean() {
DesignerWorkspaceInfo config = new DesignerWorkspaceInfo();
WorkspaceConnection connection = new WorkspaceConnection(hostTextField.getText(), (int) portTextField.getValue(), usernameTextField.getText(), passwordTextField.getText());
config.setConnection(connection);
config.setType(DesignerWorkspaceType.Remote);
return config;
}
}
//package com.fr.env;
//
//import com.fr.design.beans.BasicBeanPane;
//import com.fr.design.border.UITitledBorder;
//import com.fr.design.env.DesignerWorkspaceInfo;
//import com.fr.design.env.DesignerWorkspaceType;
//import com.fr.design.gui.ibutton.UIButton;
//import com.fr.design.gui.ilable.UILabel;
//import com.fr.design.gui.ipasswordfield.UIPassWordField;
//import com.fr.design.gui.itextfield.UIIntNumberField;
//import com.fr.design.gui.itextfield.UITextField;
//import com.fr.design.layout.TableLayout;
//import com.fr.design.layout.TableLayoutHelper;
//import com.fr.design.utils.gui.GUICoreUtils;
//import com.fr.general.Inter;
//import com.fr.workspace.WorkContext;
//import com.fr.workspace.connect.WorkspaceConnection;
//
//import javax.swing.*;
//import javax.swing.border.EmptyBorder;
//import java.awt.*;
//import java.awt.event.ActionEvent;
//import java.awt.event.ActionListener;
//import java.awt.event.WindowAdapter;
//import java.awt.event.WindowEvent;
//
///**
// * 远程环境设置界面,暂时命名为2,待做完功能直接替代掉老的RemoteEnvPane
// */
//public class RemoteEnvPane2 extends BasicBeanPane<DesignerWorkspaceInfo> {
//
// private UITextField urlTextField;
// private UITextField usernameTextField;
// private UIPassWordField passwordTextField;
// private JDialog dialog;
// private UILabel message;
// private UIButton okButton;
// private UIButton cancelButton;
//
// public RemoteEnvPane2() {
// initComponents();
// }
//
// private void initComponents() {
// setLayout(new BorderLayout());
//
// JPanel contentPanel = new JPanel(new BorderLayout());
// add(contentPanel, BorderLayout.CENTER);
//
// contentPanel.setBorder(
// BorderFactory.createCompoundBorder(
// new EmptyBorder(6, 0, 0, 0),
// UITitledBorder.createBorderWithTitle(Inter.getLocText("Fine-Designer_Basic_Remote_Env_Config")))
// );
//
// double p = TableLayout.PREFERRED;
// double f = TableLayout.FILL;
// double[] rowSize = new double[]{p, p, p, p};
// double[] columnSize = new double[]{p, f};
// UIButton testConnectionButton = new UIButton(Inter.getLocText("Fine-Designer_Basic_Remote_Env_Try"));
// urlTextField = new UITextField();
// urlTextField.setPlaceholder("http://192.168.100.200/webroot/decision");
// JPanel valuePane = TableLayoutHelper.createTableLayoutPane(
// new Component[][]{
// {new UILabel(Inter.getLocText("Fine-Designer_Basic_Remote_Env_Host") + ":", SwingConstants.RIGHT), urlTextField},
// {new UILabel(Inter.getLocText("Fine-Designer_Basic_Remote_Env_User") + ":", SwingConstants.RIGHT), usernameTextField = new UITextField()},
// {new UILabel(Inter.getLocText("Fine-Designer_Basic_Remote_Env_Password") + ":", SwingConstants.RIGHT), passwordTextField = new UIPassWordField()},
// {null, GUICoreUtils.createFlowPane(testConnectionButton, FlowLayout.LEFT)}
// },
// rowSize, columnSize
// );
// testConnectionButton.addActionListener(new ActionListener() {
// @Override
// public void actionPerformed(ActionEvent e) {
// tryConnectRemoteEnv();
// }
// });
// contentPanel.add(valuePane, BorderLayout.CENTER);
//
// message = new UILabel();
// okButton = new UIButton(Inter.getLocText("OK"));
// cancelButton = new UIButton(Inter.getLocText("Cancel"));
// }
//
// private void tryConnectRemoteEnv() {
// final SwingWorker<Void, Void> worker = new SwingWorker<Void, Void>() {
//
// @Override
// protected Void doInBackground() throws Exception {
//
// final DesignerWorkspaceInfo remoteEnv = updateBean();
// WorkContext.getConnector().testConnection(remoteEnv.getConnection());
// return null;
// }
//
// @Override
// protected void done() {
// okButton.setEnabled(true);
// try {
// get();
// message.setText(Inter.getLocText("Fine-Designer_Basic_Remote_Connect_Successful"));
// } catch (Exception e) {
// message.setText(Inter.getLocText("Fine-Designer_Basic_Remote_Connect_Failed"));
// }
// }
// };
// worker.execute();
// initMessageDialog();
// okButton.addActionListener(new ActionListener() {
// public void actionPerformed(ActionEvent e) {
// dialog.dispose();
// }
// });
// cancelButton.addActionListener(new ActionListener() {
// public void actionPerformed(ActionEvent e) {
// dialog.dispose();
// worker.cancel(true);
// }
// });
//
// dialog.addWindowListener(new WindowAdapter() {
// public void windowClosed(WindowEvent e) {
// worker.cancel(true);
// }
// });
//
// dialog.setVisible(true);
// dialog.dispose();
// }
//
// private void initMessageDialog() {
// message.setText(Inter.getLocText("Fine-Designer_Basic_Remote_Env_Try") + "...");
// message.setBorder(BorderFactory.createEmptyBorder(8, 5, 0, 0));
// okButton.setEnabled(false);
//
// dialog = new JDialog((Dialog) SwingUtilities.getWindowAncestor(RemoteEnvPane2.this), Inter.getLocText("Datasource-Test_Connection"), true);
//
// dialog.setSize(new Dimension(268, 118));
// okButton.setEnabled(false);
// JPanel jp = new JPanel();
// JPanel upPane = new JPanel();
// JPanel downPane = new JPanel();
// UILabel uiLabel = new UILabel(UIManager.getIcon("OptionPane.informationIcon"));
// upPane.setLayout(new FlowLayout(FlowLayout.LEFT, 10, 10));
// upPane.add(uiLabel);
// upPane.add(message);
// downPane.setLayout(new FlowLayout(FlowLayout.CENTER, 6, 0));
// downPane.add(okButton);
// downPane.add(cancelButton);
// jp.setLayout(new BoxLayout(jp, BoxLayout.Y_AXIS));
// jp.add(upPane);
// jp.add(downPane);
// dialog.add(jp);
// dialog.setResizable(false);
// dialog.setLocationRelativeTo(SwingUtilities.getWindowAncestor(RemoteEnvPane2.this));
// }
//
// @Override
// protected String title4PopupWindow() {
// return "RemoteEnv";
// }
//
// @Override
// public void populateBean(DesignerWorkspaceInfo config) {
// if (config == null) {
// return;
// }
// WorkspaceConnection connection = config.getConnection();
// if (connection != null) {
// urlTextField.setText(connection.getUrl());
// usernameTextField.setText(connection.getUserName());
// passwordTextField.setText(connection.getPassword());
// }
// }
//
// @Override
// public DesignerWorkspaceInfo updateBean() {
//
// DesignerWorkspaceInfo config = new DesignerWorkspaceInfo();
// WorkspaceConnection connection = new WorkspaceConnection(urlTextField.getText(), usernameTextField.getText(), passwordTextField.getText());
// config.setConnection(connection);
// config.setType(DesignerWorkspaceType.Remote);
// return config;
// }
//}

Loading…
Cancel
Save