Search in sources :

Example 11 with XDebuggerTree

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

the class XDebuggerInstanceTreeCreator method createTree.

@NotNull
@Override
public Tree createTree(@NotNull Pair<XInstanceEvaluator, String> descriptor) {
    final XDebuggerTree tree = new XDebuggerTree(myProject, myProvider, myPosition, XDebuggerActions.INSPECT_TREE_POPUP_GROUP, myMarkers);
    final XValueNodeImpl root = new XValueNodeImpl(tree, null, descriptor.getSecond(), new InstanceEvaluatorTreeRootValue(descriptor.getFirst(), descriptor.getSecond()));
    tree.setRoot(root, false);
    Condition<TreeNode> visibleRootCondition = node -> node.getParent() == root;
    tree.expandNodesOnLoad(visibleRootCondition);
    tree.selectNodeOnLoad(visibleRootCondition);
    return tree;
}
Also used : XValueNodeImpl(com.intellij.xdebugger.impl.ui.tree.nodes.XValueNodeImpl) TreeNode(javax.swing.tree.TreeNode) XDebuggerActions(com.intellij.xdebugger.impl.actions.XDebuggerActions) XDebuggerTree(com.intellij.xdebugger.impl.ui.tree.XDebuggerTree) ResultConsumer(com.intellij.concurrency.ResultConsumer) XDebuggerEditorsProvider(com.intellij.xdebugger.evaluation.XDebuggerEditorsProvider) XSourcePosition(com.intellij.xdebugger.XSourcePosition) XInstanceEvaluator(com.intellij.xdebugger.evaluation.XInstanceEvaluator) com.intellij.xdebugger.frame(com.intellij.xdebugger.frame) Pair(com.intellij.openapi.util.Pair) Project(com.intellij.openapi.project.Project) Tree(com.intellij.ui.treeStructure.Tree) DebuggerTreeCreator(com.intellij.xdebugger.impl.evaluate.quick.common.DebuggerTreeCreator) XValueMarkers(com.intellij.xdebugger.impl.frame.XValueMarkers) NotNull(org.jetbrains.annotations.NotNull) XDebugSession(com.intellij.xdebugger.XDebugSession) Condition(com.intellij.openapi.util.Condition) XDebuggerEvaluator(com.intellij.xdebugger.evaluation.XDebuggerEvaluator) TreeNode(javax.swing.tree.TreeNode) XValueNodeImpl(com.intellij.xdebugger.impl.ui.tree.nodes.XValueNodeImpl) XDebuggerTree(com.intellij.xdebugger.impl.ui.tree.XDebuggerTree) NotNull(org.jetbrains.annotations.NotNull)

Example 12 with XDebuggerTree

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

the class XVariablesView method clear.

@Override
protected void clear() {
    XDebuggerTree tree = getTree();
    tree.setSourcePosition(null);
    clearInlineData(tree);
    XValueContainerNode root = createNewRootNode(null);
    addEmptyMessage(root);
    super.clear();
}
Also used : XValueContainerNode(com.intellij.xdebugger.impl.ui.tree.nodes.XValueContainerNode) XDebuggerTree(com.intellij.xdebugger.impl.ui.tree.XDebuggerTree)

Example 13 with XDebuggerTree

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

the class XVariablesView method processSessionEvent.

@Override
public void processSessionEvent(@NotNull SessionEvent event, @NotNull XDebugSession session) {
    if (ApplicationManager.getApplication().isDispatchThread()) {
        // mark nodes obsolete asap
        getTree().markNodesObsolete();
    }
    XStackFrame stackFrame = session.getCurrentStackFrame();
    DebuggerUIUtil.invokeLater(() -> {
        XDebuggerTree tree = getTree();
        if (event == SessionEvent.BEFORE_RESUME || event == SessionEvent.SETTINGS_CHANGED) {
            saveCurrentTreeState(stackFrame);
            if (event == SessionEvent.BEFORE_RESUME) {
                return;
            }
        }
        tree.markNodesObsolete();
        if (stackFrame != null) {
            cancelClear();
            buildTreeAndRestoreState(stackFrame);
        } else {
            requestClear();
        }
    });
}
Also used : XDebuggerTree(com.intellij.xdebugger.impl.ui.tree.XDebuggerTree) XStackFrame(com.intellij.xdebugger.frame.XStackFrame)

Example 14 with XDebuggerTree

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

the class XWatchesViewImpl method getExpressions.

@NotNull
private XExpression[] getExpressions() {
    XDebuggerTree tree = getTree();
    XDebugSession session = getSession(tree);
    XExpression[] expressions;
    if (session != null) {
        expressions = ((XDebugSessionImpl) session).getSessionData().getWatchExpressions();
    } else {
        XDebuggerTreeNode root = tree.getRoot();
        List<? extends WatchNode> current = root instanceof WatchesRootNode ? ((WatchesRootNode) tree.getRoot()).getWatchChildren() : Collections.emptyList();
        List<XExpression> list = ContainerUtil.newArrayList();
        for (WatchNode child : current) {
            list.add(child.getExpression());
        }
        expressions = list.toArray(new XExpression[list.size()]);
    }
    return expressions;
}
Also used : XDebugSession(com.intellij.xdebugger.XDebugSession) XExpression(com.intellij.xdebugger.XExpression) XDebuggerTree(com.intellij.xdebugger.impl.ui.tree.XDebuggerTree) XDebugSessionImpl(com.intellij.xdebugger.impl.XDebugSessionImpl) NotNull(org.jetbrains.annotations.NotNull)

Example 15 with XDebuggerTree

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

the class XDebuggerTreeCreator method createTree.

@NotNull
@Override
public Tree createTree(@NotNull Pair<XValue, String> descriptor) {
    final XDebuggerTree tree = new XDebuggerTree(myProject, myProvider, myPosition, XDebuggerActions.INSPECT_TREE_POPUP_GROUP, myMarkers);
    final XValueNodeImpl root = new XValueNodeImpl(tree, null, descriptor.getSecond(), descriptor.getFirst());
    tree.setRoot(root, true);
    tree.setSelectionRow(0);
    // expand root on load
    tree.expandNodesOnLoad(node -> node == root);
    return tree;
}
Also used : XValueNodeImpl(com.intellij.xdebugger.impl.ui.tree.nodes.XValueNodeImpl) XDebuggerTree(com.intellij.xdebugger.impl.ui.tree.XDebuggerTree) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

XDebuggerTree (com.intellij.xdebugger.impl.ui.tree.XDebuggerTree)19 NotNull (org.jetbrains.annotations.NotNull)6 XValueNodeImpl (com.intellij.xdebugger.impl.ui.tree.nodes.XValueNodeImpl)5 Project (com.intellij.openapi.project.Project)4 XDebugSession (com.intellij.xdebugger.XDebugSession)3 TreePath (javax.swing.tree.TreePath)3 XSourcePosition (com.intellij.xdebugger.XSourcePosition)2 XWatchesView (com.intellij.xdebugger.impl.frame.XWatchesView)2 XInspectDialog (com.intellij.xdebugger.impl.ui.tree.XInspectDialog)2 ResultConsumer (com.intellij.concurrency.ResultConsumer)1 CompositeDisposable (com.intellij.openapi.CompositeDisposable)1 Disposable (com.intellij.openapi.Disposable)1 Editor (com.intellij.openapi.editor.Editor)1 Condition (com.intellij.openapi.util.Condition)1 EmptyRunnable (com.intellij.openapi.util.EmptyRunnable)1 Pair (com.intellij.openapi.util.Pair)1 ClickListener (com.intellij.ui.ClickListener)1 DoubleClickListener (com.intellij.ui.DoubleClickListener)1 Tree (com.intellij.ui.treeStructure.Tree)1 Alarm (com.intellij.util.Alarm)1