public class LanguageLevelModuleExtensionImpl extends ModuleExtension implements LanguageLevelModuleExtension, PersistentStateComponentWithModificationTracker<LanguageLevelState>
Disposable.Parent
EP_NAME
Constructor and Description |
---|
LanguageLevelModuleExtensionImpl(LanguageLevelModuleExtensionImpl source,
boolean writable) |
LanguageLevelModuleExtensionImpl(Module module) |
Modifier and Type | Method and Description |
---|---|
void |
commit() |
void |
dispose()
Usually not invoked directly, see class javadoc.
|
static LanguageLevelModuleExtensionImpl |
getInstance(Module module) |
LanguageLevel |
getLanguageLevel() |
ModuleExtension |
getModifiableModel(boolean writable)
Note: don't call this method directly from client code.
|
LanguageLevelState |
getState() |
long |
getStateModificationCount() |
boolean |
isChanged() |
void |
loadState(LanguageLevelState state)
This method is called when new component state is loaded.
|
void |
setLanguageLevel(LanguageLevel languageLevel) |
readExternal, writeExternal
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
initializeComponent, noStateLoaded
public LanguageLevelModuleExtensionImpl(Module module)
public LanguageLevelModuleExtensionImpl(LanguageLevelModuleExtensionImpl source, boolean writable)
public long getStateModificationCount()
getStateModificationCount
in interface PersistentStateComponentWithModificationTracker<LanguageLevelState>
public static LanguageLevelModuleExtensionImpl getInstance(Module module)
public void setLanguageLevel(LanguageLevel languageLevel)
setLanguageLevel
in interface LanguageLevelModuleExtension
public LanguageLevelState getState()
getState
in interface PersistentStateComponent<LanguageLevelState>
null
value indicates
that the returned state won't be stored, as a result previously stored state will be used.XmlSerializer
public void loadState(LanguageLevelState state)
PersistentStateComponent
State object should be used directly, defensive copying is not required.
loadState
in interface PersistentStateComponent<LanguageLevelState>
state
- loaded component stateXmlSerializerUtil.copyBean(Object, Object)
public ModuleExtension getModifiableModel(boolean writable)
ModuleExtension
ModifiableRootModel modifiableModel = ModuleRootManager.getInstance(module).getModifiableModel(); CompilerModuleExtension extension = modifiableModel.getModuleExtension(CompilerModuleExtension.class); try { // ... } finally { modifiableModel.commit(); }The point is that call to commit() on CompilerModuleExtension obtained like
'CompilerModuleExtension.getInstance(module).getModifiableModel(true)'
doesn't dispose the model.
Call to ModifiableRootModel.commit()
not only commits linked extensions but disposes them as well.getModifiableModel
in class ModuleExtension
writable
- flag which identifies if resulting model is writablepublic void commit()
commit
in class ModuleExtension
public boolean isChanged()
isChanged
in class ModuleExtension
public void dispose()
Disposable
dispose
in interface Disposable
public LanguageLevel getLanguageLevel()
getLanguageLevel
in interface LanguageLevelModuleExtension