void (@NotNull AnActionEvent e) { final JTree tree = (JTree)e.getData(PlatformCoreDataKeys.CONTEXT_COMPONENT); LOG.assertTrue(tree != null); final TreePath[] paths = tree.getSelectionPaths(); LOG.assertTrue(paths != null); final ExclusionHandler<T> exclusionProcessor = e.getData(ExclusionHandler.EXCLUSION_HANDLER); LOG.assertTrue(exclusionProcessor != null); for (TreePath path : paths) { final T node = (T)path.getLastPathComponent(); TreeUtil.traverse(node, n -> { if (!exclusionProcessor.isNodeExclusionAvailable((T)n)) return true; if (myIsExclude != exclusionProcessor.isNodeExcluded((T)n)) { if (myIsExclude) { exclusionProcessor.excludeNode(node); } else { exclusionProcessor.includeNode(node); } } return true; }); } exclusionProcessor.onDone(myIsExclude); }