void () { for (int i = 0; i < myNewNames.length; i++) { String newName = myNewNames[i]; if (myShouldRename[i] && !RenameUtil.isValidName(myProject, myRenames[i], newName)) { getOKAction().setEnabled(false); setErrorText(RefactoringBundle.message("automatic.renaming.dialog.identifier.invalid.error", newName)); return; } } getOKAction().setEnabled(true); setErrorText(null); }