public class ProjectManagerImpl extends ProjectManagerEx implements Disposable
Modifier and Type | Class and Description |
---|---|
static class |
ProjectManagerImpl.UnableToSaveProjectNotification |
Disposable.Parent
Modifier and Type | Field and Description |
---|---|
static int |
TEST_PROJECTS_CREATED |
TOPIC
Constructor and Description |
---|
ProjectManagerImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addProjectManagerListener(ProjectManagerListener listener) |
void |
addProjectManagerListener(ProjectManagerListener listener,
Disposable parentDisposable) |
void |
addProjectManagerListener(Project project,
ProjectManagerListener listener)
Adds listener to the specified project.
|
void |
addProjectManagerListener(VetoableProjectManagerListener listener) |
boolean |
canClose(Project project) |
boolean |
closeAndDispose(Project project)
Save, close and dispose project.
|
boolean |
closeAndDisposeAllProjects(boolean checkCanClose) |
boolean |
closeProject(Project project)
Closes the specified project, but does not dispose it.
|
void |
dispose()
Usually not invoked directly, see class javadoc.
|
static ProjectImpl |
doCreateProject(java.lang.String projectName,
java.nio.file.Path filePath) |
Project |
findOpenProjectByHash(java.lang.String locationHash) |
boolean |
forceCloseProject(Project project)
The project and the app settings will be not saved.
|
boolean |
forceCloseProject(Project project,
boolean dispose) |
java.lang.String [] |
getAllExcludedUrls() |
Project |
getDefaultProject()
Returns the project which is used as a template for new projects.
|
Project [] |
getOpenProjects()
Returns the list of currently opened projects.
|
static void |
initProject(java.nio.file.Path file,
ProjectImpl project,
boolean isRefreshVfsNeeded,
Project template,
ProgressIndicator indicator) |
boolean |
isDefaultProjectInitialized() |
static boolean |
isLight(Project project) |
boolean |
isProjectOpened(Project project) |
Project |
loadAndOpenProject(java.nio.file.Path file) |
Project |
loadAndOpenProject(java.lang.String originalFilePath)
Loads and opens a project with the specified path.
|
Project |
loadProject(java.nio.file.Path file,
java.lang.String projectName) |
static Project |
loadProject(java.nio.file.Path file,
java.lang.String projectName,
java.util.function.Consumer<Project> beforeInit) |
Project |
newProject(java.nio.file.Path projectFile,
java.lang.String projectName,
OpenProjectTask options) |
Project |
newProject(java.lang.String projectName,
java.lang.String filePath,
boolean useDefaultProjectSettings,
boolean isDummy) |
boolean |
openProject(Project project) |
void |
openTestProject(Project project) |
void |
reloadProject(Project project)
Asynchronously reloads the specified project.
|
void |
removeProjectManagerListener(ProjectManagerListener listener) |
void |
removeProjectManagerListener(Project project,
ProjectManagerListener listener)
Removes listener from the specified project.
|
void |
removeProjectManagerListener(VetoableProjectManagerListener listener) |
static void |
showCannotConvertMessage(CannotConvertException e,
java.awt.Component component) |
blockReloadingProjectOnExternalChanges, createProject, getInstanceEx, getInstanceExIfCreated, loadProject, loadProject, newProjectForTest, unblockReloadingProjectOnExternalChanges
getInstance, getInstanceIfCreated, loadAndOpenProject
public void dispose()
Disposable
dispose
in interface Disposable
public Project newProject(java.lang.String projectName, java.lang.String filePath, boolean useDefaultProjectSettings, boolean isDummy)
newProject
in class ProjectManagerEx
filePath
- path to .ipr file or directory where .idea directory is locatedpublic Project newProject(java.nio.file.Path projectFile, java.lang.String projectName, OpenProjectTask options)
newProject
in class ProjectManagerEx
public static void initProject(java.nio.file.Path file, ProjectImpl project, boolean isRefreshVfsNeeded, Project template, ProgressIndicator indicator)
public static ProjectImpl doCreateProject(java.lang.String projectName, java.nio.file.Path filePath)
public Project loadProject(java.nio.file.Path file, java.lang.String projectName)
loadProject
in class ProjectManagerEx
public static Project loadProject(java.nio.file.Path file, java.lang.String projectName, java.util.function.Consumer<Project> beforeInit)
public boolean isDefaultProjectInitialized()
isDefaultProjectInitialized
in class ProjectManagerEx
public Project getDefaultProject()
ProjectManager
Project
instance is not
supposed to be used for anything except template settings storage.
NB: default project can be lazy loadedgetDefaultProject
in class ProjectManager
public Project [] getOpenProjects()
ProjectManager
ComponentManager.isDisposed()
must be checked for each project before use (if the whole operation is not under read action).getOpenProjects
in class ProjectManager
public boolean isProjectOpened(Project project)
isProjectOpened
in class ProjectManagerEx
public boolean openProject(Project project)
openProject
in class ProjectManagerEx
public Project findOpenProjectByHash(java.lang.String locationHash)
findOpenProjectByHash
in class ProjectManagerEx
public Project loadAndOpenProject(java.lang.String originalFilePath)
ProjectManager
loadAndOpenProject
in class ProjectManager
originalFilePath
- the .ipr file pathpublic Project loadAndOpenProject(java.nio.file.Path file)
loadAndOpenProject
in class ProjectManager
public static void showCannotConvertMessage(CannotConvertException e, java.awt.Component component)
public void openTestProject(Project project)
openTestProject
in class ProjectManagerEx
public void reloadProject(Project project)
ProjectManager
reloadProject
in class ProjectManager
project
- the project to reload.public final boolean closeProject(Project project)
ProjectManager
closeProject
in class ProjectManager
project
- the project to close.public final boolean forceCloseProject(Project project, boolean dispose)
public boolean forceCloseProject(Project project)
ProjectManagerEx
forceCloseProject
in class ProjectManagerEx
public boolean closeAndDisposeAllProjects(boolean checkCanClose)
closeAndDisposeAllProjects
in class ProjectManagerEx
public static boolean isLight(Project project)
public boolean closeAndDispose(Project project)
ProjectManagerEx
closeAndDispose
in class ProjectManagerEx
public void addProjectManagerListener(ProjectManagerListener listener)
addProjectManagerListener
in class ProjectManager
public void addProjectManagerListener(VetoableProjectManagerListener listener)
addProjectManagerListener
in class ProjectManager
public void addProjectManagerListener(ProjectManagerListener listener, Disposable parentDisposable)
addProjectManagerListener
in class ProjectManager
public void removeProjectManagerListener(ProjectManagerListener listener)
removeProjectManagerListener
in class ProjectManager
public void removeProjectManagerListener(VetoableProjectManagerListener listener)
removeProjectManagerListener
in class ProjectManager
public void addProjectManagerListener(Project project, ProjectManagerListener listener)
ProjectManager
addProjectManagerListener
in class ProjectManager
project
- project to add listener tolistener
- listener to addpublic void removeProjectManagerListener(Project project, ProjectManagerListener listener)
ProjectManager
removeProjectManagerListener
in class ProjectManager
project
- project to remove listener fromlistener
- listener to removepublic boolean canClose(Project project)
canClose
in class ProjectManagerEx
public java.lang.String [] getAllExcludedUrls()
getAllExcludedUrls
in class ProjectManagerEx