ExcludedEntriesConfigurable (@NotNull Project project) { ProjectFileIndex index = project.isDefault() ? null : ProjectRootManager.getInstance(project).getFileIndex(); final FileChooserDescriptor descriptor = new FileChooserDescriptor(true, true, false, false, false, true) { @Override public boolean isFileVisible(VirtualFile file, boolean showHiddenFiles) { return super.isFileVisible(file, showHiddenFiles) && (index == null || !index.isExcluded(file)); } }; List<VirtualFile> allContentRoots = new ArrayList<>(); for (final Module module: ModuleManager.getInstance(project).getModules()) { final VirtualFile[] moduleContentRoots = ModuleRootManager.getInstance(module).getContentRoots(); Collections.addAll(allContentRoots, moduleContentRoots); } descriptor.setRoots(allContentRoots); return new ExcludedEntriesConfigurable(project, descriptor, ValidationConfiguration.getExcludedEntriesConfiguration(project)); }