use of jadx.gui.utils.search.TextSearchIndex in project jadx by skylot.
the class SearchDialog method prepareSearch.
private Flowable<JNode> prepareSearch(String text) {
if (text == null || options.isEmpty()) {
return Flowable.empty();
}
// allow empty text for comments search
if (text.isEmpty() && !options.contains(SearchOptions.COMMENT)) {
return Flowable.empty();
}
TextSearchIndex index = checkIndex();
if (index == null) {
return Flowable.empty();
}
LOG.debug("search event: {}", text);
showSearchState();
try {
Flowable<JNode> result = index.buildSearch(text, options);
if (searchField.getBackground() == SEARCHFIELD_ERROR_COLOR) {
searchField.setBackground(searchFieldDefaultBgColor);
}
return result;
} catch (SearchSettings.InvalidSearchTermException e) {
searchField.setBackground(SEARCHFIELD_ERROR_COLOR);
return Flowable.empty();
}
}
Aggregations