Search in sources :

Example 11 with XDebuggerTreeNode

use of com.intellij.xdebugger.impl.ui.tree.nodes.XDebuggerTreeNode in project intellij-community by JetBrains.

the class XNewWatchAction method perform.

@Override
protected void perform(@NotNull AnActionEvent e, @NotNull XDebuggerTree tree, @NotNull XWatchesView watchesView) {
    XDebuggerTreeNode root = tree.getRoot();
    if (root instanceof WatchesRootNode) {
        final WatchesRootNode watchesRoot = (WatchesRootNode) root;
        watchesRoot.addNewWatch();
    }
}
Also used : WatchesRootNode(com.intellij.xdebugger.impl.ui.tree.nodes.WatchesRootNode) XDebuggerTreeNode(com.intellij.xdebugger.impl.ui.tree.nodes.XDebuggerTreeNode)

Example 12 with XDebuggerTreeNode

use of com.intellij.xdebugger.impl.ui.tree.nodes.XDebuggerTreeNode in project intellij-community by JetBrains.

the class XDebuggerTreeState method addChildren.

private void addChildren(final XDebuggerTree tree, final NodeInfo nodeInfo, final XDebuggerTreeNode treeNode) {
    if (tree.isExpanded(treeNode.getPath())) {
        List<? extends XDebuggerTreeNode> children = treeNode.getLoadedChildren();
        nodeInfo.myExpanded = true;
        for (XDebuggerTreeNode child : children) {
            TreePath path = child.getPath();
            Rectangle bounds = tree.getPathBounds(path);
            if (bounds != null) {
                Rectangle treeVisibleRect = tree.getParent() instanceof JViewport ? ((JViewport) tree.getParent()).getViewRect() : tree.getVisibleRect();
                if (treeVisibleRect.contains(bounds)) {
                    myLastVisibleNodeRect = bounds;
                }
            }
            NodeInfo childInfo = createNode(child, tree.isPathSelected(path));
            if (childInfo != null) {
                nodeInfo.addChild(childInfo);
                addChildren(tree, childInfo, child);
            }
        }
    }
}
Also used : TreePath(javax.swing.tree.TreePath) XDebuggerTreeNode(com.intellij.xdebugger.impl.ui.tree.nodes.XDebuggerTreeNode)

Example 13 with XDebuggerTreeNode

use of com.intellij.xdebugger.impl.ui.tree.nodes.XDebuggerTreeNode in project android by JetBrains.

the class BasicNativeDebuggerTest method debuggerTreeRootToChildrenTexts.

@NotNull
private static String[] debuggerTreeRootToChildrenTexts(XDebuggerTreeNode treeRoot) {
    List<? extends TreeNode> children = treeRoot.getChildren();
    String[] childrenTexts = new String[children.size()];
    int i = 0;
    for (TreeNode child : children) {
        childrenTexts[i] = ((XDebuggerTreeNode) child).getText().toString();
        ++i;
    }
    return childrenTexts;
}
Also used : TreeNode(javax.swing.tree.TreeNode) XDebuggerTreeNode(com.intellij.xdebugger.impl.ui.tree.nodes.XDebuggerTreeNode) XDebuggerTreeNode(com.intellij.xdebugger.impl.ui.tree.nodes.XDebuggerTreeNode) NotNull(org.jetbrains.annotations.NotNull)

Example 14 with XDebuggerTreeNode

use of com.intellij.xdebugger.impl.ui.tree.nodes.XDebuggerTreeNode in project android by JetBrains.

the class BasicNativeDebuggerTest method verifyVariablesAtBreakpoint.

private boolean verifyVariablesAtBreakpoint(String[] expectedVariablePatterns, String debugConfigName) {
    DebugToolWindowFixture debugToolWindowFixture = new DebugToolWindowFixture(guiTest.ideFrame());
    final ExecutionToolWindowFixture.ContentFixture contentFixture = debugToolWindowFixture.findContent(debugConfigName);
    contentFixture.clickDebuggerTreeRoot();
    Wait.seconds(1).expecting("debugger tree to appear").until(() -> contentFixture.getDebuggerTreeRoot() != null);
    // 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();
}
Also used : DebugToolWindowFixture(com.android.tools.idea.tests.gui.framework.fixture.DebugToolWindowFixture) ExecutionToolWindowFixture(com.android.tools.idea.tests.gui.framework.fixture.ExecutionToolWindowFixture) XDebuggerTreeNode(com.intellij.xdebugger.impl.ui.tree.nodes.XDebuggerTreeNode)

Aggregations

XDebuggerTreeNode (com.intellij.xdebugger.impl.ui.tree.nodes.XDebuggerTreeNode)14 TreePath (javax.swing.tree.TreePath)4 TreeNode (javax.swing.tree.TreeNode)3 Pair (com.intellij.openapi.util.Pair)2 WatchesRootNode (com.intellij.xdebugger.impl.ui.tree.nodes.WatchesRootNode)2 NotNull (org.jetbrains.annotations.NotNull)2 DebugToolWindowFixture (com.android.tools.idea.tests.gui.framework.fixture.DebugToolWindowFixture)1 ExecutionToolWindowFixture (com.android.tools.idea.tests.gui.framework.fixture.ExecutionToolWindowFixture)1 JavaValue (com.intellij.debugger.engine.JavaValue)1 TextWithImports (com.intellij.debugger.engine.evaluation.TextWithImports)1 ValueDescriptorImpl (com.intellij.debugger.ui.impl.watch.ValueDescriptorImpl)1 WatchNodeImpl (com.intellij.xdebugger.impl.ui.tree.nodes.WatchNodeImpl)1 XValueNodeImpl (com.intellij.xdebugger.impl.ui.tree.nodes.XValueNodeImpl)1 LinkedList (java.util.LinkedList)1 BasicTreeUI (javax.swing.plaf.basic.BasicTreeUI)1 Assert.assertNotNull (junit.framework.Assert.assertNotNull)1 Condition (org.fest.swing.timing.Condition)1 Nullable (org.jetbrains.annotations.Nullable)1