本文整理汇总了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);
}
});
}
示例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);
}
});
}
示例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);
}
示例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);
}
});
}
示例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);
}
示例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 + ".";
}
示例7: createCorePackageIndex
import com.intellij.openapi.roots.PackageIndex; //导入依赖的package包/类
protected PackageIndex createCorePackageIndex() {
return new CorePackageIndex();
}