void (@NotNull final AnActionEvent e) { TreePath[] selectionPaths = myTree.getSelectionPaths(); if (selectionPaths == null || selectionPaths.length != 1) { e.getPresentation().setEnabled(false); } else { final NamedConfigurable<?> selectedConfigurable = getSelectedConfigurable(); e.getPresentation().setEnabled(selectedConfigurable instanceof ModuleConfigurable || canBeCopiedByExtension(selectedConfigurable)); } }