ModifiableModuleModel (String inputString) { final ModifiableModuleModel modifiableModel = ModuleManager.getInstance(myProject).getModifiableModel(); try { modifiableModel.renameModule(myModule, inputString); } catch (ModuleWithNameAlreadyExists moduleWithNameAlreadyExists) { Messages.showErrorDialog(myProject, IdeBundle.message("error.module.already.exists", inputString), IdeBundle.message("title.rename.module")); return null; } return modifiableModel; }