public abstract class ModuleExtension extends java.lang.Object implements Disposable
module service
instead.
If the inheritor implements PersistentStateComponent
its state will be persisted in the module
configuration file.Disposable.Parent
Modifier and Type | Field and Description |
---|---|
static ExtensionPointName<ModuleExtension> |
EP_NAME |
Constructor and Description |
---|
ModuleExtension() |
Modifier and Type | Method and Description |
---|---|
abstract void |
commit() |
abstract ModuleExtension |
getModifiableModel(boolean writable)
Note: don't call this method directly from client code.
|
abstract boolean |
isChanged() |
void |
readExternal(Element element)
Deprecated.
Please implement PersistentStateComponent instead.
|
void |
writeExternal(Element element)
Deprecated.
Please implement PersistentStateComponent instead.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
dispose
public static final ExtensionPointName<ModuleExtension> EP_NAME
public abstract ModuleExtension getModifiableModel(boolean writable)
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.writable
- flag which identifies if resulting model is writablepublic abstract void commit()
public abstract boolean isChanged()
@Deprecated public void readExternal(Element element)
@Deprecated public void writeExternal(Element element)