JComponent () { JPanel panel = new MyPanel(); myUiUpdater = new MergingUpdateQueue("FileChooserUpdater", 200, false, panel); Disposer.register(getDisposable(), myUiUpdater); UiNotifyConnector.installOn(panel, myUiUpdater); panel.setBorder(JBUI.Borders.empty()); createTree(); final DefaultActionGroup group = createActionGroup(); ActionToolbar toolBar = ActionManager.getInstance().createActionToolbar("FileChooserDialog", group, true); toolBar.setTargetComponent(panel); final JPanel toolbarPanel = new JPanel(new BorderLayout()); toolbarPanel.add(toolBar.getComponent(), BorderLayout.CENTER); myTextFieldAction = new TextFieldAction() { @Override public void linkSelected(final LinkLabel aSource, final Object aLinkData) { toggleShowTextField(); } }; toolbarPanel.add(myTextFieldAction, BorderLayout.EAST); JPanel extraToolbarPanel = createExtraToolbarPanel(); if(extraToolbarPanel != null){ toolbarPanel.add(extraToolbarPanel, BorderLayout.SOUTH); } myPath = new ComboBox<>(FileChooserUtil.getRecentPaths().toArray(ArrayUtilRt.EMPTY_STRING_ARRAY)); myPath.setEditable(true); myPath.setRenderer(SimpleListCellRenderer.create((var label, @NlsContexts.Label var value, var index) -> { label.setText(value); VirtualFile file = LocalFileSystem.getInstance().findFileByIoFile(new File(value)); label.setIcon(file == null ? EmptyIcon.ICON_16 : IconUtil.getIcon(file, Iconable.ICON_FLAG_READ_STATUS, null)); })); JTextField pathEditor = (JTextField)myPath.getEditor().getEditorComponent(); FileLookup.LookupFilter filter = f -> myChooserDescriptor.isFileVisible(((LocalFsFinder.VfsFile)f).getFile(), myFileSystemTree.areHiddensShown()); myPathTextField = new FileTextFieldImpl(pathEditor, new LocalFsFinder(), filter, FileChooserFactoryImpl.getMacroMap(), getDisposable()) { @Override protected void onTextChanged(String newValue) { myUiUpdater.cancelAllUpdates(); updateTreeFromPath(newValue); } }; myNorthPanel = new JPanel(new BorderLayout()); myNorthPanel.add(toolbarPanel, BorderLayout.NORTH); updateTextFieldShowing(); panel.add(myNorthPanel, BorderLayout.NORTH); registerMouseListener(group); JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myFileSystemTree.getTree()); panel.add(scrollPane, BorderLayout.CENTER); panel.setPreferredSize(JBUI.size(400)); JLabel dndLabel = new JLabel(UIBundle.message("file.chooser.tooltip.drag.drop"), SwingConstants.CENTER); dndLabel.setFont(JBUI.Fonts.miniFont()); dndLabel.setForeground(UIUtil.getLabelDisabledForeground()); panel.add(dndLabel, BorderLayout.SOUTH); ApplicationManager.getApplication().getMessageBus().connect(getDisposable()) .subscribe(ApplicationActivationListener.TOPIC, new ApplicationActivationListener() { @Override public void applicationActivated(@NotNull IdeFrame ideFrame) { SaveAndSyncHandler.getInstance().maybeRefresh(ModalityState.current()); } }); return panel; }