use of com.intellij.ide.util.treeView.TreeVisitor in project android by JetBrains.
the class TreeBuilderSpeedSearch method findNodes.
@NotNull
private List<AbstractPsModelNode> findNodes(@NotNull String searchQuery) {
String pattern = searchQuery.trim();
List<AbstractPsModelNode> nodes = Lists.newArrayList();
ActionCallback initialized = myTreeBuilder.getInitialized();
initialized.doWhenDone(() -> myTreeBuilder.accept(AbstractPsModelNode.class, new TreeVisitor<AbstractPsModelNode>() {
@Override
public boolean visit(@NotNull AbstractPsModelNode node) {
if (isMatchingElement(node, pattern)) {
nodes.add(node);
}
return false;
}
}));
return nodes;
}
Aggregations