void (final List<? extends VirtualFile> selection, boolean now) { if (!isToShowTextField() || myTreeIsUpdating) return; String text = ""; if (!selection.isEmpty()) { text = VfsUtil.getReadableUrl(selection.get(0)); } else { final List<VirtualFile> roots = myChooserDescriptor.getRoots(); if (!myFileSystemTree.getTree().isRootVisible() && roots.size() == 1) { text = VfsUtil.getReadableUrl(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); }); }