use of com.intellij.xdebugger.impl.ui.tree.nodes.XDebuggerTreeNode in project intellij-community by JetBrains.
the class IdeFrameFixture method verifyVariablesAtBreakpoint.
public boolean verifyVariablesAtBreakpoint(String[] expectedVariablePatterns, String debugConfigName, long tryUntilMillis) {
DebugToolWindowFixture debugToolWindowFixture = new DebugToolWindowFixture(this);
final ExecutionToolWindowFixture.ContentFixture contentFixture = debugToolWindowFixture.findContent(debugConfigName);
contentFixture.clickDebuggerTreeRoot();
// Wait for the debugger tree to appear.
pause(new Condition("Looking for debugger tree.") {
@Override
public boolean test() {
return contentFixture.getDebuggerTreeRoot() != null;
}
}, Timeout.timeout(tryUntilMillis));
// Get the debugger tree and print it.
XDebuggerTreeNode debuggerTreeRoot = contentFixture.getDebuggerTreeRoot();
if (debuggerTreeRoot == null) {
return false;
}
List<String> unmatchedPatterns = getUnmatchedTerminalVariableValues(expectedVariablePatterns, debuggerTreeRoot);
return unmatchedPatterns.isEmpty();
}
use of com.intellij.xdebugger.impl.ui.tree.nodes.XDebuggerTreeNode in project intellij-community by JetBrains.
the class XDebuggerTreeRestorer method childrenLoaded.
@Override
public void childrenLoaded(@NotNull final XDebuggerTreeNode node, @NotNull final List<XValueContainerNode<?>> children, final boolean last) {
XDebuggerTreeState.NodeInfo nodeInfo = myNode2State.get(node);
if (nodeInfo != null) {
for (XDebuggerTreeNode child : children) {
restoreNode(child, nodeInfo);
}
}
if (last) {
myNode2State.remove(node);
disposeIfFinished();
}
}
use of com.intellij.xdebugger.impl.ui.tree.nodes.XDebuggerTreeNode in project intellij-community by JetBrains.
the class XDebuggerTreeSpeedSearch method findPath.
private Object findPath(String string, XDebuggerTreeNode node, boolean checkChildren) {
TreePath path = node.getPath();
if (isMatchingElement(path, string)) {
return path;
}
XDebuggerTreeNode parent = ObjectUtils.tryCast(node.getParent(), XDebuggerTreeNode.class);
int nodeIndex;
List<? extends TreeNode> parentChildren;
if (parent != null) {
parentChildren = parent.getChildren();
nodeIndex = parentChildren.indexOf(node);
if (nodeIndex != -1) {
for (int i = nodeIndex + 1; i < parentChildren.size(); i++) {
TreePath result = match(parentChildren.get(i), string);
if (result != null) {
return result;
}
}
for (int i = nodeIndex - 1; i >= 0; i--) {
TreePath result = match(parentChildren.get(i), string);
if (result != null) {
return result;
}
}
}
} else {
nodeIndex = -1;
parentChildren = null;
}
// check children up to x level
if (checkChildren && !node.isLeaf()) {
TreePath result = findInChildren(node, string);
if (result != null) {
return result;
}
}
// check siblings children up to x level
if (parent != null) {
for (int i = nodeIndex + 1; i < parentChildren.size(); i++) {
TreePath result = findInChildren(parentChildren.get(i), string);
if (result != null) {
return result;
}
}
for (int i = nodeIndex - 1; i >= 0; i--) {
TreePath result = findInChildren(parentChildren.get(i), string);
if (result != null) {
return result;
}
}
return findPath(string, parent, false);
}
//myComponent.getSelectionPath()
return null;
}
use of com.intellij.xdebugger.impl.ui.tree.nodes.XDebuggerTreeNode in project intellij-community by JetBrains.
the class XDebuggerTreeSpeedSearch method findInChildren.
private TreePath findInChildren(TreeNode node, String string) {
if (node.isLeaf() || !(node instanceof XDebuggerTreeNode)) {
return null;
}
LinkedList<XDebuggerTreeNode> queue = new LinkedList<>();
queue.addLast((XDebuggerTreeNode) node);
int initialLevel = ((XDebuggerTreeNode) node).getPath().getPathCount();
while (!queue.isEmpty()) {
XDebuggerTreeNode p = queue.removeFirst();
if ((p.getPath().getPathCount() - initialLevel) > 3) {
return null;
}
List<? extends TreeNode> children = p.getChildren();
if (children.isEmpty()) {
continue;
}
for (TreeNode child : children) {
if (!(child instanceof XDebuggerTreeNode)) {
continue;
}
TreePath result = match(child, string);
if (result != null) {
return result;
}
if (!child.isLeaf()) {
queue.addLast((XDebuggerTreeNode) child);
}
}
}
return null;
}
use of com.intellij.xdebugger.impl.ui.tree.nodes.XDebuggerTreeNode in project intellij-community by JetBrains.
the class XEditWatchAction method perform.
@Override
protected void perform(@NotNull AnActionEvent e, @NotNull XDebuggerTree tree, @NotNull XWatchesView watchesView) {
List<? extends WatchNodeImpl> watchNodes = getSelectedNodes(tree, WatchNodeImpl.class);
if (watchNodes.size() != 1)
return;
WatchNodeImpl node = watchNodes.get(0);
XDebuggerTreeNode root = tree.getRoot();
if (root instanceof WatchesRootNode) {
((WatchesRootNode) root).editWatch(node);
}
}
Aggregations