Browse Source

Merge branch 'feature/x' of ssh://code.fineres.com:7999/~wei/design into feature/x

feature/x
WeiYanglu 3 years ago
parent
commit
27695385f2
  1. 13
      designer-base/src/main/java/com/fr/design/data/datapane/management/search/TableDataTreeSearchManager.java
  2. 4
      designer-base/src/main/java/com/fr/design/data/datapane/management/search/control/common/TableDataSearchCallBack.java
  3. 6
      designer-base/src/main/java/com/fr/design/data/datapane/management/search/control/pre/TableDataPreSearchCallBack.java
  4. 10
      designer-base/src/main/java/com/fr/design/data/datapane/management/search/searcher/TableDataTreeSearcher.java
  5. 4
      designer-base/src/main/java/com/fr/design/data/datapane/management/search/searcher/TreeSearchStatus.java

13
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());

4
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();
});
}

6
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
}
}

10
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<String> 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() {

4
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,
/**
* 搜索未开始
*/

Loading…
Cancel
Save