当前位置: 首页>>代码示例>>Java>>正文


Java PackageIndex类代码示例

本文整理汇总了Java中com.intellij.openapi.roots.PackageIndex的典型用法代码示例。如果您正苦于以下问题:Java PackageIndex类的具体用法?Java PackageIndex怎么用?Java PackageIndex使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PackageIndex类属于com.intellij.openapi.roots包,在下文中一共展示了PackageIndex类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: processPackageDirectories

import com.intellij.openapi.roots.PackageIndex; //导入依赖的package包/类
@Override
public boolean processPackageDirectories(@NotNull PsiPackage psiPackage,
                                         @NotNull final GlobalSearchScope scope,
                                         @NotNull final Processor<PsiDirectory> consumer,
                                         boolean includeLibrarySources) {
  //System.out.println( "processDirectories() : " + psiPackage + " : " + scope );

  final PsiManager psiManager = PsiManager.getInstance( _project );
  return PackageIndex.getInstance( _project )
    .getDirsByPackageName(psiPackage.getQualifiedName(), includeLibrarySources)
    .forEach(new ReadActionProcessor<VirtualFile>() {
      @Override
      public boolean processInReadAction(final VirtualFile dir) {
        if (!scope.contains(dir)) return true;
        PsiDirectory psiDir = psiManager.findDirectory(dir);
        return psiDir == null || consumer.process(psiDir);
      }
    });
}
 
开发者ID:manifold-systems,项目名称:manifold-ij,代码行数:20,代码来源:ManTypeFinder.java

示例2: processPackageDirectories

import com.intellij.openapi.roots.PackageIndex; //导入依赖的package包/类
@Override
public boolean processPackageDirectories(@NotNull PsiPackage psiPackage,
                                         @NotNull final GlobalSearchScope scope,
                                         @NotNull final Processor<PsiDirectory> consumer,
                                         boolean includeLibrarySources) {
  final PsiManager psiManager = PsiManager.getInstance(myProject);
  return PackageIndex.getInstance(myProject)
    .getDirsByPackageName(psiPackage.getQualifiedName(), includeLibrarySources)
    .forEach(new ReadActionProcessor<VirtualFile>() {
      @Override
      public boolean processInReadAction(final VirtualFile dir) {
        if (!scope.contains(dir)) return true;
        PsiDirectory psiDir = psiManager.findDirectory(dir);
        return psiDir == null || consumer.process(psiDir);
      }
    });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:PsiElementFinderImpl.java

示例3: JavaCoreProjectEnvironment

import com.intellij.openapi.roots.PackageIndex; //导入依赖的package包/类
public JavaCoreProjectEnvironment(Disposable parentDisposable, CoreApplicationEnvironment applicationEnvironment) {
  super(parentDisposable, applicationEnvironment);

  myProject.registerService(PsiElementFactory.class, new PsiElementFactoryImpl(myPsiManager));
  myProject.registerService(JavaPsiImplementationHelper.class, createJavaPsiImplementationHelper());
  myProject.registerService(PsiResolveHelper.class, new PsiResolveHelperImpl(myPsiManager));
  myProject.registerService(LanguageLevelProjectExtension.class, new CoreLanguageLevelProjectExtension());
  myProject.registerService(JavaResolveCache.class, new JavaResolveCache(myMessageBus));
  myProject.registerService(JavaCodeStyleSettingsFacade.class, new CoreJavaCodeStyleSettingsFacade());
  myProject.registerService(JavaCodeStyleManager.class, new CoreJavaCodeStyleManager());

  myPackageIndex = createCorePackageIndex();
  myProject.registerService(PackageIndex.class, myPackageIndex);

  myFileManager = createCoreFileManager();
  myProject.registerService(JavaFileManager.class, myFileManager);

  JavaPsiFacadeImpl javaPsiFacade = new JavaPsiFacadeImpl(myProject, myPsiManager, myFileManager, myMessageBus);
  myProject.registerService(JavaPsiFacade.class, javaPsiFacade);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:JavaCoreProjectEnvironment.java

示例4: processPackageDirectories

import com.intellij.openapi.roots.PackageIndex; //导入依赖的package包/类
@Override
public boolean processPackageDirectories(@NotNull PsiPackage psiPackage,
                                         @NotNull final GlobalSearchScope scope,
                                         @NotNull final Processor<PsiDirectory> consumer,
                                         boolean includeLibrarySources) {
  final PsiManager psiManager = PsiManager.getInstance(getProject());
  return PackageIndex.getInstance(getProject()).getDirsByPackageName(psiPackage.getQualifiedName(), includeLibrarySources)
    .forEach(new ReadActionProcessor<VirtualFile>() {
      @Override
      public boolean processInReadAction(final VirtualFile dir) {
        if (!scope.contains(dir)) return true;
        PsiDirectory psiDir = psiManager.findDirectory(dir);
        return psiDir == null || consumer.process(psiDir);
      }
    });
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:JavaPsiFacadeImpl.java

示例5: JavaCoreProjectEnvironment

import com.intellij.openapi.roots.PackageIndex; //导入依赖的package包/类
public JavaCoreProjectEnvironment(Disposable parentDisposable, CoreApplicationEnvironment applicationEnvironment) {
  super(parentDisposable, applicationEnvironment);

  myProject.registerService(PsiElementFactory.class, new PsiElementFactoryImpl(myPsiManager));
  myProject.registerService(JavaPsiImplementationHelper.class, createJavaPsiImplementationHelper());
  myProject.registerService(PsiResolveHelper.class, new PsiResolveHelperImpl(myPsiManager));
  myProject.registerService(LanguageLevelProjectExtension.class, new CoreLanguageLevelProjectExtension());
  myProject.registerService(JavaResolveCache.class, new JavaResolveCache(myMessageBus));
  myProject.registerService(JavaCodeStyleSettingsFacade.class, new CoreJavaCodeStyleSettingsFacade());
  myProject.registerService(JavaCodeStyleManager.class, new CoreJavaCodeStyleManager());
  registerProjectExtensionPoint(PsiElementFinder.EP_NAME, PsiElementFinder.class);

  myPackageIndex = createCorePackageIndex();
  myProject.registerService(PackageIndex.class, myPackageIndex);

  myFileManager = createCoreFileManager();
  myProject.registerService(JavaFileManager.class, myFileManager);

  JavaPsiFacadeImpl javaPsiFacade = new JavaPsiFacadeImpl(myProject, myPsiManager, myFileManager, myMessageBus);
  registerProjectComponent(JavaPsiFacade.class, javaPsiFacade);
  myProject.registerService(JavaPsiFacade.class, javaPsiFacade);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:23,代码来源:JavaCoreProjectEnvironment.java

示例6: PackageScope

import com.intellij.openapi.roots.PackageIndex; //导入依赖的package包/类
public PackageScope(@NotNull PsiPackage aPackage, boolean includeSubpackages, final boolean includeLibraries) {
  super(aPackage.getProject());
  myPackage = aPackage;
  myIncludeSubpackages = includeSubpackages;

  Project project = myPackage.getProject();
  myPackageQualifiedName = myPackage.getQualifiedName();
  myDirs = PackageIndex.getInstance(project).getDirsByPackageName(myPackageQualifiedName, true).findAll();
  myIncludeLibraries = includeLibraries;

  myPartOfPackagePrefix = JavaPsiFacade.getInstance(getProject()).isPartOfPackagePrefix(myPackageQualifiedName);
  myPackageQNamePrefix = myPackageQualifiedName + ".";
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:PackageScope.java

示例7: createCorePackageIndex

import com.intellij.openapi.roots.PackageIndex; //导入依赖的package包/类
protected PackageIndex createCorePackageIndex() {
  return new CorePackageIndex();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:JavaCoreProjectEnvironment.java


注:本文中的com.intellij.openapi.roots.PackageIndex类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。