Java 类com.intellij.psi.filters.element.ModifierFilter 实例源码

项目:consulo-java    文件:JavaCompletionContributor.java   
private static ElementFilter createAnnotationFilter(PsiElement position)
{
    OrFilter orFilter = new OrFilter(ElementClassFilter.CLASS, ElementClassFilter.PACKAGE_FILTER, new AndFilter(new ClassFilter(PsiField.class), new ModifierFilter(PsiModifier.STATIC,
            PsiModifier.FINAL)));
    if(psiElement().insideStarting(psiNameValuePair()).accepts(position))
    {
        orFilter.addFilter(new ClassFilter(PsiAnnotationMethod.class)
        {
            @Override
            public boolean isAcceptable(Object element, PsiElement context)
            {
                return element instanceof PsiAnnotationMethod && PsiUtil.isAnnotationMethod((PsiElement) element);
            }
        });
    }
    return orFilter;
}
项目:intellij-ce-playground    文件:JavaCompletionContributor.java   
private static ElementFilter createAnnotationFilter(PsiElement position) {
  OrFilter orFilter = new OrFilter(ElementClassFilter.CLASS,
                                 ElementClassFilter.PACKAGE_FILTER,
                                 new AndFilter(new ClassFilter(PsiField.class),
                                               new ModifierFilter(PsiModifier.STATIC, PsiModifier.FINAL)));
  if (psiElement().insideStarting(psiNameValuePair()).accepts(position)) {
    orFilter.addFilter(new ClassFilter(PsiAnnotationMethod.class) {
      @Override
      public boolean isAcceptable(Object element, PsiElement context) {
        return element instanceof PsiAnnotationMethod && PsiUtil.isAnnotationMethod((PsiElement)element);
      }
    });
  }
  return orFilter;
}
项目:tools-idea    文件:JavaCompletionContributor.java   
private static ElementFilter createAnnotationFilter(PsiElement position) {
  OrFilter orFilter = new OrFilter(ElementClassFilter.CLASS,
                                 ElementClassFilter.PACKAGE_FILTER,
                                 new AndFilter(new ClassFilter(PsiField.class),
                                               new ModifierFilter(PsiModifier.STATIC, PsiModifier.FINAL)));
  if (psiElement().insideStarting(psiNameValuePair()).accepts(position)) {
    orFilter.addFilter(new ClassFilter(PsiAnnotationMethod.class) {
      @Override
      public boolean isAcceptable(Object element, PsiElement context) {
        return element instanceof PsiAnnotationMethod && PsiUtil.isAnnotationMethod((PsiElement)element);
      }
    });
  }
  return orFilter;
}