|
|
|
@ -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)) { |
|
|
|
|
boolean repeat = StringUtils.equals(lastSearchText, searchText); |
|
|
|
|
lastSearchText = searchText; |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
return StringUtils.equals(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(); |
|
|
|
|
} |
|
|
|
|