Search in sources :

Example 6 with XDebuggerTree

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

the class XEditWatchAction method update.

@Override
public void update(final AnActionEvent e) {
    XDebuggerTree tree = XDebuggerTree.getTree(e);
    e.getPresentation().setEnabledAndVisible(tree != null && getSelectedNodes(tree, WatchNodeImpl.class).size() == 1);
}
Also used : XDebuggerTree(com.intellij.xdebugger.impl.ui.tree.XDebuggerTree)

Example 7 with XDebuggerTree

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

the class XRemoveWatchAction method update.

@Override
public void update(AnActionEvent e) {
    XDebuggerTree tree = XDebuggerTree.getTree(e);
    boolean enabled = tree != null && !getSelectedNodes(tree, WatchNodeImpl.class).isEmpty();
    if (ActionPlaces.DEBUGGER_TOOLBAR.equals(e.getPlace())) {
        e.getPresentation().setEnabled(enabled);
    } else {
        e.getPresentation().setEnabledAndVisible(enabled);
    }
}
Also used : WatchNodeImpl(com.intellij.xdebugger.impl.ui.tree.nodes.WatchNodeImpl) XDebuggerTree(com.intellij.xdebugger.impl.ui.tree.XDebuggerTree)

Example 8 with XDebuggerTree

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

the class XWatchesTreeActionBase method actionPerformed.

@Override
public void actionPerformed(AnActionEvent e) {
    final XDebuggerTree tree = XDebuggerTree.getTree(e);
    XWatchesView watchesView = e.getData(XWatchesView.DATA_KEY);
    if (tree != null && watchesView != null) {
        perform(e, tree, watchesView);
    }
}
Also used : XWatchesView(com.intellij.xdebugger.impl.frame.XWatchesView) XDebuggerTree(com.intellij.xdebugger.impl.ui.tree.XDebuggerTree)

Example 9 with XDebuggerTree

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

the class XWatchesTreeActionBase method update.

public void update(final AnActionEvent e) {
    final XDebuggerTree tree = XDebuggerTree.getTree(e);
    XWatchesView watchesView = e.getData(XWatchesView.DATA_KEY);
    boolean enabled = tree != null && watchesView != null && isEnabled(e, tree);
    e.getPresentation().setEnabled(enabled);
}
Also used : XWatchesView(com.intellij.xdebugger.impl.frame.XWatchesView) XDebuggerTree(com.intellij.xdebugger.impl.ui.tree.XDebuggerTree)

Example 10 with XDebuggerTree

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

the class XDebuggerTreeActionBase method getSelectedNodes.

@NotNull
public static List<XValueNodeImpl> getSelectedNodes(DataContext dataContext) {
    XDebuggerTree tree = XDebuggerTree.getTree(dataContext);
    if (tree == null)
        return Collections.emptyList();
    TreePath[] paths = tree.getSelectionPaths();
    if (paths == null || paths.length == 0) {
        return Collections.emptyList();
    }
    return StreamEx.of(paths).map(TreePath::getLastPathComponent).select(XValueNodeImpl.class).toList();
}
Also used : TreePath(javax.swing.tree.TreePath) 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