Browse Source

sonarqube

master
hzzz 7 years ago
parent
commit
ef32c7aa0f
  1. 68
      designer_base/src/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java

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

@ -54,6 +54,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
public class DBTableDataPane extends AbstractTableDataPane<DBTableData> { public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
private static final int BOTTOM = 6;
private static final String PREVIEW_BUTTON = Inter.getLocText("FR-Designer_Preview"); private static final String PREVIEW_BUTTON = Inter.getLocText("FR-Designer_Preview");
private static final String REFRESH_BUTTON = Inter.getLocText("FR-Designer_Refresh"); private static final String REFRESH_BUTTON = Inter.getLocText("FR-Designer_Refresh");
private ConnectionTableProcedurePane connectionTableProcedurePane; private ConnectionTableProcedurePane connectionTableProcedurePane;
@ -66,29 +67,9 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
private String pageQuery = null; private String pageQuery = null;
private DBTableData dbTableData; private DBTableData dbTableData;
private void init() {
public DBTableDataPane() {
this.setLayout(new BorderLayout(4, 4));
Box box = new Box(BoxLayout.Y_AXIS);
sqlTextPane = new SQLEditPane(); sqlTextPane = new SQLEditPane();
sqlTextPane.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_SQL); sqlTextPane.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_SQL);
JPanel northPane = new JPanel(new BorderLayout(4, 4));
JToolBar editToolBar = createToolBar();
northPane.add(editToolBar, BorderLayout.CENTER);
northPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 6, 0));
RTextScrollPane sqlTextScrollPane = new RTextScrollPane(sqlTextPane);
sqlTextScrollPane.setLineNumbersEnabled(true);
sqlTextScrollPane.setBorder(new UIRoundedBorder(UIConstants.LINE_COLOR, 1, UIConstants.ARC));
sqlTextScrollPane.setPreferredSize(new Dimension(680, 600));
JPanel paraMeanPane = new JPanel(new BorderLayout());
paraMeanPane.setPreferredSize(new Dimension(680, 90));
UILabel paraMean = new UILabel(Inter.getLocText("FR-Designer-Datasource-Param_DES"));
paraMeanPane.add(paraMean, BorderLayout.CENTER);
ParameterTableModel model = new ParameterTableModel() { ParameterTableModel model = new ParameterTableModel() {
@Override @Override
@ -98,14 +79,6 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
}; };
editorPane = new UITableEditorPane<ParameterProvider>(model); editorPane = new UITableEditorPane<ParameterProvider>(model);
box.add(northPane);
box.add(sqlTextScrollPane);
box.add(paraMeanPane);
box.add(editorPane);
JPanel sqlSplitPane = new JPanel(new BorderLayout(4, 4));
sqlSplitPane.add(box, BorderLayout.CENTER);
// 左边的Panel,上面是选择DatabaseConnection的ComboBox,下面DatabaseConnection对应的Table // 左边的Panel,上面是选择DatabaseConnection的ComboBox,下面DatabaseConnection对应的Table
connectionTableProcedurePane = new ConnectionTableProcedurePane() { connectionTableProcedurePane = new ConnectionTableProcedurePane() {
@Override @Override
@ -131,7 +104,7 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
}); });
sqlTextPane.addFocusListener(new FocusListener() { sqlTextPane.addFocusListener(new FocusListener() {
public void focusGained(FocusEvent e) { public void focusGained(FocusEvent e) {
// unsupport
} }
public void focusLost(FocusEvent e) { public void focusLost(FocusEvent e) {
@ -140,6 +113,40 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
} }
} }
}); });
}
public DBTableDataPane() {
init();
this.setLayout(new BorderLayout(4, 4));
Box box = new Box(BoxLayout.Y_AXIS);
JPanel northPane = new JPanel(new BorderLayout(4, 4));
JToolBar editToolBar = createToolBar();
northPane.add(editToolBar, BorderLayout.CENTER);
northPane.setBorder(BorderFactory.createEmptyBorder(0, 0, BOTTOM, 0));
RTextScrollPane sqlTextScrollPane = new RTextScrollPane(sqlTextPane);
sqlTextScrollPane.setLineNumbersEnabled(true);
sqlTextScrollPane.setBorder(new UIRoundedBorder(UIConstants.LINE_COLOR, 1, UIConstants.ARC));
sqlTextScrollPane.setPreferredSize(new Dimension(680, 600));
JPanel paraMeanPane = new JPanel(new BorderLayout());
paraMeanPane.setPreferredSize(new Dimension(680, 90));
UILabel paraMean = new UILabel(Inter.getLocText("FR-Designer-Datasource-Param_DES"));
paraMeanPane.add(paraMean, BorderLayout.CENTER);
box.add(northPane);
box.add(sqlTextScrollPane);
box.add(paraMeanPane);
box.add(editorPane);
JPanel sqlSplitPane = new JPanel(new BorderLayout(4, 4));
sqlSplitPane.add(box, BorderLayout.CENTER);
box.setMinimumSize(new Dimension(310, 400)); box.setMinimumSize(new Dimension(310, 400));
// 使用SplitPane // 使用SplitPane
JSplitPane mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, connectionTableProcedurePane, sqlSplitPane); JSplitPane mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, connectionTableProcedurePane, sqlSplitPane);
@ -297,6 +304,7 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
@Override @Override
public void checkEnabled() { public void checkEnabled() {
// unsupport
} }
} }

Loading…
Cancel
Save