public interface ModifiableRootModel extends ModuleRootModel
commit()
to persist changes, see also ModuleRootModificationUtil
.Modifier and Type | Method and Description |
---|---|
ContentEntry |
addContentEntry(java.lang.String url)
Adds the specified file or directory as a content root.
|
ContentEntry |
addContentEntry(VirtualFile root)
Adds the specified file or directory as a content root.
|
LibraryOrderEntry |
addInvalidLibrary(java.lang.String name,
java.lang.String level)
Adds an entry for invalid library.
|
ModuleOrderEntry |
addInvalidModuleEntry(java.lang.String name) |
LibraryOrderEntry |
addLibraryEntry(Library library)
Creates an entry for a given library and adds it to order.
|
ModuleOrderEntry |
addModuleOrderEntry(Module module) |
void |
addOrderEntry(OrderEntry orderEntry)
Appends an order entry to the classpath.
|
void |
clear() |
void |
commit()
Commits changes to a
ModuleRootManager . |
void |
dispose()
Must be invoked for uncommitted models that are no longer needed.
|
LibraryOrderEntry |
findLibraryOrderEntry(Library library) |
ModuleOrderEntry |
findModuleOrderEntry(Module module) |
LibraryTable |
getModuleLibraryTable()
Returns library table with module libraries.
|
Project |
getProject() |
java.lang.String |
getSdkName() |
void |
inheritSdk()
Makes this module inheriting SDK from its project.
|
boolean |
isChanged() |
boolean |
isDisposed() |
boolean |
isWritable() |
void |
rearrangeOrderEntries(OrderEntry [] newOrder) |
void |
removeContentEntry(ContentEntry entry)
Remove the specified content root.
|
void |
removeOrderEntry(OrderEntry orderEntry)
Removes order entry from an order.
|
<T extends OrderEntry> |
replaceEntryOfType(java.lang.Class<T> entryClass,
T entry) |
void |
setInvalidSdk(java.lang.String sdkName,
java.lang.String sdkType)
Sets JDK name and type for this module.
|
void |
setSdk(Sdk sdk)
Sets SDK for this module to a specific value.
|
getContentEntries, getContentRoots, getContentRootUrls, getDependencyModuleNames, getExcludeRoots, getExcludeRootUrls, getModule, getModuleDependencies, getModuleDependencies, getModuleExtension, getOrderEntries, getSdk, getSourceRoots, getSourceRoots, getSourceRoots, getSourceRoots, getSourceRootUrls, getSourceRootUrls, isSdkInherited, orderEntries, processOrder
Project getProject()
ContentEntry addContentEntry(VirtualFile root)
root
- root of a contentContentEntry addContentEntry(java.lang.String url)
url
- root of a contentvoid removeContentEntry(ContentEntry entry)
entry
- the content root to remove.void addOrderEntry(OrderEntry orderEntry)
orderEntry
- the order entry to add.LibraryOrderEntry addLibraryEntry(Library library)
library
- the library for which the entry is created.LibraryOrderEntry addInvalidLibrary(java.lang.String name, java.lang.String level)
ModuleOrderEntry addModuleOrderEntry(Module module)
ModuleOrderEntry addInvalidModuleEntry(java.lang.String name)
ModuleOrderEntry findModuleOrderEntry(Module module)
LibraryOrderEntry findLibraryOrderEntry(Library library)
void removeOrderEntry(OrderEntry orderEntry)
void rearrangeOrderEntries(OrderEntry [] newOrder)
void clear()
void commit()
ModuleRootManager
.
Should be invoked in a write action. After commit(), the model
becomes read-only.
Use of ModuleRootModificationUtil.updateModel(Module, Consumer)
is recommended.
void dispose()
Use of ModuleRootModificationUtil.updateModel(Module, Consumer)
is recommended.
LibraryTable getModuleLibraryTable()
ModifiableRootModel
instance.void setSdk(Sdk sdk)
void setInvalidSdk(java.lang.String sdkName, java.lang.String sdkType)
sdkName
- SDK namesdkType
- SDK typevoid inheritSdk()
boolean isChanged()
boolean isWritable()
<T extends OrderEntry> void replaceEntryOfType(java.lang.Class<T> entryClass, T entry)
java.lang.String getSdkName()
boolean isDisposed()