Search in sources :

Example 1 with ExcludedEntriesConfigurable

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);
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) ExcludedEntriesConfigurable(com.intellij.openapi.compiler.options.ExcludedEntriesConfigurable) ExcludesConfiguration(com.intellij.openapi.compiler.options.ExcludesConfiguration) ProjectFileIndex(com.intellij.openapi.roots.ProjectFileIndex) FileChooserDescriptor(com.intellij.openapi.fileChooser.FileChooserDescriptor) List(java.util.List) Module(com.intellij.openapi.module.Module)

Example 2 with ExcludedEntriesConfigurable

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);
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) ExcludedEntriesConfigurable(com.intellij.openapi.compiler.options.ExcludedEntriesConfigurable) ExcludesConfiguration(com.intellij.openapi.compiler.options.ExcludesConfiguration) ProjectFileIndex(com.intellij.openapi.roots.ProjectFileIndex) FileChooserDescriptor(com.intellij.openapi.fileChooser.FileChooserDescriptor) Module(com.intellij.openapi.module.Module)

Aggregations

ExcludedEntriesConfigurable (com.intellij.openapi.compiler.options.ExcludedEntriesConfigurable)2 ExcludesConfiguration (com.intellij.openapi.compiler.options.ExcludesConfiguration)2 FileChooserDescriptor (com.intellij.openapi.fileChooser.FileChooserDescriptor)2 Module (com.intellij.openapi.module.Module)2 ProjectFileIndex (com.intellij.openapi.roots.ProjectFileIndex)2 VirtualFile (com.intellij.openapi.vfs.VirtualFile)2 List (java.util.List)1