public class EncodingManagerImpl extends EncodingManager implements PersistentStateComponent<com.intellij.openapi.vfs.encoding.EncodingManagerImpl.State>, Disposable
Disposable.Parent
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PROP_CACHED_ENCODING_CHANGED |
PROP_NATIVE2ASCII_SWITCH, PROP_PROPERTIES_FILES_ENCODING
Constructor and Description |
---|
EncodingManagerImpl() |
Modifier and Type | Method and Description |
---|---|
void |
clearDocumentQueue() |
void |
dispose()
Usually not invoked directly, see class javadoc.
|
java.nio.charset.Charset |
getCachedCharsetFromContent(Document document) |
java.nio.charset.Charset |
getDefaultCharset() |
java.nio.charset.Charset |
getDefaultCharsetForPropertiesFiles(VirtualFile virtualFile) |
java.lang.String |
getDefaultCharsetName() |
java.nio.charset.Charset |
getEncoding(VirtualFile virtualFile,
boolean useParentDefaults) |
java.util.Collection<java.nio.charset.Charset> |
getFavorites() |
com.intellij.openapi.vfs.encoding.EncodingManagerImpl.State |
getState() |
boolean |
isNative2Ascii(VirtualFile virtualFile) |
boolean |
isNative2AsciiForPropertiesFiles() |
void |
loadState(com.intellij.openapi.vfs.encoding.EncodingManagerImpl.State state)
This method is called when new component state is loaded.
|
void |
setDefaultCharsetForPropertiesFiles(VirtualFile virtualFile,
java.nio.charset.Charset charset) |
void |
setDefaultCharsetName(java.lang.String name) |
void |
setEncoding(VirtualFile virtualFileOrDir,
java.nio.charset.Charset charset) |
void |
setNative2AsciiForPropertiesFiles(VirtualFile virtualFile,
boolean native2Ascii) |
getInstance, shouldAddBOMForNewUtf8File
doActionAndRestoreEncoding
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
initializeComponent, noStateLoaded
public static final java.lang.String PROP_CACHED_ENCODING_CHANGED
public void dispose()
Disposable
dispose
in interface Disposable
public java.nio.charset.Charset getCachedCharsetFromContent(Document document)
getCachedCharsetFromContent
in class EncodingManager
public com.intellij.openapi.vfs.encoding.EncodingManagerImpl.State getState()
getState
in interface PersistentStateComponent<com.intellij.openapi.vfs.encoding.EncodingManagerImpl.State>
null
value indicates
that the returned state won't be stored, as a result previously stored state will be used.XmlSerializer
public void loadState(com.intellij.openapi.vfs.encoding.EncodingManagerImpl.State state)
PersistentStateComponent
State object should be used directly, defensive copying is not required.
loadState
in interface PersistentStateComponent<com.intellij.openapi.vfs.encoding.EncodingManagerImpl.State>
state
- loaded component stateXmlSerializerUtil.copyBean(Object, Object)
public java.util.Collection<java.nio.charset.Charset> getFavorites()
getFavorites
in class EncodingManager
public java.nio.charset.Charset getEncoding(VirtualFile virtualFile, boolean useParentDefaults)
getEncoding
in class EncodingRegistry
virtualFile
- file to get encoding foruseParentDefaults
- true to determine encoding from the parentpublic void clearDocumentQueue()
public void setEncoding(VirtualFile virtualFileOrDir, java.nio.charset.Charset charset)
setEncoding
in class EncodingRegistry
public boolean isNative2Ascii(VirtualFile virtualFile)
isNative2Ascii
in class EncodingRegistry
public boolean isNative2AsciiForPropertiesFiles()
isNative2AsciiForPropertiesFiles
in class EncodingManager
public void setNative2AsciiForPropertiesFiles(VirtualFile virtualFile, boolean native2Ascii)
setNative2AsciiForPropertiesFiles
in class EncodingManager
public java.nio.charset.Charset getDefaultCharset()
getDefaultCharset
in class EncodingRegistry
public java.lang.String getDefaultCharsetName()
getDefaultCharsetName
in class EncodingManager
public void setDefaultCharsetName(java.lang.String name)
setDefaultCharsetName
in class EncodingManager
public java.nio.charset.Charset getDefaultCharsetForPropertiesFiles(VirtualFile virtualFile)
getDefaultCharsetForPropertiesFiles
in class EncodingManager
public void setDefaultCharsetForPropertiesFiles(VirtualFile virtualFile, java.nio.charset.Charset charset)
setDefaultCharsetForPropertiesFiles
in class EncodingManager