void (@NotNull AnActionEvent e) { e.getPresentation().setEnabled(true); TreePath[] selectionPaths = myActionsTree.getSelectionPaths(); if (selectionPaths == null) { e.getPresentation().setEnabled(false); return; } for (TreePath path : selectionPaths) { if (path.getPath().length <= minSelectionPathLength()) { e.getPresentation().setEnabled(false); return; } } }