public final class EncodingProjectManagerImpl extends EncodingProjectManager implements PersistentStateComponent<Element>, Disposable
Modifier and Type | Class and Description |
---|---|
static class |
EncodingProjectManagerImpl.BOMForNewUTF8Files |
Disposable.Parent
PROP_NATIVE2ASCII_SWITCH, PROP_PROPERTIES_FILES_ENCODING
Constructor and Description |
---|
EncodingProjectManagerImpl(Project project) |
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Usually not invoked directly, see class javadoc.
|
java.util.Map<? extends VirtualFile,? extends java.nio.charset.Charset> |
getAllMappings() |
java.nio.charset.Charset |
getCachedCharsetFromContent(Document document) |
java.nio.charset.Charset |
getConfiguredDefaultCharset() |
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() |
ModificationTracker |
getModificationTracker() |
Element |
getState() |
boolean |
isNative2Ascii(VirtualFile virtualFile) |
boolean |
isNative2AsciiForPropertiesFiles() |
void |
loadState(Element element)
This method is called when new component state is loaded.
|
void |
setBOMForNewUtf8Files(EncodingProjectManagerImpl.BOMForNewUTF8Files option) |
void |
setDefaultCharsetForPropertiesFiles(VirtualFile virtualFile,
java.nio.charset.Charset charset) |
void |
setDefaultCharsetName(java.lang.String name)
Sets Project encoding (configured in Settings|File Encodings|Project Encoding).
|
void |
setEncoding(VirtualFile virtualFileOrDir,
java.nio.charset.Charset charset) |
void |
setMapping(java.util.Map<? extends VirtualFile,? extends java.nio.charset.Charset> mapping) |
void |
setNative2AsciiForPropertiesFiles(VirtualFile virtualFile,
boolean native2Ascii) |
boolean |
shouldAddBOMForNewUtf8File() |
getInstance
getInstance
doActionAndRestoreEncoding
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
initializeComponent, noStateLoaded
public EncodingProjectManagerImpl(Project project)
public void dispose()
Disposable
dispose
in interface Disposable
public Element getState()
getState
in interface PersistentStateComponent<Element>
null
value indicates
that the returned state won't be stored, as a result previously stored state will be used.XmlSerializer
public void loadState(Element element)
PersistentStateComponent
State object should be used directly, defensive copying is not required.
loadState
in interface PersistentStateComponent<Element>
element
- loaded component stateXmlSerializerUtil.copyBean(Object, Object)
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 ModificationTracker getModificationTracker()
public void setEncoding(VirtualFile virtualFileOrDir, java.nio.charset.Charset charset)
setEncoding
in class EncodingRegistry
public java.util.Collection<java.nio.charset.Charset> getFavorites()
getFavorites
in class EncodingManager
public java.util.Map<? extends VirtualFile,? extends java.nio.charset.Charset> getAllMappings()
setMapping(Map)
public void setMapping(java.util.Map<? extends VirtualFile,? extends java.nio.charset.Charset> mapping)
public java.nio.charset.Charset getDefaultCharset()
getDefaultCharset
in class EncodingProjectManager
public java.nio.charset.Charset getConfiguredDefaultCharset()
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.lang.String getDefaultCharsetName()
getDefaultCharsetName
in class EncodingProjectManager
public void setDefaultCharsetName(java.lang.String name)
EncodingProjectManager
setDefaultCharsetName
in class EncodingProjectManager
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
public java.nio.charset.Charset getCachedCharsetFromContent(Document document)
getCachedCharsetFromContent
in class EncodingManager
public void setBOMForNewUtf8Files(EncodingProjectManagerImpl.BOMForNewUTF8Files option)
public boolean shouldAddBOMForNewUtf8File()
shouldAddBOMForNewUtf8File
in class EncodingManager