public interface Project extends ComponentManager, AreaInstance
To get all of its modules, use ModuleManager.getInstance(project).getModules().
To iterate over all project source files and directories,
use ProjectFileIndex.SERVICE.getInstance(project).iterateContent(iterator).
To get the list of all open projects, use ProjectManager.getInstance().getOpenProjects().
Disposable.Parent| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DIRECTORY_STORE_FOLDER |
| Modifier and Type | Method and Description |
|---|---|
VirtualFile |
getBaseDir()
Deprecated.
No such concept as "project root". Project consists of module set, each has own content root set.
|
@SystemIndependent java.lang.String |
getBasePath()
|
java.lang.String |
getLocationHash() |
java.lang.String |
getName()
Returns a name ot the project.
|
default @SystemDependent java.lang.String |
getPresentableUrl()
Returns presentable project path:
getProjectFilePath() for file-based projects, getBasePath() for directory-based ones.
Returns null for default project. |
VirtualFile |
getProjectFile()
Returns project descriptor file:
path/to/project/project.ipr - for file-based projects
path/to/project/.idea/misc.xml - for directory-based projects
Returns null for default project. |
@SystemIndependent java.lang.String |
getProjectFilePath() |
VirtualFile |
getWorkspaceFile()
Returns a workspace file:
path/to/project/project.iws - for file-based projects
path/to/project/.idea/workspace.xml - for directory-based ones
Returns null for default project. |
boolean |
isDefault() |
boolean |
isInitialized() |
boolean |
isOpen() |
void |
save() |
createError, createError, getComponent, getComponent, getComponent, getComponentInstancesOfType, getComponentInstancesOfType, getComponents, getDisposed, getExtensionArea, getExtensions, getMessageBus, getPicoContainer, getService, getService, getServiceIfCreated, hasComponent, instantiateClass, instantiateClassWithConstructorInjection, instantiateExtensionWithPicoContainerOnlyIfNeeded, isDisposed, isDisposedOrDisposeInProgress, logErrorgetUserData, putUserDatadisposestatic final java.lang.String DIRECTORY_STORE_FOLDER
java.lang.String getName()
@Deprecated VirtualFile getBaseDir()
.ipr file or .idea directory.null for default project.com.intellij.openapi.project.ProjectUtil#guessProjectDir,
getBasePath()@SystemIndependent java.lang.String getBasePath()
com.intellij.openapi.project.ProjectUtil#guessProjectDirVirtualFile getProjectFile()
path/to/project/project.ipr - for file-based projectspath/to/project/.idea/misc.xml - for directory-based projectsnull for default project.@SystemIndependent java.lang.String getProjectFilePath()
null for default project.default @SystemDependent java.lang.String getPresentableUrl()
null for default project.
Note: the word "presentable" here implies file system presentation, not a UI one.VirtualFile getWorkspaceFile()
Returns a workspace file:
path/to/project/project.iws - for file-based projectspath/to/project/.idea/workspace.xml - for directory-based onesnull for default project.java.lang.String getLocationHash()
void save()
boolean isOpen()
boolean isInitialized()
boolean isDefault()