void (@NotNull AnActionEvent e) { int[] selectedRows = myTable.getSelectedRows(); String initial = (String)myModel.getValueAt(selectedRows[0], NEW_NAME_COLUMN); String newName = Messages.showInputDialog(myTable, RefactoringBundle.message("automatic.renaming.dialog.new.name.label"), RefactoringBundle.message("automatic.renaming.dialog.rename.selected.title"), null, initial, new InputValidatorEx() { @Override public boolean canClose(String inputString) { return checkInput(inputString); } @Nullable @Override public String getErrorText(@NlsSafe String inputString) { final int selectedRow = myTable.getSelectedRow(); if (!isValidName(inputString, selectedRow)) { return RefactoringBundle.message("text.identifier.invalid", inputString); } return null; } }); if (newName == null) return; for (int i : selectedRows) { myModel.setValueAt(newName, i, NEW_NAME_COLUMN); } myModel.fireTableDataChanged(); for (int row : selectedRows) { myTable.getSelectionModel().addSelectionInterval(row, row); } }