void () { RecentsManager.getInstance(myProject).registerRecentEntry(RECENTS_KEY, myTargetPackageField.getText()); RecentsManager.getInstance(myProject).registerRecentEntry(RECENT_SUPERS_KEY, mySuperClassField.getText()); String errorMessage = null; try { myTargetDirectory = selectTargetDirectory(getPackageName(), myProject, myTargetModule); if (myTargetDirectory == null) return; } catch (IncorrectOperationException e) { errorMessage = e.getMessage(); } if (errorMessage == null) { try { errorMessage = checkCanCreateClass(); } catch (IncorrectOperationException e) { errorMessage = e.getMessage(); } } if (errorMessage != null) { final int result = Messages .showOkCancelDialog(myProject, JavaBundle.message("dialog.message.0.update.existing.class", errorMessage), CommonBundle.getErrorTitle(), Messages.getErrorIcon()); if (result == Messages.CANCEL) { return; } } saveDefaultLibraryNameAndSuperClass(); saveShowInheritedMembersStatus(); super.doOKAction(); }