void (AnActionButton button) { String oldName = myCurrentSelection.getSeverity().getName(); String newName = Messages.showInputDialog(myPanel, InspectionsBundle.message("highlight.severity.create.dialog.name.label"), InspectionsBundle.message("highlight.severity.create.dialog.title"), null, oldName, new InputValidator() { @Override public boolean checkInput(String inputString) { return checkNameExist(inputString); } @Override public boolean canClose(String inputString) { return checkInput(inputString); } }); if (newName != null && !oldName.equals(newName)) { SeverityBasedTextAttributes newSeverityBasedTextAttributes = createSeverity(newName, myCurrentSelection.getAttributes()); int index = myOptionsList.getSelectedIndex(); ((DefaultListModel<SeverityBasedTextAttributes>)myOptionsList.getModel()).set(index, newSeverityBasedTextAttributes); select(newSeverityBasedTextAttributes); } }