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, processOrder
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getContentEntries, getContentRoots, getContentRootUrls, getDependencyModuleNames, getExcludeRoots, getExcludeRootUrls, getModuleDependencies, getModuleDependencies, getSdk, getSourceRoots, getSourceRoots, getSourceRoots, getSourceRoots, getSourceRootUrls, getSourceRootUrls, isSdkInherited, orderEntries, processOrder
public boolean isWritable()
isWritable
in interface ModifiableRootModel
public OrderEntry [] getOrderEntries()
ModuleRootModel
getOrderEntries
in interface ModuleRootModel
public void removeContentEntry(ContentEntry entry)
ModifiableRootModel
removeContentEntry
in interface ModifiableRootModel
entry
- the content root to remove.public void addOrderEntry(OrderEntry entry)
ModifiableRootModel
addOrderEntry
in interface ModifiableRootModel
entry
- the order entry to add.public LibraryOrderEntry addLibraryEntry(Library library)
ModifiableRootModel
addLibraryEntry
in interface ModifiableRootModel
library
- the library for which the entry is created.public LibraryOrderEntry addInvalidLibrary(java.lang.String name, java.lang.String level)
ModifiableRootModel
addInvalidLibrary
in interface ModifiableRootModel
public ModuleOrderEntry addModuleOrderEntry(Module module)
addModuleOrderEntry
in interface ModifiableRootModel
public ModuleOrderEntry addInvalidModuleEntry(java.lang.String name)
addInvalidModuleEntry
in interface ModifiableRootModel
public ModuleOrderEntry findModuleOrderEntry(Module module)
findModuleOrderEntry
in interface ModifiableRootModel
public LibraryOrderEntry findLibraryOrderEntry(Library library)
findLibraryOrderEntry
in interface ModifiableRootModel
public void removeOrderEntry(OrderEntry entry)
ModifiableRootModel
removeOrderEntry
in interface ModifiableRootModel
public void rearrangeOrderEntries(OrderEntry [] newEntries)
rearrangeOrderEntries
in interface ModifiableRootModel
public void clear()
clear
in interface ModifiableRootModel
public void commit()
ModifiableRootModel
ModuleRootManager
.
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 ModifiableRootModel
public LibraryTable getModuleLibraryTable()
ModifiableRootModel
ModifiableRootModel
instance.getModuleLibraryTable
in interface ModifiableRootModel
public Project getProject()
getProject
in interface ModifiableRootModel
public ContentEntry addContentEntry(VirtualFile file)
ModifiableRootModel
addContentEntry
in interface ModifiableRootModel
file
- root of a contentpublic ContentEntry addContentEntry(java.lang.String url)
ModifiableRootModel
addContentEntry
in interface ModifiableRootModel
url
- root of a contentpublic boolean isDisposed()
isDisposed
in interface ModifiableRootModel
public void writeExternal(Element element)
public void setSdk(Sdk jdk)
ModifiableRootModel
setSdk
in interface ModifiableRootModel
public void setInvalidSdk(java.lang.String jdkName, java.lang.String jdkType)
ModifiableRootModel
setInvalidSdk
in interface ModifiableRootModel
jdkName
- SDK namejdkType
- SDK typepublic void inheritSdk()
ModifiableRootModel
inheritSdk
in interface ModifiableRootModel
public <T extends OrderEntry> void replaceEntryOfType(java.lang.Class<T> entryClass, T entry)
replaceEntryOfType
in interface ModifiableRootModel
public java.lang.String getSdkName()
getSdkName
in interface ModifiableRootModel
protected java.util.Set<ContentEntry> getContent()
getContent
in class RootModelBase
public Module getModule()
ModuleRootModel
getModule
in interface ModuleRootModel
public boolean isChanged()
isChanged
in interface ModifiableRootModel
public void dispose()
ModifiableRootModel
Use of ModuleRootModificationUtil.updateModel(Module, Consumer)
is recommended.
dispose
in interface ModifiableRootModel
public java.lang.String toString()
toString
in class java.lang.Object
public <T> T getModuleExtension(java.lang.Class<T> klass)
getModuleExtension
in interface ModuleRootModel
public VirtualFilePointerListener getRootsChangedListener()