Search in sources :

Example 16 with XDebuggerTree

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

the class DebuggerUIUtil method setTreeNodeValue.

public static void setTreeNodeValue(XValueNodeImpl valueNode, String text, Consumer<String> errorConsumer) {
    XDebuggerTree tree = valueNode.getTree();
    Project project = tree.getProject();
    XValueModifier modifier = valueNode.getValueContainer().getModifier();
    if (modifier == null)
        return;
    XDebuggerTreeState treeState = XDebuggerTreeState.saveState(tree);
    valueNode.setValueModificationStarted();
    modifier.setValue(text, new XValueModifier.XModificationCallback() {

        @Override
        public void valueModified() {
            if (tree.isDetached()) {
                AppUIUtil.invokeOnEdt(() -> tree.rebuildAndRestore(treeState));
            }
            XDebuggerUtilImpl.rebuildAllSessionsViews(project);
        }

        @Override
        public void errorOccurred(@NotNull final String errorMessage) {
            AppUIUtil.invokeOnEdt(() -> {
                tree.rebuildAndRestore(treeState);
                errorConsumer.consume(errorMessage);
            });
            XDebuggerUtilImpl.rebuildAllSessionsViews(project);
        }
    });
}
Also used : Project(com.intellij.openapi.project.Project) XDebuggerTreeState(com.intellij.xdebugger.impl.ui.tree.XDebuggerTreeState) XValueModifier(com.intellij.xdebugger.frame.XValueModifier) XDebuggerTree(com.intellij.xdebugger.impl.ui.tree.XDebuggerTree)

Example 17 with XDebuggerTree

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

the class ShowReferringObjectsAction method perform.

@Override
protected void perform(XValueNodeImpl node, @NotNull String nodeName, AnActionEvent e) {
    XReferrersProvider referrersProvider = node.getValueContainer().getReferrersProvider();
    if (referrersProvider != null) {
        XDebuggerTree tree = node.getTree();
        XDebugSession session = XDebuggerManager.getInstance(tree.getProject()).getCurrentSession();
        if (session != null) {
            XInspectDialog dialog = new XInspectDialog(tree.getProject(), tree.getEditorsProvider(), tree.getSourcePosition(), nodeName, referrersProvider.getReferringObjectsValue(), tree.getValueMarkers(), session, false);
            dialog.setTitle(XDebuggerBundle.message("showReferring.dialog.title", nodeName));
            dialog.show();
        }
    }
}
Also used : XDebugSession(com.intellij.xdebugger.XDebugSession) XInspectDialog(com.intellij.xdebugger.impl.ui.tree.XInspectDialog) XReferrersProvider(com.intellij.xdebugger.frame.XReferrersProvider) XDebuggerTree(com.intellij.xdebugger.impl.ui.tree.XDebuggerTree)

Example 18 with XDebuggerTree

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

the class XDebuggerTreeActionBase method getSelectedNode.

@Nullable
public static XValueNodeImpl getSelectedNode(final DataContext dataContext) {
    XDebuggerTree tree = XDebuggerTree.getTree(dataContext);
    if (tree == null)
        return null;
    TreePath path = tree.getSelectionPath();
    if (path == null)
        return null;
    Object node = path.getLastPathComponent();
    return node instanceof XValueNodeImpl ? (XValueNodeImpl) node : null;
}
Also used : TreePath(javax.swing.tree.TreePath) XValueNodeImpl(com.intellij.xdebugger.impl.ui.tree.nodes.XValueNodeImpl) XDebuggerTree(com.intellij.xdebugger.impl.ui.tree.XDebuggerTree) Nullable(org.jetbrains.annotations.Nullable)

Example 19 with XDebuggerTree

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

the class XInspectAction method perform.

@Override
protected void perform(XValueNodeImpl node, @NotNull final String nodeName, AnActionEvent e) {
    XDebuggerTree tree = node.getTree();
    XValue value = node.getValueContainer();
    XInspectDialog dialog = new XInspectDialog(tree.getProject(), tree.getEditorsProvider(), tree.getSourcePosition(), nodeName, value, tree.getValueMarkers(), XDebuggerManager.getInstance(tree.getProject()).getCurrentSession(), true);
    dialog.show();
}
Also used : XInspectDialog(com.intellij.xdebugger.impl.ui.tree.XInspectDialog) XDebuggerTree(com.intellij.xdebugger.impl.ui.tree.XDebuggerTree) XValue(com.intellij.xdebugger.frame.XValue)

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