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";