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

项目:intellij-ce-playground    文件:SingleRootFileViewProvider.java   
@Nullable
protected PsiFile createFile(@NotNull Project project, @NotNull VirtualFile file, @NotNull FileType fileType) {
  if (fileType.isBinary() || file.is(VFileProperty.SPECIAL)) {
    return new PsiBinaryFileImpl((PsiManagerImpl)getManager(), this);
  }
  if (!isTooLargeForIntelligence(file)) {
    final PsiFile psiFile = createFile(getBaseLanguage());
    if (psiFile != null) return psiFile;
  }

  if (isTooLargeForContentLoading(file)) {
    return new PsiLargeFileImpl((PsiManagerImpl)getManager(), this);
  }

  return new PsiPlainTextFileImpl(this);
}
项目:tools-idea    文件:SingleRootFileViewProvider.java   
@Nullable
protected PsiFile createFile(@NotNull Project project, @NotNull VirtualFile file, @NotNull FileType fileType) {
  if (fileType.isBinary() || file.is(VFileProperty.SPECIAL)) {
    return new PsiBinaryFileImpl((PsiManagerImpl)getManager(), this);
  }
  if (!isTooLargeForIntelligence(file)) {
    final PsiFile psiFile = createFile(getBaseLanguage());
    if (psiFile != null) return psiFile;
  }

  if (isTooLargeForContentLoading(file)) {
    return new PsiLargeFileImpl((PsiManagerImpl)getManager(), this);
  }

  return new PsiPlainTextFileImpl(this);
}
项目:consulo    文件:AbstractFileViewProvider.java   
@Nullable
protected PsiFile createFile(@Nonnull Project project, @Nonnull VirtualFile file, @Nonnull FileType fileType) {
  if (fileType.isBinary() || file.is(VFileProperty.SPECIAL)) {
    return SingleRootFileViewProvider.isTooLargeForContentLoading(file) ?
           new PsiLargeBinaryFileImpl((PsiManagerImpl)getManager(), this) :
           new PsiBinaryFileImpl((PsiManagerImpl)getManager(), this);
  }
  if (!SingleRootFileViewProvider.isTooLargeForIntelligence(file)) {
    final PsiFile psiFile = createFile(getBaseLanguage());
    if (psiFile != null) return psiFile;
  }

  if (SingleRootFileViewProvider.isTooLargeForContentLoading(file)) {
    return new PsiLargeTextFileImpl(this);
  }

  return new PsiPlainTextFileImpl(this);
}
项目:consulo-java    文件:ClassFileViewProvider.java   
@Override
protected PsiFile createFile(@NotNull Project project, @NotNull VirtualFile file, @NotNull FileType fileType)
{
    FileIndexFacade fileIndex = ServiceManager.getService(project, FileIndexFacade.class);
    if(!fileIndex.isInLibraryClasses(file) && fileIndex.isInSource(file) || fileIndex.isExcludedFile(file))
    {
        return new PsiBinaryFileImpl((PsiManagerImpl) getManager(), this);
    }

    // skip inner, anonymous, missing and corrupted classes
    try
    {
        if(!isInnerClass(file))
        {
            return new ClsFileImpl(this);
        }
    }
    catch(Exception e)
    {
        Logger.getInstance(ClassFileViewProvider.class).debug(file.getPath(), e);
    }

    return null;
}