|
|
|
@ -3,8 +3,9 @@
|
|
|
|
|
*/ |
|
|
|
|
package com.fr.design.data.datapane.preview; |
|
|
|
|
|
|
|
|
|
import com.fine.theme.icon.LazyIcon; |
|
|
|
|
import com.fine.theme.utils.FineUIUtils; |
|
|
|
|
import com.fr.base.TableData; |
|
|
|
|
import com.fr.base.svg.IconUtils; |
|
|
|
|
import com.fr.data.TableDataSource; |
|
|
|
|
import com.fr.data.desensitize.base.DesensitizationTableData; |
|
|
|
|
import com.fr.data.impl.DBTableData; |
|
|
|
@ -67,6 +68,9 @@ import java.util.List;
|
|
|
|
|
import java.util.Objects; |
|
|
|
|
import java.util.concurrent.CancellationException; |
|
|
|
|
|
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.cell; |
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.row; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* august: PreviewTablePane一共提供5个共有的静态方法,用来预览。 |
|
|
|
|
*/ |
|
|
|
@ -143,9 +147,9 @@ public class PreviewTablePane extends BasicPane {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private PreviewTablePane() { |
|
|
|
|
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
|
|
|
|
this.setLayout(new BorderLayout(0, 10)); |
|
|
|
|
// northPane
|
|
|
|
|
this.add(initNorthPane(), BorderLayout.NORTH); |
|
|
|
|
this.add(FineUIUtils.wrapComponentWithTitle(initNorthPane(), Toolkit.i18nText("Fine-Design_Basic_Data")), BorderLayout.NORTH); |
|
|
|
|
// centerPane
|
|
|
|
|
this.add(initCenterPane(), BorderLayout.CENTER); |
|
|
|
|
// dialog
|
|
|
|
@ -174,20 +178,14 @@ public class PreviewTablePane extends BasicPane {
|
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
private JComponent initPreviewNumberPane() { |
|
|
|
|
JPanel previewNumberPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); |
|
|
|
|
JPanel previewNumberPanel = new JPanel(new BorderLayout()); |
|
|
|
|
// 当前行数
|
|
|
|
|
JPanel currentPreviewPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); |
|
|
|
|
currentPreviewPanel.add(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Current_Preview_Rows") + ":")); |
|
|
|
|
currentRowsField = new UINumberField(); |
|
|
|
|
currentPreviewPanel.add(currentRowsField); |
|
|
|
|
currentRowsField.setEditable(false); |
|
|
|
|
currentRowsField.setColumns(4); |
|
|
|
|
currentRowsField.setInteger(true); |
|
|
|
|
// 最大行数
|
|
|
|
|
JPanel maxPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); |
|
|
|
|
maxPanel.add(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Datasource_Maximum_Number_of_Preview_Rows") + ":")); |
|
|
|
|
maxPreviewNumberField = new UINumberField(); |
|
|
|
|
maxPanel.add(maxPreviewNumberField); |
|
|
|
|
maxPreviewNumberField.setColumns(4); |
|
|
|
|
maxPreviewNumberField.setInteger(true); |
|
|
|
|
maxPreviewNumberField.setValue(DesignerEnvManager.getEnvManager().getMaxNumberOrPreviewRow()); |
|
|
|
@ -198,14 +196,17 @@ public class PreviewTablePane extends BasicPane {
|
|
|
|
|
// 刷新按钮
|
|
|
|
|
initRefreshLabel(); |
|
|
|
|
|
|
|
|
|
previewNumberPanel.add(currentPreviewPanel); |
|
|
|
|
previewNumberPanel.add(maxPanel); |
|
|
|
|
previewNumberPanel.add(refreshLabel); |
|
|
|
|
previewNumberPanel.add(row(20, |
|
|
|
|
row(4, cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Current_Preview_Rows") + ":")), cell(currentRowsField)), |
|
|
|
|
row(4, cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Datasource_Maximum_Number_of_Preview_Rows") + ":")), cell(maxPreviewNumberField)), |
|
|
|
|
cell(refreshLabel) |
|
|
|
|
).getComponent()); |
|
|
|
|
|
|
|
|
|
return previewNumberPanel; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void initRefreshLabel() { |
|
|
|
|
Icon refreshImage = IconUtils.readIcon("/com/fr/design/images/control/refresh"); |
|
|
|
|
Icon refreshImage = new LazyIcon("refresh"); |
|
|
|
|
refreshLabel = new UILabel(refreshImage); |
|
|
|
|
refreshLabel.addMouseListener(refreshLabelMouseAdapter); |
|
|
|
|
} |
|
|
|
@ -434,7 +435,6 @@ public class PreviewTablePane extends BasicPane {
|
|
|
|
|
*/ |
|
|
|
|
public static EmbeddedTableData previewTableData(TableData tableData, final int keyIndex, final int valueIndex) { |
|
|
|
|
PreviewTablePane previewTablePane = new PreviewTablePane(); |
|
|
|
|
previewTablePane.setBorder(BorderFactory.createTitledBorder(Toolkit.i18nText("Fine-Design_Basic_Data"))); |
|
|
|
|
try { |
|
|
|
|
previewTablePane.populate(tableData); |
|
|
|
|
previewTablePane.resetPreviewTableColumnColor(); |
|
|
|
@ -646,7 +646,6 @@ public class PreviewTablePane extends BasicPane {
|
|
|
|
|
public static void previewDataModel(final DataModel dataModel, final int keyIndex, final int valueIndex) { |
|
|
|
|
final PreviewTablePane previewTablePane = new PreviewTablePane(); |
|
|
|
|
previewTablePane.dataModel = dataModel; |
|
|
|
|
previewTablePane.setBorder(BorderFactory.createTitledBorder(Toolkit.i18nText("Fine-Design_Basic_Data"))); |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
previewTablePane.setRowsLimitTableModel(); |
|
|
|
@ -675,8 +674,6 @@ public class PreviewTablePane extends BasicPane {
|
|
|
|
|
// 单个结果集的展示面板
|
|
|
|
|
PreviewTablePane previewTablePane = new PreviewTablePane(); |
|
|
|
|
previewTablePane.dataModel = nameDataModel; |
|
|
|
|
// 数据
|
|
|
|
|
previewTablePane.setBorder(BorderFactory.createTitledBorder(Toolkit.i18nText("Fine-Design_Basic_Data"))); |
|
|
|
|
try { |
|
|
|
|
// 带行数限制的数据集结果预览对象
|
|
|
|
|
previewTablePane.setRowsLimitTableModel(); |
|
|
|
|