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;
}
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();
}
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();
}
});
}
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;
}
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;
}
Aggregations