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