private void updatePathFromTree(final List<? extends VirtualFile> selection, boolean now) {
    if (!isToShowTextField() || myTreeIsUpdating) return;

    String text = "";
    if (!selection.isEmpty()) {
      text = getPresentableUrl(selection.get(0));
    }
    else {
      final List<VirtualFile> roots = myChooserDescriptor.getRoots();
      if (!myFileSystemTree.getTree().isRootVisible() && roots.size() == 1) {
        text = getPresentableUrl(roots.get(0));
      }
    }
    if (text.isEmpty()) return;
    String old = myPathTextField.getTextFieldText();
    if (old == null || old.equals(text)) return;
    int index = old.length() - 1;
    if (index == text.length() && File.separatorChar == old.charAt(index) && old.startsWith(text)) return;

    myPathTextField.setText(text, now, () -> {
      myPathTextField.getField().selectAll();
      setErrorText(null);
    });
  }
private void updatePathFromTree(final List<? extends VirtualFile> selection, boolean now)