void (@NotNull AnActionEvent event) { Project project = event.getProject(); if (!isConvertableProject(project) || Messages.showOkCancelDialog(project, IdeBundle.message( "message.project.will.be.saved.and.reopened.in.new.directory.based.format"), IdeBundle .message("dialog.title.save.project.to.directory.based.format"), Messages.getWarningIcon()) != Messages.OK) { return; } IProjectStore store = ProjectKt.getStateStore(project); Path baseDir = store.getProjectFilePath().getParent(); Path ideaDir = baseDir.resolve(Project.DIRECTORY_STORE_FOLDER); try { convertToDirectoryBasedFormat(project, store, baseDir, ideaDir); // closeAndDispose will also force save project ProjectManagerEx projectManager = ProjectManagerEx.getInstanceEx(); projectManager.closeAndDispose(project); projectManager.openProject(ideaDir.getParent(), OpenProjectTask.build()); } catch (IOException e) { Messages.showErrorDialog(project, String.format(IdeBundle.message("dialog.message.unable.to.create.idea.directory", e.getMessage()), ideaDir), IdeBundle.message("dialog.title.error.saving.project")); } }