void (@NotNull AnActionEvent e) { Project project = e.getProject(); if (project != null) { CreateEditorConfigDialog dialog = new CreateEditorConfigDialog(project); if (dialog.showAndGet()) { final IdeView view = getIdeView(e); if (view != null) { CodeStyleSettings settings = CodeStyle.getSettings(project); PsiDirectory dir = view.getOrChooseDirectory(); if (dir != null) { final VirtualFile dirVFile = dir.getVirtualFile(); File outputFile = getOutputFile(dirVFile); if (!outputFile.exists()) { VirtualFile target = ApplicationManager.getApplication().runWriteAction( (Computable<VirtualFile>)() -> export(dirVFile, outputFile, project, settings, dialog.isRoot(), dialog.isCommentProperties(), dialog.getLanguages(), dialog.getPropertyKinds())); if (target != null) { OpenFileAction.openFile(target, project); PsiFile psiFile = getPsiFile(project, target); if (psiFile != null) { view.selectElement(psiFile); } } } else { Messages .showErrorDialog(project, EditorConfigBundle.message("notification.message.another.editorconfig.file.already.exists.in.0", dirVFile.getPath()), EditorConfigBundle.message("dialog.title.new.editorconfig.file")); } } } } } }