ComboBox<String> (@NotNull Project project, @NotNull Disposable uiDisposable) { ComboBox<String> comboBox = new ComboBox<>(JBUI.scale(500)); comboBox.setEditable(true); // chooseFiles is set to true to be able to select project.ipr file in IPR-based projects. Other files are not visible/selectable in the chooser FileChooserDescriptor descriptor = new FileChooserDescriptor(true, true, false, false, false, false) { @Override public boolean isFileVisible(VirtualFile file, boolean showHiddenFiles) { // dotIdeaStoragePath may be a path to the project.ipr file in IPR-based projects if (file.getPath().equals(myDotIdeaStoragePath)) return true; return file.isDirectory() && super.isFileVisible(file, showHiddenFiles); } @Override public boolean isFileSelectable(@Nullable VirtualFile file) { if (file == null) return false; if (file.getPath().equals(myDotIdeaStoragePath)) return true; return file.isDirectory() && super.isFileSelectable(file) && !file.getPath().endsWith("/.idea") && !file.getPath().contains("/.idea/") && ReadAction.compute(() -> ProjectFileIndex.getInstance(project).isInContent(file)); } }; Runnable selectFolderAction = new BrowseFolderRunnable<>(null, null, project, descriptor, comboBox, TextComponentAccessor.STRING_COMBOBOX_WHOLE_TEXT) { }; comboBox.initBrowsableEditor(selectFolderAction, uiDisposable); return comboBox; }