@Nullable
  public static PsiDirectory chooseDirectory(PsiDirectory @NotNull [] targetDirectories,
                                             @Nullable PsiDirectory initialDirectory,
                                             @NotNull Project project,
                                             @Nullable Map<PsiDirectory, String> relativePathsToCreate) {
    final DirectoryChooser chooser = new DirectoryChooser(project, new DirectoryChooserModuleTreeView(project));
    chooser.setTitle(RefactoringBundle.message("choose.destination.directory"));
    chooser.fillList(
      targetDirectories,
      initialDirectory,
      project,
      relativePathsToCreate
    );
    if (!chooser.showAndGet()) {
      return null;
    }
    return chooser.getSelectedDirectory();
  }
@Nullable
  public static PsiDirectory chooseDirectory(PsiDirectory @NotNull [] targetDirectories,
                                             @Nullable PsiDirectory initialDirectory,
                                             @NotNull Project project,
                                             @Nullable Map<PsiDirectory, String> relativePathsToCreate)