Browse Source

修改数据查询数据集可以随意选取其他类型的数据连接的BUG

master
finereport 7 years ago
parent
commit
b20500ac93
  1. 13
      designer_base/src/com/fr/design/data/datapane/connect/ConnectionTableProcedurePane.java
  2. 13
      designer_base/src/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java

13
designer_base/src/com/fr/design/data/datapane/connect/ConnectionTableProcedurePane.java

@ -1,6 +1,8 @@
package com.fr.design.data.datapane.connect;
import com.fr.base.BaseUtils;
import com.fr.data.impl.AbstractDatabaseConnection;
import com.fr.data.impl.Connection;
import com.fr.design.constants.UIConstants;
import com.fr.data.core.db.TableProcedure;
import com.fr.design.border.UIRoundedBorder;
@ -20,6 +22,7 @@ import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import java.awt.*;
import java.awt.event.*;
import java.util.List;
/**
* 数据集编辑面板左边的部分
@ -39,6 +42,12 @@ public class ConnectionTableProcedurePane extends BasicPane {
public ConnectionTableProcedurePane() {
this.setLayout(new BorderLayout(4, 4));
connectionComboBox = new ConnectionComboBoxPanel(com.fr.data.impl.Connection.class) {
@Override
protected void filterConnection(Connection connection, String conName, List<String> nameList) {
filter(connection, conName, nameList);
}
protected void refreshItems() {
super.refreshItems();
if (tableViewList != null) {
@ -83,6 +92,10 @@ public class ConnectionTableProcedurePane extends BasicPane {
this.setPreferredSize(new Dimension(WIDTH, getPreferredSize().height));
}
protected void filter(Connection connection, String conName, List<String> nameList) {
connection.addConnection(nameList, conName, new Class[]{AbstractDatabaseConnection.class});
}
protected JPanel createCheckBoxgroupPane() {
JPanel checkBoxgroupPane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(2);
JPanel first = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();

13
designer_base/src/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java

@ -5,7 +5,11 @@ import com.fr.base.FRContext;
import com.fr.base.Parameter;
import com.fr.base.ParameterHelper;
import com.fr.data.core.db.TableProcedure;
import com.fr.data.impl.AbstractDatabaseConnection;
import com.fr.data.impl.Connection;
import com.fr.data.impl.DBTableData;
import com.fr.data.impl.JDBCDatabaseConnection;
import com.fr.data.impl.JNDIDatabaseConnection;
import com.fr.data.impl.NameDatabaseConnection;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.UpdateAction;
@ -37,6 +41,7 @@ import com.fr.script.Calculator;
import com.fr.stable.ArrayUtils;
import com.fr.stable.ParameterProvider;
import com.fr.stable.StringUtils;
import org.sqlite.JDBC;
import javax.swing.*;
import javax.swing.text.BadLocationException;
@ -102,7 +107,12 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
sqlSplitPane.add(box, BorderLayout.CENTER);
// 左边的Panel,上面是选择DatabaseConnection的ComboBox,下面DatabaseConnection对应的Table
connectionTableProcedurePane = new ConnectionTableProcedurePane();
connectionTableProcedurePane = new ConnectionTableProcedurePane() {
@Override
protected void filter(Connection connection, String conName, List<String> nameList) {
connection.addConnection(nameList, conName, new Class[]{JDBCDatabaseConnection.class, JNDIDatabaseConnection.class});
}
};
connectionTableProcedurePane.addDoubleClickListener(new DoubleClickSelectedNodeOnTreeListener() {
@Override
@ -138,6 +148,7 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
this.add(mainSplitPane, BorderLayout.CENTER);
}
private boolean isPreviewOrRefreshButton (FocusEvent e) {
if (e.getOppositeComponent() != null) {
String name = e.getOppositeComponent().getName();

Loading…
Cancel
Save