com.intellij.openapi.fileTypes
Class UserFileType<T extends UserFileType>

java.lang.Object
  extended by com.intellij.openapi.fileTypes.UserFileType<T>
All Implemented Interfaces:
FileType, java.lang.Cloneable
Direct Known Subclasses:
UserBinaryFileType

public abstract class UserFileType<T extends UserFileType>
extends java.lang.Object
implements FileType, java.lang.Cloneable


Field Summary
 
Fields inherited from interface com.intellij.openapi.fileTypes.FileType
EMPTY_ARRAY
 
Constructor Summary
UserFileType()
           
 
Method Summary
 UserFileType clone()
           
 void copyFrom(UserFileType newType)
           
 java.lang.String getCharset(VirtualFile file)
          Returns the character set for the specified file.
 java.lang.String getDefaultExtension()
          Returns the default extension for files of the type.
 java.lang.String getDescription()
          Returns the user-readable description of the file type.
abstract  SettingsEditor<T> getEditor()
           
 javax.swing.Icon getIcon()
          Returns the icon used for showing files of the type.
 Language getLanguage()
           
 java.lang.String getName()
          Returns the name of the file type.
 StructureViewBuilder getStructureViewBuilder(VirtualFile file, Project project)
          Returns the structure view builder for the specified file.
 boolean isReadOnly()
          Returns true if the specified file type is read-only.
 void setDescription(java.lang.String description)
           
 void setIcon(javax.swing.Icon icon)
           
 void setName(java.lang.String name)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.intellij.openapi.fileTypes.FileType
getHighlighter, isBinary
 

Constructor Detail

UserFileType

public UserFileType()
Method Detail

getEditor

public abstract SettingsEditor<T> getEditor()

clone

public UserFileType clone()
Overrides:
clone in class java.lang.Object

getName

public java.lang.String getName()
Description copied from interface: FileType
Returns the name of the file type. The name must be unique among all file types registered in the system.

Specified by:
getName in interface FileType
Returns:
The file type name.

getDescription

public java.lang.String getDescription()
Description copied from interface: FileType
Returns the user-readable description of the file type.

Specified by:
getDescription in interface FileType
Returns:
The file type description.

setName

public void setName(java.lang.String name)

setDescription

public void setDescription(java.lang.String description)

getDefaultExtension

public java.lang.String getDefaultExtension()
Description copied from interface: FileType
Returns the default extension for files of the type.

Specified by:
getDefaultExtension in interface FileType
Returns:
The extension, not including the leading '.'.

getIcon

public javax.swing.Icon getIcon()
Description copied from interface: FileType
Returns the icon used for showing files of the type.

Specified by:
getIcon in interface FileType
Returns:
The icon instance, or null if no icon should be shown.

isReadOnly

public 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.

copyFrom

public void copyFrom(UserFileType newType)

setIcon

public void setIcon(javax.swing.Icon icon)

getStructureViewBuilder

public StructureViewBuilder getStructureViewBuilder(VirtualFile file,
                                                    Project project)
Description copied from interface: FileType
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.

getLanguage

public Language getLanguage()