boolean (@NotNull AnActionEvent e, @NotNull XDebuggerTree tree) { List<? extends WatchNodeImpl> nodes = getSelectedNodes(tree, WatchNodeImpl.class); if (nodes.size() == 1) { XDebuggerTreeNode root = tree.getRoot(); if (root instanceof WatchesRootNode rootNode) { int size = rootNode.getWatchChildren().size() - 1 + rootNode.headerNodesCount(); return root.getIndex(nodes.get(0)) < size; } } return false; }