From beec0ef3a735eb3125045909c7f7f08bae5ef309 Mon Sep 17 00:00:00 2001 From: Yvan Date: Thu, 7 Apr 2022 14:36:34 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-68455=20&&=20REPORT-69108=20=E3=80=90?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91=201.=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E6=A0=8F=E9=9D=A2=E6=9D=BF=E4=B8=8E=E5=85=B6=E4=BB=96?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF(=E8=AE=BE=E8=AE=A1=E5=99=A8=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E6=A0=8F-=E6=A8=A1=E6=9D=BF=E6=88=96=E8=BF=9C?= =?UTF-8?q?=E7=A8=8B=E8=AE=BE=E8=AE=A1-=E5=88=87=E6=8D=A2=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E7=9B=AE=E5=BD=95)=E9=87=8D=E5=8F=A0=E6=97=B6?= =?UTF-8?q?=E4=BC=9A=E6=98=BE=E7=A4=BA=E5=BC=82=E5=B8=B8=E6=98=AF=E5=9B=A0?= =?UTF-8?q?=E4=B8=BA=E4=B9=8B=E5=89=8D=E7=9A=84=E8=BF=99=E4=B8=AA=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E6=A0=8F=E9=9D=A2=E6=9D=BF=E6=89=8B=E8=AF=AF=E5=86=99?= =?UTF-8?q?=E6=88=90=E4=BA=86=E7=BB=A7=E6=89=BFPanel=202.=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E7=BB=93=E6=9E=9C=E6=98=BE=E7=A4=BA=E4=B8=8D=E6=AD=A3?= =?UTF-8?q?=E7=A1=AE=E6=98=AF=E5=9B=A0=E4=B8=BA=E4=B9=8B=E5=89=8D=E6=94=B9?= =?UTF-8?q?=E5=8D=A1=E6=AD=BB=E9=97=AE=E9=A2=98=E6=B2=A1=E6=94=B9=E5=A5=BD?= =?UTF-8?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9F=A5=E9=97=AE=E9=A2=98=20=E3=80=90review=E5=BB=BA?= =?UTF-8?q?=E8=AE=AE=E3=80=91=E6=97=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../search/TableDataTreeSearchManager.java | 14 +++++++++----- .../control/common/TableDataSearchCallBack.java | 8 ++++---- .../search/control/common/TableDataSearchTask.java | 3 ++- .../search/control/pre/TableDataPreSearchTask.java | 3 ++- .../search/pane/TreeSearchToolbarPane.java | 3 +-- 5 files changed, 18 insertions(+), 13 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/management/search/TableDataTreeSearchManager.java b/designer-base/src/main/java/com/fr/design/data/datapane/management/search/TableDataTreeSearchManager.java index 6fe79189c8..f77a94db84 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/management/search/TableDataTreeSearchManager.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/management/search/TableDataTreeSearchManager.java @@ -10,6 +10,7 @@ import com.fr.design.data.datapane.management.search.searcher.TableDataSearchMod import com.fr.design.data.datapane.management.search.searcher.TableDataTreeSearcher; import com.fr.design.data.datapane.management.search.searcher.TreeSearchStatus; import com.fr.design.data.datapane.management.search.view.TreeSearchRendererHelper; +import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; import javax.swing.SwingUtilities; @@ -102,6 +103,7 @@ public class TableDataTreeSearchManager { rendererHelper = new TreeSearchRendererHelper(); rendererHelper.save(getCurrentTableDataTree()); treeSearcher = new TableDataTreeSearcher(); + FineLoggerFactory.getLogger().debug("switch to table data search for mode: {}", searchMode.name()); treeSearcher.beforeSearch(searchMode, tableDataSource); } @@ -132,6 +134,7 @@ public class TableDataTreeSearchManager { setTreeSearchStatus(TreeSearchStatus.SEARCHING); rendererHelper.replaceTreeRenderer(getCurrentTableDataTree(), searchText); count = new AtomicInteger(treeSearcher.getAllWrappersSize()); + FineLoggerFactory.getLogger().debug("start table data search for search text: {}", searchText); treeSearcher.startSearch(searchText); } @@ -150,11 +153,9 @@ public class TableDataTreeSearchManager { } private boolean isRepeatSearch(String searchText) { - if (StringUtils.isEmpty(lastSearchText)) { - lastSearchText = searchText; - return false; - } - return StringUtils.equals(lastSearchText, searchText); + boolean repeat = StringUtils.equals(lastSearchText, searchText); + lastSearchText = searchText; + return repeat; } /** @@ -170,6 +171,7 @@ public class TableDataTreeSearchManager { public void stopSearch() { setTreeSearchStatus(TreeSearchStatus.SEARCH_STOPPED); count = null; + FineLoggerFactory.getLogger().debug("stop table data search for search text: {}", lastSearchText); treeSearcher.stopSearch(); } @@ -179,6 +181,7 @@ public class TableDataTreeSearchManager { public void completeSearch() { setTreeSearchStatus(TreeSearchStatus.SEARCH_COMPLETED); count = null; + FineLoggerFactory.getLogger().debug("complete table data search for search text: {}", lastSearchText); treeSearcher.completeSearch(); } @@ -187,6 +190,7 @@ public class TableDataTreeSearchManager { */ public void restoreToolBarAndTreePane() { setTreeSearchStatus(TreeSearchStatus.NOT_IN_SEARCH_MODE); + FineLoggerFactory.getLogger().info("out of table data search"); if (treeSearcher != null) { treeSearcher.afterSearch(); } diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/management/search/control/common/TableDataSearchCallBack.java b/designer-base/src/main/java/com/fr/design/data/datapane/management/search/control/common/TableDataSearchCallBack.java index 6b17f23a45..6137032f05 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/management/search/control/common/TableDataSearchCallBack.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/management/search/control/common/TableDataSearchCallBack.java @@ -24,14 +24,12 @@ public class TableDataSearchCallBack implements TreeSearchCallback { if (TableDataTreeSearchManager.getInstance().getTreeSearchStatus() != TreeSearchStatus.SEARCHING) { return; } - // 搜索计数 - TableDataTreeSearchManager.getInstance().decreaseCount(); if (treeSearchResult.isSuccess()) { // 添加结果 addToTreeSearcher(treeSearchResult); - // 处理UI - updateTableDataTree(); } + // 处理UI + updateTableDataTree(); } protected void updateTableDataTree() { @@ -40,6 +38,8 @@ public class TableDataSearchCallBack implements TreeSearchCallback { return; } TableDataTreeSearchManager.getInstance().updateTableDataTree(); + // 搜索计数 + TableDataTreeSearchManager.getInstance().decreaseCount(); }); } diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/management/search/control/common/TableDataSearchTask.java b/designer-base/src/main/java/com/fr/design/data/datapane/management/search/control/common/TableDataSearchTask.java index 2ab51f6a27..1a8b607c25 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/management/search/control/common/TableDataSearchTask.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/management/search/control/common/TableDataSearchTask.java @@ -43,8 +43,9 @@ public class TableDataSearchTask implements TreeSearchTask { } else { result = dealWithCommonTableDataWrapper(tableDataWrapper); } + FineLoggerFactory.getLogger().debug("calculate {}'s columns succeeded", tableDataWrapper.getTableDataName()); } catch (Throwable e) { - FineLoggerFactory.getLogger().error(e, e.getMessage()); + FineLoggerFactory.getLogger().error(e, "calculate {}'s columns failed", tableDataWrapper.getTableDataName()); result = dealWithErrorTableDataWrapper(tableDataWrapper); } callback.done(result); diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/management/search/control/pre/TableDataPreSearchTask.java b/designer-base/src/main/java/com/fr/design/data/datapane/management/search/control/pre/TableDataPreSearchTask.java index 7047b5ac16..979eef1b03 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/management/search/control/pre/TableDataPreSearchTask.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/management/search/control/pre/TableDataPreSearchTask.java @@ -33,8 +33,9 @@ public class TableDataPreSearchTask implements TreeSearchTask { result = new TableDataSearchResult.Builder() .buildSuccess(true) .build(); + FineLoggerFactory.getLogger().debug("pre calculate {}'s columns succeeded", tableDataWrapper.getTableDataName()); } catch (Exception e) { - FineLoggerFactory.getLogger().error(e, "calculate table data {} failed", tableDataWrapper.getTableDataName()); + FineLoggerFactory.getLogger().error(e, "pre calculate {}'s columns failed", tableDataWrapper.getTableDataName()); result = new TableDataSearchResult.Builder() .buildSuccess(false) .build(); diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/management/search/pane/TreeSearchToolbarPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/management/search/pane/TreeSearchToolbarPane.java index 2d37395b41..ecabc02b30 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/management/search/pane/TreeSearchToolbarPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/management/search/pane/TreeSearchToolbarPane.java @@ -23,7 +23,6 @@ import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.Color; import java.awt.Dimension; -import java.awt.Panel; import java.awt.event.FocusEvent; import java.awt.event.FocusListener; import java.awt.event.KeyAdapter; @@ -34,7 +33,7 @@ import java.awt.event.MouseEvent; /** * @author Yvan */ -public class TreeSearchToolbarPane extends Panel implements TreeSearchStatusChangeListener { +public class TreeSearchToolbarPane extends JPanel implements TreeSearchStatusChangeListener { public static final String TOOLBAR_PANE = "toolbarPane";