void (ActionEvent e) { final NamedScope scope; if (component instanceof JComboBox) { scope = (NamedScope)((JComboBox<?>)component).getSelectedItem(); } else { scope = (NamedScope)((JBComboBoxTableCellEditorComponent)component).getEditorValue(); } if (scope instanceof NamedScope.UnnamedScope) { final Map<String, PackageSet> unnamedScopes = DependencyValidationManager.getInstance(myProject).getUnnamedScopes(); final EditUnnamedScopesDialog dlg = new EditUnnamedScopesDialog(scope); if (dlg.showAndGet()) { final PackageSet packageSet = scope.getValue(); LOG.assertTrue(packageSet != null); unnamedScopes.remove(packageSet.getText()); final PackageSet editedScope = dlg.getScope(); if (editedScope != null) { unnamedScopes.put(editedScope.getText(), editedScope); } rebuild(); if (editedScope != null) { selectScope(editedScope.getText()); } } } else { final EditScopesDialog dlg = EditScopesDialog.showDialog(myProject, scope.getScopeId(), true); if (dlg.isOK()) { rebuild(); final NamedScope namedScope = dlg.getSelectedScope(); if (namedScope != null) { selectScope(namedScope.getScopeId()); } } } }