public class ProjectRootManagerImpl extends ProjectRootManagerEx implements PersistentStateComponent<Element>
| Modifier and Type | Class and Description |
|---|---|
protected class |
ProjectRootManagerImpl.BatchSession |
ProjectRootManagerEx.ProjectJdkListener| Modifier and Type | Field and Description |
|---|---|
protected boolean |
isFiringEvent |
protected ProjectRootManagerImpl.BatchSession |
myFileTypesChanged |
protected Project |
myProject |
protected ProjectRootManagerImpl.BatchSession |
myRootsChanged |
protected boolean |
myStartupActivityPerformed |
EVER_CHANGED, NEVER_CHANGED| Constructor and Description |
|---|
ProjectRootManagerImpl(Project project) |
| Modifier and Type | Method and Description |
|---|---|
void |
addProjectJdkListener(ProjectRootManagerEx.ProjectJdkListener listener) |
void |
assertListenersAreDisposed() |
protected void |
clearScopesCaches() |
void |
clearScopesCachesForModules() |
static java.lang.String |
extractLocalPath(java.lang.String url) |
protected void |
fireBeforeRootsChangeEvent(boolean fileTypes) |
protected void |
fireRootsChangedEvent(boolean fileTypes) |
protected java.lang.Runnable |
getActionToRunWhenProjectJdkChanges() |
protected ProjectRootManagerImpl.BatchSession |
getBatchSession(boolean fileTypes) |
VirtualFile [] |
getContentRoots()
Returns the list of content roots for all modules in the project.
|
VirtualFile [] |
getContentRootsFromAllModules()
Unlike getContentRoots(), this includes the project base dir.
|
java.util.List<java.lang.String> |
getContentRootUrls()
Returns the list of content root URLs for all modules in the project.
|
VirtualFile [] |
getContentSourceRoots()
Returns the list of source roots under the content roots for all modules in the project.
|
ProjectFileIndex |
getFileIndex()
Returns the file index for the project.
|
static ProjectRootManagerImpl |
getInstanceImpl(Project project) |
java.util.List<VirtualFile> |
getModuleSourceRoots(java.util.Set<? extends JpsModuleSourceRootType<?>> rootTypes)
Returns the list of source roots from all modules which types belong to the specified set
|
Project |
getProject() |
Sdk |
getProjectSdk() |
java.lang.String |
getProjectSdkName() |
java.lang.String |
getProjectSdkTypeName() |
VirtualFilePointerListener |
getRootsValidityChangedListener() |
Element |
getState() |
void |
loadState(Element element)
This method is called when new component state is loaded.
|
void |
makeRootsChange(java.lang.Runnable runnable,
boolean fileTypes,
boolean fireEvents) |
void |
markRootsForRefresh() |
void |
mergeRootsChangesDuring(java.lang.Runnable runnable) |
void |
noStateLoaded()
This method is called when the component is initialized, but no state is persisted.
|
OrderEnumerator |
orderEntries()
Creates new enumerator instance to process dependencies of all modules in the project.
|
OrderEnumerator |
orderEntries(java.util.Collection<? extends Module> modules)
Creates new enumerator instance to process dependencies of several modules in the project.
|
protected void |
projectJdkChanged() |
void |
removeProjectJdkListener(ProjectRootManagerEx.ProjectJdkListener listener) |
void |
setProjectSdk(Sdk sdk)
Sets the SDK to be used for the project.
|
void |
setProjectSdkName(java.lang.String name)
Deprecated.
|
void |
setProjectSdkName(java.lang.String name,
java.lang.String sdkTypeName)
Sets the name of the JDK to be used for the project
|
getInstanceExgetInstancegetModificationCount, incModificationCountclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinitializeComponentprotected final Project myProject
protected boolean myStartupActivityPerformed
protected final ProjectRootManagerImpl.BatchSession myRootsChanged
protected final ProjectRootManagerImpl.BatchSession myFileTypesChanged
protected boolean isFiringEvent
public ProjectRootManagerImpl(Project project)
public static ProjectRootManagerImpl getInstanceImpl(Project project)
public ProjectFileIndex getFileIndex()
ProjectRootManagergetFileIndex in class ProjectRootManagerpublic java.util.List<java.lang.String> getContentRootUrls()
ProjectRootManagergetContentRootUrls in class ProjectRootManagerpublic VirtualFile [] getContentRoots()
ProjectRootManagergetContentRoots in class ProjectRootManagerpublic VirtualFile [] getContentSourceRoots()
ProjectRootManagergetContentSourceRoots in class ProjectRootManagerpublic java.util.List<VirtualFile> getModuleSourceRoots(java.util.Set<? extends JpsModuleSourceRootType<?>> rootTypes)
ProjectRootManagergetModuleSourceRoots in class ProjectRootManagerrootTypes - types of source rootspublic OrderEnumerator orderEntries()
ProjectRootManagerOrderEnumerator.recursively() option is ignored and OrderEnumerator.withoutDepModules() option is forcedorderEntries in class ProjectRootManagerpublic OrderEnumerator orderEntries(java.util.Collection<? extends Module> modules)
ProjectRootManagerorderEntries in class ProjectRootManagermodules - modules to processpublic VirtualFile [] getContentRootsFromAllModules()
ProjectRootManagergetContentRootsFromAllModules in class ProjectRootManagerpublic Sdk getProjectSdk()
getProjectSdk in class ProjectRootManagerpublic java.lang.String getProjectSdkName()
getProjectSdkName in class ProjectRootManagerpublic java.lang.String getProjectSdkTypeName()
getProjectSdkTypeName in class ProjectRootManagerSdkTypeId.getName() of the current Project SDKpublic void setProjectSdk(Sdk sdk)
ProjectRootManagersetProjectSdk in class ProjectRootManagersdk - the SDK instance.protected void projectJdkChanged()
protected java.lang.Runnable getActionToRunWhenProjectJdkChanges()
@Deprecated public void setProjectSdkName(java.lang.String name)
setProjectSdkName in class ProjectRootManagerpublic void setProjectSdkName(java.lang.String name,
java.lang.String sdkTypeName)
ProjectRootManagersetProjectSdkName in class ProjectRootManagersdkTypeName - the SdkTypeId.getName() of the SDK typepublic void addProjectJdkListener(ProjectRootManagerEx.ProjectJdkListener listener)
addProjectJdkListener in class ProjectRootManagerExpublic void removeProjectJdkListener(ProjectRootManagerEx.ProjectJdkListener listener)
removeProjectJdkListener in class ProjectRootManagerExpublic void loadState(Element element)
PersistentStateComponentState object should be used directly, defensive copying is not required.
loadState in interface PersistentStateComponent<Element>element - loaded component stateXmlSerializerUtil.copyBean(Object, Object)public void noStateLoaded()
PersistentStateComponentnoStateLoaded in interface PersistentStateComponent<Element>public Element getState()
getState in interface PersistentStateComponent<Element>null value indicates
that the returned state won't be stored, as a result previously stored state will be used.XmlSerializerpublic void mergeRootsChangesDuring(java.lang.Runnable runnable)
mergeRootsChangesDuring in class ProjectRootManagerExprotected void clearScopesCaches()
public void clearScopesCachesForModules()
clearScopesCachesForModules in class ProjectRootManagerExpublic void makeRootsChange(java.lang.Runnable runnable,
boolean fileTypes,
boolean fireEvents)
makeRootsChange in class ProjectRootManagerExprotected ProjectRootManagerImpl.BatchSession getBatchSession(boolean fileTypes)
protected void fireBeforeRootsChangeEvent(boolean fileTypes)
protected void fireRootsChangedEvent(boolean fileTypes)
public Project getProject()
public static java.lang.String extractLocalPath(java.lang.String url)
public void assertListenersAreDisposed()
assertListenersAreDisposed in class ProjectRootManagerExpublic void markRootsForRefresh()
markRootsForRefresh in class ProjectRootManagerExpublic VirtualFilePointerListener getRootsValidityChangedListener()