From f65a025b55847cca3127288d24b5c1315f6cb85a Mon Sep 17 00:00:00 2001 From: hzzz Date: Fri, 17 Aug 2018 15:51:39 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-10489=E3=80=90=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E5=8D=87=E7=BA=A710.0=E3=80=91=E5=B7=A5=E4=BD=9C=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=E5=88=87=E6=8D=A2=E4=BD=8D=E8=BF=9C=E7=A8=8B=E5=90=8E?= =?UTF-8?q?=EF=BC=8C=E7=AC=AC=E4=B8=80=E6=AC=A1=E9=A2=84=E8=A7=88=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=9B=86=E8=BF=9B=E5=BA=A6=E6=A1=86=E4=B8=80=E7=9B=B4?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datapane/preview/PreviewTablePane.java | 33 +++++++++++++------ 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java index 6b64f77b72..bfcba4aa2e 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java @@ -26,14 +26,25 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; import com.fr.function.TIME; import com.fr.general.FRFont; - import com.fr.log.FineLoggerFactory; -import javax.swing.*; +import javax.swing.BorderFactory; +import javax.swing.Icon; +import javax.swing.JComponent; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JTable; +import javax.swing.SwingWorker; +import javax.swing.UIManager; import javax.swing.table.DefaultTableCellRenderer; import javax.swing.table.TableColumn; import javax.swing.table.TableModel; -import java.awt.*; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.Font; +import java.awt.Graphics; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; @@ -285,7 +296,7 @@ public class PreviewTablePane extends BasicPane { previewTablePane.dialog.setVisible(true); } - return previewTablePane.previewTableData; + return previewTablePane.previewTableData; } private void showErrorMessage(Exception exp) { @@ -358,14 +369,16 @@ public class PreviewTablePane extends BasicPane { worker = new SwingWorker() { protected PreviewTableModel doInBackground() throws Exception { connectionBar.start(); - if (tableData instanceof DBTableData) { - boolean status = DataOperator.getInstance().testConnection(((DBTableData) tableData).getDatabase()); - if (!status) { - connectionBar.close(); - throw new Exception(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Failed")); + try { + if (tableData instanceof DBTableData) { + boolean status = DataOperator.getInstance().testConnection(((DBTableData) tableData).getDatabase()); + if (!status) { + throw new Exception(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Failed")); + } } + } finally { + connectionBar.close(); } - connectionBar.close(); TableDataSource dataSource = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getTarget(); previewTableData = DesignTableDataManager.previewTableDataNeedInputParameters(dataSource, tableData, (int) maxPreviewNumberField.getValue(), true); // parameterInputDialog