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 f47f457aa3..bb98fdeffa 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 @@ -136,7 +136,7 @@ public class TableDataTreeSearchManager { } setTreeSearchStatus(TreeSearchStatus.SEARCHING); rendererHelper.replaceTreeRenderer(getCurrentTableDataTree(), searchText); - count = new AtomicInteger(treeSearcher.getNotCalculatedSetsSize()); + count = new AtomicInteger(treeSearcher.getAllWrappersSize()); // 计时开始 TableDataSearchTimer.getInstance().startClock(); treeSearcher.startSearch(searchText); @@ -192,17 +192,24 @@ public class TableDataTreeSearchManager { } /** - * 切换回工具栏 + * 切换回工具栏,恢复数据集树UI */ public void restoreToolBarAndTreePane() { setTreeSearchStatus(TreeSearchStatus.NOT_IN_SEARCH_MODE); if (treeSearcher != null) { treeSearcher.afterSearch(); } - restoreTreePane(); + lastSearchText = null; + if (rendererHelper != null) { + rendererHelper.restore(getCurrentTableDataTree()); + } } + /** + * 恢复数据集树UI + */ public void restoreTreePane() { + setTreeSearchStatus(TreeSearchStatus.SEARCH_NOT_BEGIN); lastSearchText = null; if (rendererHelper != null) { rendererHelper.restore(getCurrentTableDataTree()); 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 c544921c5b..d4233d8bf9 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 @@ -38,8 +38,8 @@ public class TableDataSearchCallBack implements TreeSearchCallback { return; } TableDataTreeSearchManager.getInstance().updateTableDataTree(); - // todo 没想清楚为啥会这么快结束,暂时取消搜索计数 -// TableDataTreeSearchManager.getInstance().decreaseCount(); + // 搜索计数 + TableDataTreeSearchManager.getInstance().decreaseCount(); }); } diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/management/search/control/pre/TableDataPreSearchCallBack.java b/designer-base/src/main/java/com/fr/design/data/datapane/management/search/control/pre/TableDataPreSearchCallBack.java index a4826918d5..929c81a12a 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/management/search/control/pre/TableDataPreSearchCallBack.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/management/search/control/pre/TableDataPreSearchCallBack.java @@ -1,5 +1,6 @@ package com.fr.design.data.datapane.management.search.control.pre; +import com.fr.design.data.datapane.management.search.control.TreeSearchResult; import com.fr.design.data.datapane.management.search.control.common.TableDataSearchCallBack; import com.fr.design.data.datapane.management.search.searcher.TableDataTreeSearcher; @@ -14,4 +15,9 @@ public class TableDataPreSearchCallBack extends TableDataSearchCallBack { public TableDataPreSearchCallBack(TableDataTreeSearcher treeSearcher) { super(treeSearcher); } + + @Override + public void done(TreeSearchResult treeSearchResult) { + // do nothing + } } diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/management/search/searcher/TableDataTreeSearcher.java b/designer-base/src/main/java/com/fr/design/data/datapane/management/search/searcher/TableDataTreeSearcher.java index 7569491e99..160d462b47 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/management/search/searcher/TableDataTreeSearcher.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/management/search/searcher/TableDataTreeSearcher.java @@ -45,8 +45,8 @@ public class TableDataTreeSearcher implements TreeSearcher { return matchSets.isEmpty(); } - public int getNotCalculatedSetsSize() { - return notCalculatedSets.size(); + public int getAllWrappersSize() { + return allWrappers.size(); } public synchronized void addToCalculatedSets(List tableDataNames) { @@ -55,7 +55,6 @@ public class TableDataTreeSearcher implements TreeSearcher { if (tableDataWrapper == null) { return; } - notCalculatedSets.remove(tableDataName); calculatedSets.add(tableDataName); } } @@ -111,6 +110,7 @@ public class TableDataTreeSearcher implements TreeSearcher { @Override public void startSearch(String searchText) { + reset(); for (String notCalculatedSet : notCalculatedSets) { TableDataWrapper tableDataWrapper = allWrappers.get(notCalculatedSet); if (TableDataTreeSearchManager.getInstance().getTreeSearchStatus() == TreeSearchStatus.SEARCHING) { @@ -121,12 +121,12 @@ public class TableDataTreeSearcher implements TreeSearcher { @Override public void stopSearch() { - reset(); + } @Override public void completeSearch() { - reset(); + } private void reset() { diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/management/search/searcher/TreeSearchStatus.java b/designer-base/src/main/java/com/fr/design/data/datapane/management/search/searcher/TreeSearchStatus.java index 835e9ded6d..ff577995f2 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/management/search/searcher/TreeSearchStatus.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/management/search/searcher/TreeSearchStatus.java @@ -5,8 +5,10 @@ package com.fr.design.data.datapane.management.search.searcher; */ public enum TreeSearchStatus { + /** + * 非搜索模式 + */ NOT_IN_SEARCH_MODE, - /** * 搜索未开始 */