Package com.intellij.psi

Examples of com.intellij.psi.JavaPsiFacade.findClass()


      if (modifierList != null) {
        for (PsiAnnotation psiAnnotation : modifierList.getAnnotations()) {
          if (psiAnnotation != null && psiAnnotation.getQualifiedName() != null) {
            JavaPsiFacade psiFacade = JavaPsiFacade.getInstance(element.getProject());
            PsiClass psiClass = psiFacade.findClass(psiAnnotation.getQualifiedName(),
                GlobalSearchScope.projectScope(element.getProject()));

            if (hasAnnotation(psiClass, CLASS_QUALIFIER)) {
              qualifiedClasses.add(psiAnnotation.getQualifiedName());
            }
View Full Code Here


    PsiClassType psiClassType = (PsiClassType) psiFieldType;
    Project project = psiElement.getProject();
    JavaPsiFacade javaPsiFacade = JavaPsiFacade.getInstance(project);
    GlobalSearchScope globalSearchScope = GlobalSearchScope.allScope(project);

    PsiClass lazyClass = javaPsiFacade.findClass(CLASS_LAZY, globalSearchScope);
    PsiClass providerClass = javaPsiFacade.findClass(CLASS_PROVIDER, globalSearchScope);

    PsiClassType.ClassResolveResult classResolveResult = psiClassType.resolveGenerics();
    PsiClass outerClass = classResolveResult.getElement();
View Full Code Here

    Project project = psiElement.getProject();
    JavaPsiFacade javaPsiFacade = JavaPsiFacade.getInstance(project);
    GlobalSearchScope globalSearchScope = GlobalSearchScope.allScope(project);

    PsiClass lazyClass = javaPsiFacade.findClass(CLASS_LAZY, globalSearchScope);
    PsiClass providerClass = javaPsiFacade.findClass(CLASS_PROVIDER, globalSearchScope);

    PsiClassType.ClassResolveResult classResolveResult = psiClassType.resolveGenerics();
    PsiClass outerClass = classResolveResult.getElement();

    // If Lazy<Foo> or Provider<Foo>, extract Foo as the interesting type.
View Full Code Here

    public static boolean isLibraryPresent(@Nullable Module module) {
        if (module == null) {
            return false;
        }
        JavaPsiFacade psiFacade = JavaPsiFacade.getInstance(module.getProject());
        return psiFacade.findClass(Constants.WICKET_COMPONENT, WicketSearchScope.classInModuleWithDependenciesAndLibraries(module)) != null;
    }

    /**
     * @param element
     * @return true if element has WicketForgeFacet or is from library
View Full Code Here

    }
  }

  private void performSearch(final SearchScope searchScope, final String subscribeClassName) {
    JavaPsiFacade javaPsiFacade = JavaPsiFacade.getInstance(myProject);
    PsiClass subscribePsiClass = javaPsiFacade.findClass(subscribeClassName,
        GlobalSearchScope.allScope(myProject));
    if (subscribePsiClass == null) {
      // the guava or otto library isn't available in this project so do nothing
      return;
    }
View Full Code Here

          eventClasses = new HashSet<String>(allEventClasses);
        }
        JavaPsiFacade javaPsiFacade = JavaPsiFacade.getInstance(myProject);
        DaemonCodeAnalyzer codeAnalyzer = DaemonCodeAnalyzer.getInstance(myProject);
        for (String eventClass : eventClasses) {
          PsiClass eventPsiClass = javaPsiFacade.findClass(eventClass,
                GlobalSearchScope.allScope(myProject));
          if (eventPsiClass == null) continue;
          PsiFile psiFile = eventPsiClass.getContainingFile();
          if (psiFile == null) continue;
          codeAnalyzer.restart(psiFile);
View Full Code Here

  @Nullable
  public PsiMethod getBusPostMethod(Project project) {
    JavaPsiFacade javaPsiFacade = JavaPsiFacade.getInstance(project);
    GlobalSearchScope globalSearchScope = GlobalSearchScope.allScope(project);

    PsiClass busClass = javaPsiFacade.findClass(getBusClassName(), globalSearchScope);
    if (busClass != null) {
      for (PsiMethod psiMethod : busClass.getMethods()) {
        if (psiMethod.getName().equals("post")) {
          return psiMethod;
        }
View Full Code Here

    final Project project = module.getProject();
    final JavaPsiFacade facade = JavaPsiFacade.getInstance(project);
    final GlobalSearchScope moduleScope = GlobalSearchScope.moduleWithDependenciesAndLibrariesScope(module, false);

    // struts2-tiles plugin must be available
    final PsiClass strutsTilesListenerClass = facade.findClass(STRUTS_TILES_LISTENER_CLASS,
                                                               moduleScope);
    if (strutsTilesListenerClass == null) {
      return Collections.emptyList();
    }
View Full Code Here

    if (element instanceof PsiClass) {
      Module module = ModuleUtilCore.findModuleForPsiElement(element);
      if (module != null) {
        GlobalSearchScope scope = GlobalSearchScope.moduleWithDependenciesAndLibrariesScope(module);
        JavaPsiFacade facade = JavaPsiFacade.getInstance(element.getProject());
        PsiClass activatorClass = facade.findClass("org.osgi.framework.BundleActivator", scope);
        if (activatorClass != null && ((PsiClass)element).isInheritor(activatorClass, true)) {
          return false;
        }
      }
    }
View Full Code Here

                                                               moduleScope);
    if (strutsTilesListenerClass == null) {
      return Collections.emptyList();
    }

    final PsiClass tilesListenerClass = facade.findClass(TilesConstants.TILES_LISTENER, moduleScope);

    final StrutsPluginDomFactory<TilesDefinitions, TilesModel> factory =
        StrutsProjectComponent.getInstance(project).getTilesFactory();

    final Set<TilesModel> struts2TilesModels = new HashSet<TilesModel>();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.