void () { myTextFieldAction.update(); myNorthPanel.remove(myPath); if (isToShowTextField()) { List<VirtualFile> selection = new ArrayList<>(); if (myFileSystemTree.getSelectedFile() != null) { selection.add(myFileSystemTree.getSelectedFile()); } updatePathFromTree(selection, true); myNorthPanel.add(myPath, BorderLayout.CENTER); } else { setErrorText(null); } IdeFocusManager.getGlobalInstance().doWhenFocusSettlesDown(() -> IdeFocusManager.getGlobalInstance().requestFocus(myPathTextField.getField(), true)); myNorthPanel.revalidate(); myNorthPanel.repaint(); }