public void selectRoot(Project project, VirtualFile root) {
    final ComboBoxModel<DirectoryChooser.ItemWrapper> model = getComboBox().getModel();
    List<DirectoryChooser.ItemWrapper> items = new ArrayList<>(model.getSize());
    for (int i = 0; i < model.getSize(); i++) items.add(model.getElementAt(i));
    record NonBlockingResult(@NotNull VirtualFile root, @Nullable DirectoryChooser.ItemWrapper item) {
    }
    ReadAction
      .nonBlocking(() -> new NonBlockingResult(
        root,
        ContainerUtil.find(items, item ->
          item != DirectoryChooser.ItemWrapper.NULL
          && Comparing.equal(ProjectRootManager.getInstance(project).getFileIndex().getSourceRootForFile(item.getDirectory().getVirtualFile()), root)
        )
      ))
      .expireWith(this)
      .finishOnUiThread(ModalityState.current(), result -> {
        if (result.item != null) {
          getComboBox().setSelectedItem(result.item);
          getComboBox().repaint();
        }
        setComboboxModel(result.root, result.root, true);
      })
      .submit(AppExecutorUtil.getAppExecutorService());
  }
public void selectRoot(Project project, VirtualFile root)