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

项目:intellij-ce-playground    文件:ExtensibleQueryFactory.java   
protected ExtensibleQueryFactory(@NonNls final String epNamespace) {
  myPoint = new NotNullLazyValue<SimpleSmartExtensionPoint<QueryExecutor<Result, Parameters>>>() {
    @Override
    @NotNull
    protected SimpleSmartExtensionPoint<QueryExecutor<Result, Parameters>> compute() {
      return new SimpleSmartExtensionPoint<QueryExecutor<Result, Parameters>>(new SmartList<QueryExecutor<Result, Parameters>>()){
        @Override
        @NotNull
        protected ExtensionPoint<QueryExecutor<Result, Parameters>> getExtensionPoint() {
          @NonNls String epName = ExtensibleQueryFactory.this.getClass().getName();
          int pos = epName.lastIndexOf('.');
          if (pos >= 0) {
            epName = epName.substring(pos+1);
          }
          epName = epNamespace + "." + StringUtil.decapitalize(epName);
          return Extensions.getRootArea().getExtensionPoint(epName);
        }
      };
    }
  };
}
项目:tools-idea    文件:ExtensibleQueryFactory.java   
protected ExtensibleQueryFactory(@NonNls final String epNamespace) {
  myPoint = new NotNullLazyValue<SimpleSmartExtensionPoint<QueryExecutor<Result, Parameters>>>() {
    @Override
    @NotNull
    protected SimpleSmartExtensionPoint<QueryExecutor<Result, Parameters>> compute() {
      return new SimpleSmartExtensionPoint<QueryExecutor<Result, Parameters>>(new SmartList<QueryExecutor<Result, Parameters>>()){
        @Override
        @NotNull
        protected ExtensionPoint<QueryExecutor<Result, Parameters>> getExtensionPoint() {
          @NonNls String epName = ExtensibleQueryFactory.this.getClass().getName();
          int pos = epName.lastIndexOf('.');
          if (pos >= 0) {
            epName = epName.substring(pos+1);
          }
          epName = epNamespace + "." + StringUtil.decapitalize(epName);
          return Extensions.getRootArea().getExtensionPoint(epName);
        }
      };
    }
  };
}
项目:consulo    文件:ExtensibleQueryFactory.java   
protected ExtensibleQueryFactory(@NonNls final String epNamespace) {
  myPoint = new NotNullLazyValue<SimpleSmartExtensionPoint<QueryExecutor<Result, Parameters>>>() {
    @Override
    @Nonnull
    protected SimpleSmartExtensionPoint<QueryExecutor<Result, Parameters>> compute() {
      return new SimpleSmartExtensionPoint<QueryExecutor<Result, Parameters>>(new SmartList<QueryExecutor<Result, Parameters>>()){
        @Override
        @Nonnull
        protected ExtensionPoint<QueryExecutor<Result, Parameters>> getExtensionPoint() {
          @NonNls String epName = ExtensibleQueryFactory.this.getClass().getName();
          int pos = epName.lastIndexOf('.');
          if (pos >= 0) {
            epName = epName.substring(pos+1);
          }
          epName = epNamespace + "." + StringUtil.decapitalize(epName);
          return Extensions.getRootArea().getExtensionPoint(epName);
        }
      };
    }
  };
}
项目:intellij-ce-playground    文件:ClassesWithAnnotatedMembersSearcher.java   
@Override
public void processQuery(@NotNull ClassesWithAnnotatedMembersSearch.Parameters queryParameters,
                         @NotNull final Processor<PsiClass> consumer) {
  SearchScope scope = queryParameters.getScope();
  for (QueryExecutor executor : Extensions.getExtensions(ClassesWithAnnotatedMembersSearch.EP_NAME)) {
    if (executor instanceof ScopedQueryExecutor) {
      scope = scope.intersectWith(GlobalSearchScope.notScope(((ScopedQueryExecutor) executor).getScope(queryParameters)));
    }
  }

  final Set<PsiClass> processed = new HashSet<PsiClass>();
  AnnotatedElementsSearch.searchPsiMembers(queryParameters.getAnnotationClass(), scope).forEach(new Processor<PsiMember>() {
    @Override
    public boolean process(PsiMember member) {
      PsiClass psiClass;
      AccessToken token = ReadAction.start();
      try {
        psiClass = member instanceof PsiClass ? (PsiClass)member : member.getContainingClass();
      }
      finally {
        token.finish();
      }

      if (psiClass != null && processed.add(psiClass)) {
        consumer.process(psiClass);
      }

      return true;
    }
  });
}
项目:intellij-ce-playground    文件:ExtensibleQueryFactory.java   
public void registerExecutor(final QueryExecutor<Result, Parameters> queryExecutor, Disposable parentDisposable) {
  registerExecutor(queryExecutor);
  Disposer.register(parentDisposable, new Disposable() {
    @Override
    public void dispose() {
      unregisterExecutor(queryExecutor);
    }
  });
}
项目:tools-idea    文件:ExtensibleQueryFactory.java   
public void registerExecutor(final QueryExecutor<Result, Parameters> queryExecutor, Disposable parentDisposable) {
  registerExecutor(queryExecutor);
  Disposer.register(parentDisposable, new Disposable() {
    @Override
    public void dispose() {
      unregisterExecutor(queryExecutor);
    }
  });
}
项目:consulo    文件:ExtensibleQueryFactory.java   
public void registerExecutor(final QueryExecutor<Result, Parameters> queryExecutor, Disposable parentDisposable) {
  registerExecutor(queryExecutor);
  Disposer.register(parentDisposable, new Disposable() {
    @Override
    public void dispose() {
      unregisterExecutor(queryExecutor);
    }
  });
}
项目:consulo-java    文件:ClassesWithAnnotatedMembersSearcher.java   
@Override
public void processQuery(@NotNull ClassesWithAnnotatedMembersSearch.Parameters queryParameters, @NotNull final Processor<PsiClass> consumer)
{
    SearchScope scope = queryParameters.getScope();
    for(QueryExecutor executor : Extensions.getExtensions(ClassesWithAnnotatedMembersSearch.EP_NAME))
    {
        if(executor instanceof ScopedQueryExecutor)
        {
            scope = scope.intersectWith(GlobalSearchScope.notScope(((ScopedQueryExecutor) executor).getScope(queryParameters)));
        }
    }

    final Set<PsiClass> processed = new HashSet<>();
    AnnotatedElementsSearch.searchPsiMembers(queryParameters.getAnnotationClass(), scope).forEach(member ->
    {
        PsiClass psiClass;
        AccessToken token = ReadAction.start();
        try
        {
            psiClass = member instanceof PsiClass ? (PsiClass) member : member.getContainingClass();
        }
        finally
        {
            token.finish();
        }

        if(psiClass != null && processed.add(psiClass))
        {
            consumer.process(psiClass);
        }

        return true;
    });
}
项目:intellij-ce-playground    文件:JavaCoreApplicationEnvironment.java   
public JavaCoreApplicationEnvironment(@NotNull Disposable parentDisposable) {
  super(parentDisposable);

  registerFileType(JavaClassFileType.INSTANCE, "class");
  registerFileType(JavaFileType.INSTANCE, "java");
  registerFileType(ArchiveFileType.INSTANCE, "jar;zip");
  registerFileType(PlainTextFileType.INSTANCE, "txt;sh;bat;cmd;policy;log;cgi;MF;jad;jam;htaccess");

  addExplicitExtension(LanguageASTFactory.INSTANCE, PlainTextLanguage.INSTANCE, new PlainTextASTFactory());
  addExplicitExtension(LanguageParserDefinitions.INSTANCE, PlainTextLanguage.INSTANCE, new PlainTextParserDefinition());

  addExplicitExtension(FileTypeFileViewProviders.INSTANCE, JavaClassFileType.INSTANCE,  new ClassFileViewProviderFactory());
  addExplicitExtension(BinaryFileStubBuilders.INSTANCE, JavaClassFileType.INSTANCE, new ClassFileStubBuilder());

  addExplicitExtension(LanguageASTFactory.INSTANCE, JavaLanguage.INSTANCE, new CoreJavaASTFactory());
  addExplicitExtension(LanguageParserDefinitions.INSTANCE, JavaLanguage.INSTANCE, new JavaParserDefinition());
  addExplicitExtension(LanguageConstantExpressionEvaluator.INSTANCE, JavaLanguage.INSTANCE, new PsiExpressionEvaluator());

  addExtension(ContainerProvider.EP_NAME, new JavaContainerProvider());

  myApplication.registerService(PsiPackageImplementationHelper.class, new CorePsiPackageImplementationHelper());

  myApplication.registerService(EmptySubstitutor.class, new EmptySubstitutorImpl());
  myApplication.registerService(JavaDirectoryService.class, createJavaDirectoryService());
  myApplication.registerService(JavaVersionService.class, new JavaVersionService());

  addExplicitExtension(ItemPresentationProviders.INSTANCE, PsiPackage.class, new PackagePresentationProvider());
  addExplicitExtension(ItemPresentationProviders.INSTANCE, PsiClass.class, new ClassPresentationProvider());
  addExplicitExtension(ItemPresentationProviders.INSTANCE, PsiMethod.class, new MethodPresentationProvider());
  addExplicitExtension(ItemPresentationProviders.INSTANCE, PsiField.class, new FieldPresentationProvider());
  addExplicitExtension(ItemPresentationProviders.INSTANCE, PsiLocalVariable.class, new VariablePresentationProvider());
  addExplicitExtension(ItemPresentationProviders.INSTANCE, PsiParameter.class, new VariablePresentationProvider());

  registerApplicationService(JavaCodeFoldingSettings.class, new JavaCodeFoldingSettingsBase());
  addExplicitExtension(LanguageFolding.INSTANCE, JavaLanguage.INSTANCE, new JavaFoldingBuilderBase() {
    @Override
    protected boolean shouldShowExplicitLambdaType(PsiAnonymousClass anonymousClass, PsiNewExpression expression) {
      return false;
    }

    @Override
    protected boolean isBelowRightMargin(Project project, int lineLength) {
      return false;
    }
  });

  registerApplicationExtensionPoint(SuperMethodsSearch.EP_NAME, QueryExecutor.class);
  addExtension(SuperMethodsSearch.EP_NAME, new MethodSuperSearcher());
}
项目:intellij-ce-playground    文件:ExtensibleQueryFactory.java   
@Override
public void registerExecutor(@NotNull final QueryExecutor<Result, Parameters> queryExecutor) {
  myPoint.getValue().addExplicitExtension(queryExecutor);
}
项目:intellij-ce-playground    文件:ExtensibleQueryFactory.java   
@Override
public void unregisterExecutor(@NotNull final QueryExecutor<Result, Parameters> queryExecutor) {
  myPoint.getValue().removeExplicitExtension(queryExecutor);
}
项目:intellij-ce-playground    文件:ExtensibleQueryFactory.java   
@Override
@NotNull
protected List<QueryExecutor<Result, Parameters>> getExecutors() {
  return myPoint.getValue().getExtensions();
}
项目:tools-idea    文件:ExtensibleQueryFactory.java   
@Override
public void registerExecutor(@NotNull final QueryExecutor<Result, Parameters> queryExecutor) {
  myPoint.getValue().addExplicitExtension(queryExecutor);
}
项目:tools-idea    文件:ExtensibleQueryFactory.java   
@Override
public void unregisterExecutor(@NotNull final QueryExecutor<Result, Parameters> queryExecutor) {
  myPoint.getValue().removeExplicitExtension(queryExecutor);
}
项目:tools-idea    文件:ExtensibleQueryFactory.java   
@Override
@NotNull
protected List<QueryExecutor<Result, Parameters>> getExecutors() {
  return myPoint.getValue().getExtensions();
}
项目:consulo    文件:ExtensibleQueryFactory.java   
@Override
public void registerExecutor(@Nonnull final QueryExecutor<Result, Parameters> queryExecutor) {
  myPoint.getValue().addExplicitExtension(queryExecutor);
}
项目:consulo    文件:ExtensibleQueryFactory.java   
@Override
public void unregisterExecutor(@Nonnull final QueryExecutor<Result, Parameters> queryExecutor) {
  myPoint.getValue().removeExplicitExtension(queryExecutor);
}
项目:consulo    文件:ExtensibleQueryFactory.java   
@Override
@Nonnull
protected List<QueryExecutor<Result, Parameters>> getExecutors() {
  return myPoint.getValue().getExtensions();
}