void (@NotNull AnActionEvent e) { final TreePath selectionPath = myTree.getSelectionPath(); if (selectionPath != null) { MyNode node = (MyNode)selectionPath.getLastPathComponent(); NamedConfigurable<?> configurable = node.getConfigurable(); if (configurable instanceof ScopeConfigurable scopeConfigurable) { PackageSet set = scopeConfigurable.getEditableObject().getValue(); if (set != null) { if (scopeConfigurable.getHolder() == mySharedScopesManager) { createScope(true, IdeBundle.message("scopes.save.dialog.title.local"), set.createCopy()); } else { createScope(false, IdeBundle.message("scopes.save.dialog.title.shared"), set.createCopy()); } } } } }