Java 类com.intellij.psi.search.scope.packageSet.AbstractPackageSet 实例源码

项目:consulo    文件:TestResourcesScope.java   
public TestResourcesScope() {
  super(NAME, new AbstractPackageSet("test-rsc:*..*") {
    @Override
    public boolean contains(VirtualFile file, NamedScopesHolder holder) {
      final ProjectFileIndex index = ProjectRootManager.getInstance(holder.getProject()).getFileIndex();
      return file != null && index.isInTestResource(file);
    }
  });
}
项目:consulo    文件:ResourcesScope.java   
public ResourcesScope() {
  super(NAME, new AbstractPackageSet("rsc:*..*") {
    @Override
    public boolean contains(VirtualFile file, NamedScopesHolder holder) {
      final ProjectFileIndex index = ProjectRootManager.getInstance(holder.getProject()).getFileIndex();
      return file != null && index.isInResource(file);
    }
  });
}
项目:consulo    文件:SourcesScope.java   
public SourcesScope() {
  super(NAME, new AbstractPackageSet("src:*..*") {
    @Override
    public boolean contains(VirtualFile file, NamedScopesHolder holder) {
      final ProjectFileIndex index = ProjectRootManager.getInstance(holder.getProject()).getFileIndex();
      return file != null && index.isInSource(file);
    }
  });
}
项目:consulo    文件:TestsScope.java   
public TestsScope() {
  super(NAME, new AbstractPackageSet("test:*..*") {
    @Override
    public boolean contains(VirtualFile file, NamedScopesHolder holder) {
      final ProjectFileIndex index = ProjectRootManager.getInstance(holder.getProject()).getFileIndex();
      return file != null && index.isInTestSourceContent(file);
    }
  });
}
项目:consulo    文件:ProjectProductionScope.java   
public ProjectProductionScope() {
  super(IdeBundle.message("predefined.scope.production.name"), new AbstractPackageSet("project:*..*") {
    @Override
    public boolean contains(VirtualFile file, NamedScopesHolder holder) {
      final ProjectFileIndex index = ProjectRootManager.getInstance(holder.getProject()).getFileIndex();
      return file != null
             && !index.isInTestSourceContent(file)
             && !index.isInLibraryClasses(file)
             && !index.isInLibrarySource(file);
    }
  });
}