Browse Source

bug fix

master
XiaXiang 8 years ago
parent
commit
a876212e28
  1. 11
      designer_base/src/com/fr/design/actions/server/ConnectionListAction.java
  2. 24
      designer_base/src/com/fr/design/data/datapane/connect/JDBCDefPane.java

11
designer_base/src/com/fr/design/actions/server/ConnectionListAction.java

@ -9,7 +9,6 @@ import com.fr.design.actions.UpdateAction;
import com.fr.design.data.datapane.connect.ConnectionManagerPane; import com.fr.design.data.datapane.connect.ConnectionManagerPane;
import com.fr.design.data.datapane.connect.ConnectionShowPane; import com.fr.design.data.datapane.connect.ConnectionShowPane;
import com.fr.design.data.datapane.connect.DatabaseConnectionPane; import com.fr.design.data.datapane.connect.DatabaseConnectionPane;
import com.fr.design.data.datapane.connect.JDBCDefPane;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
@ -34,15 +33,7 @@ public class ConnectionListAction extends UpdateAction {
this.setName(getMenuKeySet().getMenuKeySetName()); this.setName(getMenuKeySet().getMenuKeySetName());
this.setMnemonic(getMenuKeySet().getMnemonic()); this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/m_web/connection.png")); this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/m_web/connection.png"));
this.setSearchText(getContainer()); this.setSearchText(new DatabaseConnectionPane.JDBC());
}
private JPanel getContainer() {
JPanel panel = new JPanel();
panel.add(new DatabaseConnectionPane.JDBC());
panel.add(new DatabaseConnectionPane.JNDI());
panel.add(new JDBCDefPane().getAllComponents());
return panel;
} }
public static final MenuKeySet DEFINE_DATA_CONNECTION = new MenuKeySet() { public static final MenuKeySet DEFINE_DATA_CONNECTION = new MenuKeySet() {

24
designer_base/src/com/fr/design/data/datapane/connect/JDBCDefPane.java

@ -1,21 +1,21 @@
package com.fr.design.data.datapane.connect; package com.fr.design.data.datapane.connect;
import com.fr.design.constants.UIConstants;
import com.fr.data.impl.JDBCDatabaseConnection; import com.fr.data.impl.JDBCDatabaseConnection;
import com.fr.data.pool.DBCPConnectionPoolAttr; import com.fr.data.pool.DBCPConnectionPoolAttr;
import com.fr.design.border.UITitledBorder; import com.fr.design.border.UITitledBorder;
import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.editor.editor.IntegerEditor;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.ActionLabel;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ipasswordfield.UIPassWordField; import com.fr.design.gui.ipasswordfield.UIPassWordField;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.gui.ilable.ActionLabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.dialog.BasicPane;
import com.fr.design.editor.editor.IntegerEditor;
import com.fr.file.filter.ChooseFileFilter; import com.fr.file.filter.ChooseFileFilter;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
@ -34,7 +34,7 @@ import java.util.Map.Entry;
public class JDBCDefPane extends JPanel { public class JDBCDefPane extends JPanel {
public static final String DRIVER_TYPE = "driver_type"; public static final String DRIVER_TYPE = "driver_type";
public static final String USER_NAME = "user_name"; public static final String USER_NAME = "user_name";
public static final int TIME_MULTIPLE = 1000; public static final int TIME_MULTIPLE = 1000;
private static Map<String, DriverURLName[]> jdbcMap = new HashMap<String, DriverURLName[]>(); private static Map<String, DriverURLName[]> jdbcMap = new HashMap<String, DriverURLName[]>();
@ -43,7 +43,7 @@ public class JDBCDefPane extends JPanel {
new DriverURLName("org.hsqldb.jdbcDriver", "jdbc:hsqldb:file:[PATH_TO_DB_FILES]"), new DriverURLName("com.inet.tds.TdsDriver", "jdbc:inetdae7:localhost:1433/"), new DriverURLName("org.hsqldb.jdbcDriver", "jdbc:hsqldb:file:[PATH_TO_DB_FILES]"), new DriverURLName("com.inet.tds.TdsDriver", "jdbc:inetdae7:localhost:1433/"),
new DriverURLName("COM.cloudscape.JDBCDriver", "jdbc:cloudscape:/cloudscape/"), new DriverURLName("COM.cloudscape.JDBCDriver", "jdbc:cloudscape:/cloudscape/"),
new DriverURLName("com.internetcds.jdbc.tds.Driver", "jdbc:freetds:sqlserver://localhost/")}); new DriverURLName("com.internetcds.jdbc.tds.Driver", "jdbc:freetds:sqlserver://localhost/")});
jdbcMap.put("Inceptor",new DriverURLName[]{new DriverURLName("org.apache.hive.jdbc.HiveDriver","jdbc:inceptor2://localhost:10000/default"), jdbcMap.put("Inceptor",new DriverURLName[]{new DriverURLName("org.apache.hive.jdbc.HiveDriver","jdbc:inceptor2://localhost:10000/default"),
new DriverURLName("org.apache.hadoop.hive.jdbc.HiveDriver","jdbc:inceptor://localhost:10000/default")}); new DriverURLName("org.apache.hadoop.hive.jdbc.HiveDriver","jdbc:inceptor://localhost:10000/default")});
jdbcMap.put("Oracle", new DriverURLName[]{new DriverURLName("oracle.jdbc.driver.OracleDriver", "jdbc:oracle:thin:@localhost:1521:databaseName")}); jdbcMap.put("Oracle", new DriverURLName[]{new DriverURLName("oracle.jdbc.driver.OracleDriver", "jdbc:oracle:thin:@localhost:1521:databaseName")});
jdbcMap.put("DB2", new DriverURLName[]{new DriverURLName("com.ibm.db2.jcc.DB2Driver", "jdbc:db2://localhost:50000/")}); jdbcMap.put("DB2", new DriverURLName[]{new DriverURLName("com.ibm.db2.jcc.DB2Driver", "jdbc:db2://localhost:50000/")});
@ -158,15 +158,6 @@ public class JDBCDefPane extends JPanel {
}); });
} }
/**
* 获取全部组件
* @return
*/
public JPanel getAllComponents() {
this.add(new DBCPAttrPane());
return this;
}
public void populate(JDBCDatabaseConnection jdbcDatabase) { public void populate(JDBCDatabaseConnection jdbcDatabase) {
if (jdbcDatabase == null) { if (jdbcDatabase == null) {
jdbcDatabase = new JDBCDatabaseConnection(); jdbcDatabase = new JDBCDatabaseConnection();
@ -324,7 +315,7 @@ public class JDBCDefPane extends JPanel {
return new DBCPAttrPane().showWindow(SwingUtilities.getWindowAncestor(JDBCDefPane.this)); return new DBCPAttrPane().showWindow(SwingUtilities.getWindowAncestor(JDBCDefPane.this));
} }
public class DBCPAttrPane extends BasicPane { class DBCPAttrPane extends BasicPane {
public DBCPAttrPane() { public DBCPAttrPane() {
JPanel defaultPane = this; JPanel defaultPane = this;
@ -383,5 +374,4 @@ public class JDBCDefPane extends JPanel {
private String driver; private String driver;
private String url; private String url;
} }
} }
Loading…
Cancel
Save