public static @Nullable VirtualFile chooseFile(
    @NotNull FileChooserDescriptor descriptor,
    @Nullable Component parent,
    @Nullable Project project,
    @Nullable VirtualFile toSelect
  ) {
    var parentComponent = parent == null ? KeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow() : parent;
    LOG.assertTrue(!descriptor.isChooseMultiple());
    return ArrayUtil.getFirstElement(chooseFiles(descriptor, parentComponent, project, toSelect));
  }
public static @Nullable VirtualFile chooseFile(
    @NotNull FileChooserDescriptor descriptor,
    @Nullable Component parent,
    @Nullable Project project,
    @Nullable VirtualFile toSelect
  )