Java 类com.intellij.util.CollectionQuery 实例源码

项目:consulo-javascript    文件:JavaScriptLineMarkerProvider.java   
public static Query<JSFunction> doFindOverridenFunctionStatic(final JSFunction elt)
{
    PsiElement parent = JSResolveUtil.findParent(elt);
    if(parent instanceof JSClass)
    {
        return JSFunctionsSearch.searchOverridingFunctions(elt, true);
    }
    final String qName = JSResolveUtil.getQNameToStartHierarchySearch(elt);
    if(qName != null)
    {
        final ArrayList<JSFunction> result = new ArrayList<JSFunction>();

        return new CollectionQuery<JSFunction>(result);
    }

    return new CollectionQuery<JSFunction>(Collections.<JSFunction>emptyList());
}
项目:intellij-ce-playground    文件:RootIndex.java   
@NotNull
public Query<VirtualFile> getDirectoriesByPackageName(@NotNull final String packageName, final boolean includeLibrarySources) {
  // Note that this method is used in upsource as well, hence, don't reduce this method's visibility.
  List<VirtualFile> result = myPackageDirectoryCache.getDirectoriesByPackageName(packageName);
  if (!includeLibrarySources) {
    result = ContainerUtil.filter(result, new Condition<VirtualFile>() {
      @Override
      public boolean value(VirtualFile file) {
        DirectoryInfo info = getInfoForFile(file);
        return info.isInProject() && (!info.isInLibrarySource() || info.isInModuleSource() || info.hasLibraryClassRoot());
      }
    });
  }
  return new CollectionQuery<VirtualFile>(result);
}
项目:intellij-ce-playground    文件:PyLineMarkerProvider.java   
@Nullable
protected Query<PsiElement> search(final PsiElement elt) {
  List<PsiElement> result = new ArrayList<PsiElement>();
  PyClass containingClass = PsiTreeUtil.getParentOfType(elt, PyClass.class);
  if (containingClass != null && elt instanceof PyTargetExpression) {
    for (PyClass ancestor : containingClass.getAncestorClasses(null)) {
      final PyTargetExpression attribute = ancestor.findClassAttribute(((PyTargetExpression)elt).getReferencedName(), false);
      if (attribute != null) {
        result.add(attribute);
      }
    }
  }
  return new CollectionQuery<PsiElement>(result);
}
项目:intellij-ce-playground    文件:CorePackageIndex.java   
@Override
public Query<VirtualFile> getDirsByPackageName(@NotNull String packageName, boolean includeLibrarySources) {
  return new CollectionQuery<VirtualFile>(findDirectoriesByPackageName(packageName));
}
项目:tools-idea    文件:CorePackageIndex.java   
@Override
public Query<VirtualFile> getDirsByPackageName(@NotNull String packageName, boolean includeLibrarySources) {
  return new CollectionQuery<VirtualFile>(findDirectoriesByPackageName(packageName));
}