Java 类com.intellij.psi.impl.file.impl.JavaFileManager 实例源码

项目:intellij-ce-playground    文件:JavaCoreProjectEnvironment.java   
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);
}
项目:tools-idea    文件:JavaCoreProjectEnvironment.java   
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);
}
项目:lombok-intellij-plugin    文件:LombokElementFinder.java   
private PsiClass getPsiClassAndPreventRecursionCalls(@NotNull String parentName, @NotNull GlobalSearchScope scope) {
  final JavaFileManager javaFileManager = getServiceManager(scope);
  if (null == javaFileManager) {
    return null;
  }


  final PsiClass foundPsiClass;
  try {
    final boolean firstInvocation = recursionPrevention.get().add(parentName);
    if (firstInvocation) {
      foundPsiClass = javaFileManager.findClass(parentName, scope);
    } else {
      foundPsiClass = null;
    }
  } finally {
    recursionPrevention.get().remove(parentName);
  }
  return foundPsiClass;
}
项目:consulo-java    文件:JavaCoreProjectEnvironment.java   
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(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);

   PsiPackageManager manager = new PsiPackageManagerImpl(getProject(), DirectoryIndex.getInstance(getProject()));

   myProject.registerService(PsiPackageManager.class, manager);

   JavaPsiFacadeImpl javaPsiFacade = new JavaPsiFacadeImpl(myProject, manager);
   registerProjectComponent(JavaPsiFacade.class, javaPsiFacade);
   myProject.registerService(JavaPsiFacade.class, javaPsiFacade);
 }
项目:intellij-ce-playground    文件:JavaPsiFacadeImpl.java   
public JavaPsiFacadeImpl(Project project,
                         PsiManager psiManager,
                         JavaFileManager javaFileManager,
                         MessageBus bus) {
  myProject = project;
  myFileManager = javaFileManager;
  myConstantEvaluationHelper = new PsiConstantEvaluationHelperImpl();

  final PsiModificationTracker modificationTracker = psiManager.getModificationTracker();

  if (bus != null) {
    bus.connect().subscribe(PsiModificationTracker.TOPIC, new PsiModificationTracker.Listener() {
      private long lastTimeSeen = -1L;

      @Override
      public void modificationCountChanged() {
        myClassCache.clear();
        final long now = modificationTracker.getJavaStructureModificationCount();
        if (lastTimeSeen != now) {
          lastTimeSeen = now;
          myPackageCache.clear();
        }
      }
    });
  }

  DummyHolderFactory.setFactory(new JavaDummyHolderFactory());
}
项目:tools-idea    文件:JavaPsiFacadeImpl.java   
public JavaPsiFacadeImpl(Project project,
                         PsiManagerImpl psiManager,
                         JavaFileManager javaFileManager,
                         MessageBus bus) {
  myProject = project;
  myFileManager = javaFileManager;
  myNameHelper = new PsiNameHelperImpl(this);
  myConstantEvaluationHelper = new PsiConstantEvaluationHelperImpl();

  final PsiModificationTracker modificationTracker = psiManager.getModificationTracker();

  if (bus != null) {
    bus.connect().subscribe(PsiModificationTracker.TOPIC, new PsiModificationTracker.Listener() {
      private long lastTimeSeen = -1L;

      @Override
      public void modificationCountChanged() {
        final long now = modificationTracker.getJavaStructureModificationCount();
        if (lastTimeSeen != now) {
          lastTimeSeen = now;
          myPackageCache = null;
        }
      }
    });
  }

  DummyHolderFactory.setFactory(new JavaDummyHolderFactory());
  JavaElementType.ANNOTATION.getIndex(); // Initialize stubs.
}
项目:lombok-intellij-plugin    文件:LombokElementFinder.java   
JavaFileManager getServiceManager(GlobalSearchScope scope) {
  final Project project = scope.getProject();
  if (null == project) {
    return null;
  }
  return ServiceManager.getService(project, JavaFileManager.class);
}
项目:consulo-java    文件:JavaPsiFacadeImpl.java   
@Override
public boolean isPartOfPackagePrefix(@NotNull String packageName)
{
    final Collection<String> packagePrefixes = JavaFileManager.getInstance(myProject).getNonTrivialPackagePrefixes();
    for(final String subpackageName : packagePrefixes)
    {
        if(isSubpackageOf(subpackageName, packageName))
        {
            return true;
        }
    }
    return false;
}
项目:smcplugin    文件:SmcPsiUtil.java   
public static JavaFileManager getFileManager(Project project) {
    return new JavaFileManagerImpl(project);
}
项目:intellij-ce-playground    文件:PsiElementFinderImpl.java   
public PsiElementFinderImpl(Project project, JavaFileManager javaFileManager) {
  myProject = project;
  myFileManager = javaFileManager;
}
项目:intellij-ce-playground    文件:JavaCoreProjectEnvironment.java   
protected JavaFileManager createCoreFileManager() {
  return new CoreJavaFileManager(myPsiManager);
}
项目:tools-idea    文件:JavaCoreProjectEnvironment.java   
protected JavaFileManager createCoreFileManager() {
  return new CoreJavaFileManager(myPsiManager);
}
项目:consulo-java    文件:JavaPsiFacadeImpl.java   
@Override
public PsiClass findClass(@NotNull String qualifiedName, @NotNull GlobalSearchScope scope)
{
    return JavaFileManager.getInstance(myProject).findClass(qualifiedName, scope);
}
项目:consulo-java    文件:JavaPsiFacadeImpl.java   
@Override
@NotNull
public PsiClass[] findClasses(@NotNull String qualifiedName, @NotNull GlobalSearchScope scope)
{
    return JavaFileManager.getInstance(myProject).findClasses(qualifiedName, scope);
}
项目:consulo-java    文件:PsiJavaModuleReference.java   
private static Collection<PsiJavaModule> findModules(PsiFile file, String moduleName, boolean incompleteCode)
{
    Project project = file.getProject();
    GlobalSearchScope scope = incompleteCode ? GlobalSearchScope.allScope(project) : file.getResolveScope();
    return JavaFileManager.getInstance(project).findModules(moduleName, scope);
}
项目:consulo-java    文件:JavaCoreProjectEnvironment.java   
protected JavaFileManager createCoreFileManager() {
  return new CoreJavaFileManager(myPsiManager);
}