protected void restoreSelection(@Nullable VirtualFile toSelect) {
    VirtualFile file = FileChooserUtil.getFileToSelect(myChooserDescriptor, myProject, toSelect);
    if (file != null && file.isValid()) {
      myPathTextField.setText(getPresentableUrl(file), true, () ->
        selectInTree(new VirtualFile[]{file}, false, false));
    }
  }
protected void restoreSelection(@Nullable VirtualFile toSelect)