public class CodeStyleSettingsManager extends java.lang.Object implements PersistentStateComponentWithModificationTracker<Element>
Modifier and Type | Field and Description |
---|---|
CodeStyleSettings |
PER_PROJECT_SETTINGS
Deprecated.
|
java.lang.String |
PREFERRED_PROJECT_CODE_STYLE |
boolean |
USE_PER_PROJECT_SETTINGS |
Constructor and Description |
---|
CodeStyleSettingsManager() |
Modifier and Type | Method and Description |
---|---|
void |
addListener(CodeStyleSettingsListener listener) |
void |
dropTemporarySettings() |
protected java.util.Collection<CodeStyleSettings> |
enumSettings() |
void |
fireCodeStyleSettingsChanged(PsiFile file) |
CodeStyleSettings |
getCurrentSettings()
Deprecated.
see comments for
getSettings(Project) |
static CodeStyleSettingsManager |
getInstance()
Deprecated.
Use
CodeStyle.getDefaultSettings() instead. |
static CodeStyleSettingsManager |
getInstance(Project project) |
CodeStyleSettings |
getMainProjectCodeStyle() |
static CodeStyleSettings |
getSettings(Project project)
Deprecated.
Use one of the following methods:
PsiFile is not applicable, use CodeStyle.getSettings(Project) but only in cases
when using main project settings is logically the only choice in a given context. It shouldn't be used just because the existing
code doesn't allow to easily retrieve a PsiFile. Otherwise the code will not catch up with proper file code style settings since the
settings may differ for different files depending on their scope. |
Element |
getState() |
long |
getStateModificationCount() |
CodeStyleSettings |
getTemporarySettings() |
protected boolean |
isIgnoredOnSave(java.lang.String fieldName) |
boolean |
isLoaded()
Deprecated.
unused
|
void |
loadState(Element state)
This method is called when new component state is loaded.
|
void |
notifyCodeStyleSettingsChanged()
Increase current project's code style modification tracker and notify all the listeners on changed code style.
|
void |
registerCustomSettings(java.util.Collection<CodeStyleSettings> allSettings,
CodeStyleSettingsProvider provider) |
protected void |
registerExtensionPointListeners(Disposable disposable) |
void |
registerFileTypeIndentOptions(java.util.Collection<CodeStyleSettings> allSettings,
FileType fileType,
CommonCodeStyleSettings.IndentOptions indentOptions) |
void |
registerLanguageSettings(java.util.Collection<CodeStyleSettings> allSettings,
LanguageCodeStyleSettingsProvider provider) |
static void |
removeListener(Project project,
CodeStyleSettingsListener listener) |
void |
setMainProjectCodeStyle(CodeStyleSettings settings)
Sets main project settings by the name "Project".
|
void |
setTemporarySettings(CodeStyleSettings settings) |
void |
unregisterCustomSettings(java.util.Collection<CodeStyleSettings> allSettings,
CodeStyleSettingsProvider provider) |
void |
unregisterFileTypeIndentOptions(java.util.Collection<CodeStyleSettings> allSettings,
FileType fileType) |
void |
unregisterLanguageSettings(java.util.Collection<CodeStyleSettings> allSettings,
LanguageCodeStyleSettingsProvider provider) |
void |
updateSettingsTracker() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
initializeComponent, noStateLoaded
@Deprecated public volatile CodeStyleSettings PER_PROJECT_SETTINGS
setMainProjectCodeStyle(CodeStyleSettings)
or getMainProjectCodeStyle()
insteadpublic volatile boolean USE_PER_PROJECT_SETTINGS
public volatile java.lang.String PREFERRED_PROJECT_CODE_STYLE
public long getStateModificationCount()
getStateModificationCount
in interface PersistentStateComponentWithModificationTracker<Element>
public static CodeStyleSettingsManager getInstance(Project project)
@Deprecated public static CodeStyleSettingsManager getInstance()
CodeStyle.getDefaultSettings()
instead.protected void registerExtensionPointListeners(Disposable disposable)
protected java.util.Collection<CodeStyleSettings> enumSettings()
public final void registerFileTypeIndentOptions(java.util.Collection<CodeStyleSettings> allSettings, FileType fileType, CommonCodeStyleSettings.IndentOptions indentOptions)
public final void unregisterFileTypeIndentOptions(java.util.Collection<CodeStyleSettings> allSettings, FileType fileType)
public final void registerLanguageSettings(java.util.Collection<CodeStyleSettings> allSettings, LanguageCodeStyleSettingsProvider provider)
public final void unregisterLanguageSettings(java.util.Collection<CodeStyleSettings> allSettings, LanguageCodeStyleSettingsProvider provider)
public final void registerCustomSettings(java.util.Collection<CodeStyleSettings> allSettings, CodeStyleSettingsProvider provider)
public final void unregisterCustomSettings(java.util.Collection<CodeStyleSettings> allSettings, CodeStyleSettingsProvider provider)
@Deprecated public static CodeStyleSettings getSettings(Project project)
CodeStyle.getLanguageSettings(PsiFile, Language)
to get common settings for a language.CodeStyle.getCustomSettings(PsiFile, Class)
to get custom settings.PsiFile
is not applicable, use CodeStyle.getSettings(Project)
but only in cases
when using main project settings is logically the only choice in a given context. It shouldn't be used just because the existing
code doesn't allow to easily retrieve a PsiFile. Otherwise the code will not catch up with proper file code style settings since the
settings may differ for different files depending on their scope.@Deprecated public CodeStyleSettings getCurrentSettings()
getSettings(Project)
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
protected boolean isIgnoredOnSave(java.lang.String fieldName)
public void loadState(Element state)
PersistentStateComponent
State object should be used directly, defensive copying is not required.
loadState
in interface PersistentStateComponent<Element>
state
- loaded component stateXmlSerializerUtil.copyBean(Object, Object)
public void setMainProjectCodeStyle(CodeStyleSettings settings)
settings
- The code style settings which can be assigned to project.public CodeStyleSettings getMainProjectCodeStyle()
@Deprecated public boolean isLoaded()
public void setTemporarySettings(CodeStyleSettings settings)
dropTemporarySettings()
public void dropTemporarySettings()
public CodeStyleSettings getTemporarySettings()
public void addListener(CodeStyleSettingsListener listener)
public static void removeListener(Project project, CodeStyleSettingsListener listener)
public void fireCodeStyleSettingsChanged(PsiFile file)
public final void notifyCodeStyleSettingsChanged()
public void updateSettingsTracker()