Java 类com.intellij.openapi.fileTypes.CharsetUtil 实例源码

项目:rythm_plugin    文件:RythmFileType.java   
public Charset extractCharsetFromFileContent(@org.jetbrains.annotations.Nullable final Project project,
                                             @org.jetbrains.annotations.Nullable final VirtualFile file,
                                             @org.jetbrains.annotations.NotNull final CharSequence content) {
    LanguageFileType associatedFileType = getAssociatedFileType(file, project);

    if (associatedFileType == null) {
        return null;
    }

    return CharsetUtil.extractCharsetFromFileContent(project, file, associatedFileType, content);
}
项目:GoJetPlugin    文件:JetFileType.java   
public Charset extractCharsetFromFileContent(@Nullable final Project project,
                                             @Nullable final VirtualFile file,
                                             @NotNull final CharSequence content) {
    LanguageFileType associatedFileType = getAssociatedFileType(file, project);

    if (associatedFileType == null) {
        return null;
    }

    return CharsetUtil.extractCharsetFromFileContent(project, file, associatedFileType, content);
}
项目:intellij-ce-playground    文件:LightVirtualFile.java   
public LightVirtualFile(@NotNull String name, final FileType fileType, @NotNull CharSequence text, final long modificationStamp) {
  this(name, fileType, text, CharsetUtil.extractCharsetFromFileContent(null, null, fileType, text), modificationStamp);
}
项目:intellij-ce-playground    文件:LoadTextUtil.java   
@Nullable("returns null if cannot determine from content")
public static Charset charsetFromContentOrNull(@Nullable Project project, @NotNull VirtualFile virtualFile, @NotNull CharSequence text) {
  return CharsetUtil.extractCharsetFromFileContent(project, virtualFile, virtualFile.getFileType(), text);
}
项目:consulo    文件:LightVirtualFile.java   
public LightVirtualFile(@Nonnull String name, final FileType fileType, @Nonnull CharSequence text, final long modificationStamp) {
  this(name, fileType, text, CharsetUtil.extractCharsetFromFileContent(null, null, fileType, text), modificationStamp);
}
项目:consulo    文件:LoadTextUtil.java   
@Nullable
public static Charset charsetFromContentOrNull(@Nullable Project project, @Nonnull VirtualFile virtualFile, @Nonnull CharSequence text) {
  return CharsetUtil.extractCharsetFromFileContent(project, virtualFile, virtualFile.getFileType(), text);
}