public class ProjectImpl extends ComponentManagerImpl implements ProjectEx
ProjectEx.ProjectSavedDisposable.Parent| Modifier and Type | Field and Description |
|---|---|
static Key<java.lang.Long> |
CREATION_TIME |
static Key<java.lang.String> |
CREATION_TRACE |
static java.lang.String |
LIGHT_PROJECT_NAME |
DIRECTORY_STORE_FOLDER| Modifier | Constructor and Description |
|---|---|
protected |
ProjectImpl(java.nio.file.Path filePath,
java.lang.String projectName) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
activityNamePrefix() |
void |
dispose()
Usually not invoked directly, see class javadoc.
|
void |
disposeEarlyDisposable() |
VirtualFile |
getBaseDir()
Returns a project base directory - a parent directory of a
.ipr file or .idea directory.Returns null for default project. |
@SystemIndependent java.lang.String |
getBasePath()
Returns a path to a project base directory (see Project.getBaseDir()).
Returns null for default project. |
IComponentStore |
getComponentStore() |
protected ContainerDescriptor |
getContainerDescriptor(IdeaPluginDescriptorImpl pluginDescriptor) |
java.lang.String |
getCreationTrace() |
Disposable |
getEarlyDisposable()
Disposable that will be disposed right after container started to be disposed. |
java.lang.String |
getLocationHash() |
java.lang.String |
getName()
Returns a name ot the project.
|
@SystemDependent java.lang.String |
getPresentableUrl()
Returns presentable project path:
Project.getProjectFilePath() for file-based projects, Project.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() |
IProjectStore |
getStateStore() |
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. |
void |
init(ProgressIndicator indicator) |
boolean |
isDefault() |
boolean |
isDisposed() |
boolean |
isInitialized() |
boolean |
isLight() |
boolean |
isOpen() |
void |
save() |
protected void |
setProgressDuringInit(ProgressIndicator indicator) |
void |
setProjectName(java.lang.String projectName) |
void |
setProjectStoreFactory(ProjectStoreFactory projectStoreFactory)
This method is temporary introduced to allow overriding project store class for a specific project.
|
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcreateError, createError, getComponent, getComponent, getComponent, getComponentInstancesOfType, getComponentInstancesOfType, getComponents, getDisposed, getExtensionArea, getExtensions, getMessageBus, getPicoContainer, getService, getService, getServiceIfCreated, hasComponent, instantiateClass, instantiateClassWithConstructorInjection, instantiateExtensionWithPicoContainerOnlyIfNeeded, isDisposedOrDisposeInProgress, logErrorgetUserData, putUserDatapublic static final Key<java.lang.Long> CREATION_TIME
public static final Key<java.lang.String> CREATION_TRACE
public static final java.lang.String LIGHT_PROJECT_NAME
protected ProjectImpl(java.nio.file.Path filePath,
java.lang.String projectName)
public final boolean isDisposed()
isDisposed in interface ComponentManagerdispose() was called but not completed yet)
public void setProjectStoreFactory(ProjectStoreFactory projectStoreFactory)
public void setProjectName(java.lang.String projectName)
setProjectName in interface ProjectExpublic final IProjectStore getStateStore()
public IComponentStore getComponentStore()
public boolean isInitialized()
isInitialized in interface Projectprotected ContainerDescriptor getContainerDescriptor(IdeaPluginDescriptorImpl pluginDescriptor)
public @SystemIndependent java.lang.String getProjectFilePath()
getProjectFilePath in interface Projectnull for default project.public VirtualFile getProjectFile()
Projectpath/to/project/project.ipr - for file-based projectspath/to/project/.idea/misc.xml - for directory-based projectsnull for default project.getProjectFile in interface Projectpublic VirtualFile getBaseDir()
Project.ipr file or .idea directory.null for default project.getBaseDir in interface Projectcom.intellij.openapi.project.ProjectUtil#guessProjectDir,
Project.getBasePath()public @SystemIndependent java.lang.String getBasePath()
Projectnull for default project.getBasePath in interface Projectcom.intellij.openapi.project.ProjectUtil#guessProjectDirpublic java.lang.String getName()
Projectpublic @SystemDependent java.lang.String getPresentableUrl()
Projectnull for default project.
Note: the word "presentable" here implies file system presentation, not a UI one.getPresentableUrl in interface Projectpublic java.lang.String getLocationHash()
getLocationHash in interface Projectpublic VirtualFile getWorkspaceFile()
ProjectReturns a workspace file:
path/to/project/project.iws - for file-based projectspath/to/project/.idea/workspace.xml - for directory-based onesnull for default project.getWorkspaceFile in interface Projectpublic void init(ProgressIndicator indicator)
protected void setProgressDuringInit(ProgressIndicator indicator)
public void dispose()
Disposabledispose in interface Disposablepublic java.lang.String toString()
public java.lang.String getCreationTrace()
public java.lang.String activityNamePrefix()
public final Disposable getEarlyDisposable()
ProjectExDisposable that will be disposed right after container started to be disposed.
Use it to dispose something that need to be disposed very early, e.g. Alarm.
Or, only and only in unit test mode, if you need to publish something to message bus during dispose.
In unit test mode light project is not disposed, but this disposable is disposed for each test.
So, you don't need to have another disposable and can use this one instead.
Dependent Disposable.dispose() may be called in any thread.
Implementation of Disposable.dispose() must be self-contained and isolated (getting services is forbidden, publishing to message bus is allowed only in tests).getEarlyDisposable in interface ProjectExpublic final void disposeEarlyDisposable()