com.intellij.openapi.fileTypes
Class LanguageFileType

java.lang.Object
  extended by com.intellij.openapi.fileTypes.LanguageFileType
All Implemented Interfaces:
FileType

public abstract class LanguageFileType
extends java.lang.Object
implements FileType

Kind of file types capable to provide Language.


Field Summary
 
Fields inherited from interface com.intellij.openapi.fileTypes.FileType
EMPTY_ARRAY
 
Constructor Summary
protected LanguageFileType(Language language)
          Creates a language file type for the specified language.
 
Method Summary
 java.lang.String getCharset(VirtualFile file)
          Returns the character set for the specified file.
 SyntaxHighlighter getHighlighter(Project project)
          Returns the syntax highlighter for the files of the type.
 Language getLanguage()
          Returns the language used in the files of the type.
 StructureViewBuilder getStructureViewBuilder(VirtualFile file, Project project)
          Returns the structure view builder for the specified file.
 boolean isBinary()
          Returns true if files of the specified type contain binary data.
 boolean isReadOnly()
          Returns true if the specified file type is read-only.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.intellij.openapi.fileTypes.FileType
getDefaultExtension, getDescription, getIcon, getName
 

Constructor Detail

LanguageFileType

protected LanguageFileType(@NotNull
                           Language language)
Creates a language file type for the specified language.

Parameters:
language - The language used in the files of the type.
Method Detail

getLanguage

@NotNull
public final Language getLanguage()
Returns the language used in the files of the type.

Returns:
The language instance.

getHighlighter

@NotNull
public final SyntaxHighlighter getHighlighter(@Nullable
                                                      Project project)
Returns the syntax highlighter for the files of the type.

Specified by:
getHighlighter in interface FileType
Parameters:
project - The project in which the highligher will work, or null if the highlighter is not tied to any project.
Returns:
The highlighter implementation.

getStructureViewBuilder

@Nullable
public StructureViewBuilder getStructureViewBuilder(@NotNull
                                                             VirtualFile file,
                                                             @NotNull
                                                             Project project)
Returns the structure view builder for the specified file.

Specified by:
getStructureViewBuilder in interface FileType
Parameters:
file - The file for which the structure view builder is requested.
project - The project to which the file belongs.
Returns:
The structure view builder, or null if no structure view is available for the file.

isBinary

public final boolean isBinary()
Description copied from interface: FileType
Returns true if files of the specified type contain binary data. Used for source control, to-do items scanning and other purposes.

Specified by:
isBinary in interface FileType
Returns:
true if the file is binary, false if the file is plain text.

isReadOnly

public final boolean isReadOnly()
Description copied from interface: FileType
Returns true if the specified file type is read-only. Read-only file types are not shown in the "File Types" settings dialog, and users cannot change the extensions associated with the file type.

Specified by:
isReadOnly in interface FileType
Returns:
true if the file type is read-only, false otherwise.

getCharset

public java.lang.String getCharset(VirtualFile file)
Description copied from interface: FileType
Returns the character set for the specified file.

Specified by:
getCharset in interface FileType
Parameters:
file - The file for which the character set is requested.
Returns:
The character set name, in the format supported by Charset class.