use of com.intellij.openapi.compiler.options.ExcludedEntriesConfigurable in project intellij-community by JetBrains.
the class GroovyCompilerConfigurable method createExcludedConfigurable.
private ExcludedEntriesConfigurable createExcludedConfigurable(final Project project) {
final ExcludesConfiguration configuration = myConfig.getExcludeFromStubGeneration();
final ProjectFileIndex index = 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.isExcluded(file);
}
};
descriptor.setRoots(ContainerUtil.concat(ContainerUtil.map(ModuleManager.getInstance(project).getModules(), new Function<Module, List<VirtualFile>>() {
@Override
public List<VirtualFile> fun(final Module module) {
return ModuleRootManager.getInstance(module).getSourceRoots(JavaModuleSourceRootTypes.SOURCES);
}
})));
return new ExcludedEntriesConfigurable(project, descriptor, configuration);
}
use of com.intellij.openapi.compiler.options.ExcludedEntriesConfigurable in project intellij-community by JetBrains.
the class ValidationConfigurable method createExcludedConfigurable.
private static ExcludedEntriesConfigurable createExcludedConfigurable(final Project project) {
final ExcludesConfiguration configuration = ValidationConfiguration.getExcludedEntriesConfiguration(project);
final ProjectFileIndex index = ProjectRootManager.getInstance(project).getFileIndex();
final FileChooserDescriptor descriptor = new FileChooserDescriptor(true, true, false, false, false, true) {
public boolean isFileVisible(VirtualFile file, boolean showHiddenFiles) {
return super.isFileVisible(file, showHiddenFiles) && (project.isDefault() || !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, configuration);
}
Aggregations