public static @Nullable VirtualFile selectImportSource(final String @NotNull [] sourceExtensions,
                                                         @NotNull Component parent,
                                                         @Nullable VirtualFile preselect,
                                                         @Nullable @NlsContexts.Label String description) {
    final Set<String> extensions = Set.of(sourceExtensions);
    FileChooserDescriptor descriptor = new FileChooserDescriptor(true, false, canSelectJarFile(sourceExtensions), false, false, false) {
      @Override
      public boolean isFileVisible(VirtualFile file, boolean showHiddenFiles) {
        return
          (file.isDirectory() || isFileSelectable(file)) &&
          (showHiddenFiles || !FileElement.isFileHidden(file));
      }

      @Override
      public boolean isFileSelectable(@Nullable VirtualFile file) {
        return file != null && !file.isDirectory() && file.getExtension() != null && extensions.contains(file.getExtension());
      }
    };
    if (description != null) {
      descriptor.setDescription(description);
    }
    FileChooserDialog fileChooser = FileChooserFactory.getInstance()
      .createFileChooser(descriptor, null, parent);
    final VirtualFile[] preselectFiles;
    if (preselect != null) {
      preselectFiles = new VirtualFile[1];
      preselectFiles[0] = preselect;
    }
    else {
      preselectFiles = VirtualFile.EMPTY_ARRAY;
    }
    final VirtualFile[] virtualFiles = fileChooser.choose(null, preselectFiles);
    if (virtualFiles.length != 1) return null;
    virtualFiles[0].refresh(false, false);
    return virtualFiles[0];
  }
public static @Nullable VirtualFile selectImportSource(final String @NotNull [] sourceExtensions,
                                                         @NotNull Component parent,
                                                         @Nullable VirtualFile preselect,
                                                         @Nullable @NlsContexts.Label String description)