use of com.intellij.ide.util.treeView.AbstractTreeUi in project intellij-community by JetBrains.
the class NodeProgressAnimator method repaintWithParents.
public void repaintWithParents(final SimpleNode element) {
SimpleNode current = element;
do {
DefaultMutableTreeNode node = myTreeBuilder.getNodeForElement(current);
if (node != null) {
final AbstractTreeUi treeUi = myTreeBuilder.getUi();
treeUi.addSubtreeToUpdate(node, false);
}
current = current.getParent();
} while (current != null);
}
use of com.intellij.ide.util.treeView.AbstractTreeUi in project android by JetBrains.
the class TreeBuilderSpeedSearch method findAndSelectElement.
@Override
public void findAndSelectElement(@NotNull String searchQuery) {
String pattern = searchQuery.trim();
clearSelection(myTree);
if (searchQuery.isEmpty()) {
return;
}
ActionCallback initialized = myTreeBuilder.getInitialized();
initialized.doWhenDone(() -> {
List<AbstractPsModelNode> nodes = Lists.newArrayList();
myTreeBuilder.accept(AbstractPsModelNode.class, new TreeVisitor<AbstractPsModelNode>() {
@Override
public boolean visit(@NotNull AbstractPsModelNode node) {
if (isMatchingElement(node, pattern)) {
nodes.add(node);
}
return false;
}
});
Color foreground = nodes.isEmpty() ? JBColor.red : getToolTipForeground();
if (mySearchPopup != null) {
mySearchPopup.mySearchField.setForeground(foreground);
}
if (nodes.isEmpty()) {
return;
}
Runnable onDone = () -> {
myTreeBuilder.expandParents(nodes);
myTreeBuilder.scrollToFirstSelectedRow();
};
myTreeBuilder.getUi().userSelect(nodes.toArray(), () -> {
AbstractTreeUi ui = myTreeBuilder.getUi();
if (ui != null) {
ui.executeUserRunnable(onDone);
} else {
onDone.run();
}
}, false, false);
});
}
Aggregations