public class RootModelImpl extends RootModelBase implements ModifiableRootModel
| 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 file)
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 entry)
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) |
protected java.util.Set<ContentEntry> |
getContent() |
Module |
getModule()
Returns the module to which the model belongs.
|
<T> T |
getModuleExtension(java.lang.Class<T> klass) |
LibraryTable |
getModuleLibraryTable()
Returns library table with module libraries.
|
OrderEntry [] |
getOrderEntries()
Use this method to obtain order of roots of a module.
|
Project |
getProject() |
VirtualFilePointerListener |
getRootsChangedListener() |
java.lang.String |
getSdkName() |
void |
inheritSdk()
Makes this module inheriting SDK from its project.
|
boolean |
isChanged() |
boolean |
isDisposed() |
boolean |
isWritable() |
void |
rearrangeOrderEntries(OrderEntry [] newEntries) |
void |
removeContentEntry(ContentEntry entry)
Remove the specified content root.
|
void |
removeOrderEntry(OrderEntry entry)
Removes order entry from an order.
|
<T extends OrderEntry> |
replaceEntryOfType(java.lang.Class<T> entryClass,
T entry) |
void |
setInvalidSdk(java.lang.String jdkName,
java.lang.String jdkType)
Sets JDK name and type for this module.
|
void |
setSdk(Sdk jdk)
Sets SDK for this module to a specific value.
|
java.lang.String |
toString() |
void |
writeExternal(Element element) |
getContentEntries, getContentRoots, getContentRootUrls, getDependencyModuleNames, getExcludeRoots, getExcludeRootUrls, getModuleDependencies, getModuleDependencies, getSdk, getSourceRoots, getSourceRoots, getSourceRoots, getSourceRoots, getSourceRootUrls, getSourceRootUrls, isSdkInherited, orderEntries, processOrderclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetContentEntries, getContentRoots, getContentRootUrls, getDependencyModuleNames, getExcludeRoots, getExcludeRootUrls, getModuleDependencies, getModuleDependencies, getSdk, getSourceRoots, getSourceRoots, getSourceRoots, getSourceRoots, getSourceRootUrls, getSourceRootUrls, isSdkInherited, orderEntries, processOrderpublic boolean isWritable()
isWritable in interface ModifiableRootModelpublic OrderEntry [] getOrderEntries()
ModuleRootModelgetOrderEntries in interface ModuleRootModelpublic void removeContentEntry(ContentEntry entry)
ModifiableRootModelremoveContentEntry in interface ModifiableRootModelentry - the content root to remove.public void addOrderEntry(OrderEntry entry)
ModifiableRootModeladdOrderEntry in interface ModifiableRootModelentry - the order entry to add.public LibraryOrderEntry addLibraryEntry(Library library)
ModifiableRootModeladdLibraryEntry in interface ModifiableRootModellibrary - the library for which the entry is created.public LibraryOrderEntry addInvalidLibrary(java.lang.String name, java.lang.String level)
ModifiableRootModeladdInvalidLibrary in interface ModifiableRootModelpublic ModuleOrderEntry addModuleOrderEntry(Module module)
addModuleOrderEntry in interface ModifiableRootModelpublic ModuleOrderEntry addInvalidModuleEntry(java.lang.String name)
addInvalidModuleEntry in interface ModifiableRootModelpublic ModuleOrderEntry findModuleOrderEntry(Module module)
findModuleOrderEntry in interface ModifiableRootModelpublic LibraryOrderEntry findLibraryOrderEntry(Library library)
findLibraryOrderEntry in interface ModifiableRootModelpublic void removeOrderEntry(OrderEntry entry)
ModifiableRootModelremoveOrderEntry in interface ModifiableRootModelpublic void rearrangeOrderEntries(OrderEntry [] newEntries)
rearrangeOrderEntries in interface ModifiableRootModelpublic void clear()
clear in interface ModifiableRootModelpublic void commit()
ModifiableRootModelModuleRootManager.
Should be invoked in a write action. After commit(), the model
becomes read-only.
Use of ModuleRootModificationUtil.updateModel(Module, Consumer) is recommended.
commit in interface ModifiableRootModelpublic LibraryTable getModuleLibraryTable()
ModifiableRootModelModifiableRootModel instance.getModuleLibraryTable in interface ModifiableRootModelpublic Project getProject()
getProject in interface ModifiableRootModelpublic ContentEntry addContentEntry(VirtualFile file)
ModifiableRootModeladdContentEntry in interface ModifiableRootModelfile - root of a contentpublic ContentEntry addContentEntry(java.lang.String url)
ModifiableRootModeladdContentEntry in interface ModifiableRootModelurl - root of a contentpublic boolean isDisposed()
isDisposed in interface ModifiableRootModelpublic void writeExternal(Element element)
public void setSdk(Sdk jdk)
ModifiableRootModelsetSdk in interface ModifiableRootModelpublic void setInvalidSdk(java.lang.String jdkName,
java.lang.String jdkType)
ModifiableRootModelsetInvalidSdk in interface ModifiableRootModeljdkName - SDK namejdkType - SDK typepublic void inheritSdk()
ModifiableRootModelinheritSdk in interface ModifiableRootModelpublic <T extends OrderEntry> void replaceEntryOfType(java.lang.Class<T> entryClass, T entry)
replaceEntryOfType in interface ModifiableRootModelpublic java.lang.String getSdkName()
getSdkName in interface ModifiableRootModelprotected java.util.Set<ContentEntry> getContent()
getContent in class RootModelBasepublic Module getModule()
ModuleRootModelgetModule in interface ModuleRootModelpublic boolean isChanged()
isChanged in interface ModifiableRootModelpublic void dispose()
ModifiableRootModel
Use of ModuleRootModificationUtil.updateModel(Module, Consumer) is recommended.
dispose in interface ModifiableRootModelpublic java.lang.String toString()
toString in class java.lang.Objectpublic <T> T getModuleExtension(java.lang.Class<T> klass)
getModuleExtension in interface ModuleRootModelpublic VirtualFilePointerListener getRootsChangedListener()