void (@NotNull 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); } }