public interface ModifiableModuleModel
ModuleManager.getModifiableModel()
Modifier and Type | Method and Description |
---|---|
void |
commit()
Commits changes made in this model to the actual project structure.
|
void |
dispose()
Disposes of all modules in the project.
|
void |
disposeModule(Module module)
Disposes of the specified module and removes it from the project.
|
Module |
findModuleByName(java.lang.String name)
Returns the project module with the specified name.
|
java.lang.String |
getActualName(Module module) |
java.lang.String [] |
getModuleGroupPath(Module module) |
Module [] |
getModules()
Returns the list of all modules in the project.
|
Module |
getModuleToBeRenamed(java.lang.String newName)
Returns the project module which has been renamed to the specified name.
|
java.lang.String |
getNewName(Module module)
Returns the name to which the specified module has been renamed.
|
Project |
getProject() |
boolean |
hasModuleGroups() |
boolean |
isChanged()
Checks if there are any uncommitted changes to the model.
|
Module |
loadModule(@SystemIndependent java.lang.String filePath)
Loads a module from an .iml file with the specified path and adds it to the project.
|
Module |
newModule(java.lang.String filePath,
java.lang.String moduleTypeId)
Creates a module of the specified type at the specified path and adds it to the project
to which the module manager is related.
|
Module |
newModule(java.lang.String filePath,
java.lang.String moduleTypeId,
java.util.Map<java.lang.String,java.lang.String> options)
Creates a module of the specified type at the specified path and adds it to the project
to which the module manager is related.
|
default Module |
newNonPersistentModule(java.lang.String moduleName,
java.lang.String moduleTypeId)
Creates a non-persistent module of the specified type and adds it to the project
to which the module manager is related.
|
void |
renameModule(Module module,
java.lang.String newName)
Schedules the rename of a module to be performed when the model is committed.
|
void |
setModuleGroupPath(Module module,
java.lang.String [] groupPath) |
Module [] getModules()
ModuleManager.getModules()
.Module newModule(java.lang.String filePath, java.lang.String moduleTypeId)
commit()
must be called to
bring the changes in effect.filePath
- path to an *.iml file where module configuration will be saved; name of the module will be equal to the file name without extension.moduleTypeId
- the ID of the module type to create.default Module newNonPersistentModule(java.lang.String moduleName, java.lang.String moduleTypeId)
commit()
must be called to
bring the changes in effect.
In contrast with modules created by newModule(String, String)
,
non-persistent modules aren't stored on a filesystem and aren't being written
in a project XML file. When IDE closes, all non-persistent modules vanishes out.Module newModule(java.lang.String filePath, java.lang.String moduleTypeId, java.util.Map<java.lang.String,java.lang.String> options)
commit()
must be called to
bring the changes in effect.filePath
- path to an *.iml file where module configuration will be saved; name of the module will be equal to the file name without extension.moduleTypeId
- ID of the module type to create.options
- map of module options to be used when creating the moduleModule loadModule(@SystemIndependent java.lang.String filePath) throws java.io.IOException, ModuleWithNameAlreadyExists
commit()
must be called to bring the changes in effect.filePath
- the path to load the module from.java.io.IOException
- if an I/O error occurred when loading the module file.ModuleWithNameAlreadyExists
- if a module with such a name already exists in the project.void disposeModule(Module module)
commit()
must be called to bring the changes in effect.module
- the module to remove.Module findModuleByName(java.lang.String name)
name
- the name of the module to find.void dispose()
boolean isChanged()
void commit()
void renameModule(Module module, java.lang.String newName) throws ModuleWithNameAlreadyExists
module
- the module to rename.newName
- the new name to rename the module to.ModuleWithNameAlreadyExists
- if a module with such a name already exists in the project.Module getModuleToBeRenamed(java.lang.String newName)
newName
- the name of the renamed module to find.java.lang.String getNewName(Module module)
module
- the module for which the new name is requested.java.lang.String getActualName(Module module)
module
if it has been renamed or its old name it hasn't.java.lang.String [] getModuleGroupPath(Module module)
boolean hasModuleGroups()
void setModuleGroupPath(Module module, java.lang.String [] groupPath)
Project getProject()