@OpenApi public class ProjectsManager extends java.lang.Object implements ProjectPersistenceManager
Modifier and Type | Method and Description |
---|---|
void |
addProjectListener(ProjectEventListener listener)
Adds new project listener.
|
void |
closeProject()
Closes current project.
|
void |
closeProject(Project project)
Closes given project
|
Project |
createProject()
Creates new project.
|
Project |
createProjectFromTemplate(java.lang.String templatePath)
Creates a new project from the given template.
|
void |
exportModule(Project prj,
java.util.Collection packages,
java.lang.String description,
ProjectDescriptor module)
Export local (not teamwork) module into given descriptor
|
IAttachedProject |
findAttachedProject(Project project,
ProjectDescriptor projectDescriptor)
Find used module according given project descriptor.
|
Project |
findProject(ProjectDescriptor projectDescriptor)
Find loaded project according given project descriptor.
|
Project |
getActiveProject()
Returns active open project.
|
java.util.List<Project> |
getProjects()
Returns list of open projects.
|
void |
importModule(Project project,
ProjectDescriptor descriptor)
Import module into project from given descriptor
|
boolean |
importProject(ProjectDescriptor pd)
Import project.
|
boolean |
isProjectActive(Project project)
Method checks if given project is active at this time.
|
void |
loadProject(ProjectDescriptor descriptor,
boolean silent)
Loads project from location, described in a project descriptor.
|
void |
reloadModule(Project project,
ProjectDescriptor projectDescriptor)
Reloads module.
|
void |
removeProjectListener(ProjectEventListener listener)
Removes project listener.
|
boolean |
saveModule(Project project,
IAttachedProject module,
boolean silent,
boolean temporalSave)
Save module from current project into given location.
|
boolean |
saveModule(Project project,
IAttachedProject module,
boolean silent,
ProgressStatus status)
Saves module without any additional dependencies checking.
|
boolean |
saveModule(Project project,
IAttachedProject module,
boolean silent,
ProgressStatus status,
boolean temporalSave)
Saves module without any additional dependencies checking.
|
boolean |
saveModule(Project project,
IAttachedProject module,
boolean silent,
ProgressStatus status,
java.net.URI saveTo)
Saves module without any additional dependencies checking.
|
boolean |
saveModule(Project project,
IAttachedProject module,
boolean silent,
ProgressStatus status,
java.net.URI saveTo,
boolean temporalSave)
Saves module without any additional dependencies checking.
|
boolean |
saveProject(ProjectDescriptor descriptor,
boolean silent)
Saves project into location specified by descriptor.
|
void |
setActiveProject(Project project)
Sets given project as active.
|
void |
sharePackage(Project project,
java.util.List<Package> packages)
|
void |
sharePackage(Project project,
java.util.List<Package> packages,
java.lang.String description)
Share given list of packages in project.
|
void |
unloadModule(Project project,
ProjectDescriptor moduleDescriptor)
Unload module
|
boolean |
useModule(Project project,
ProjectDescriptor module)
Use module in given project from given descriptor.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
loadProject, saveProject
@OpenApi public java.util.List<Project> getProjects()
@OpenApi public boolean isProjectActive(@CheckForNull Project project)
project
- project to check.@OpenApi public void setActiveProject(@CheckForNull Project project)
project
- the project to be set as active.@OpenApi @CheckForNull public Project getActiveProject()
@OpenApi public void addProjectListener(ProjectEventListener listener)
listener
- listener to be added.@OpenApi public void removeProjectListener(ProjectEventListener listener)
listener
- listener to be removed.@OpenApi public void loadProject(ProjectDescriptor descriptor, boolean silent)
loadProject
in interface ProjectPersistenceManager
descriptor
- the project descriptor.silent
- if true, loads without GUI interruptions.@OpenApi public boolean saveProject(ProjectDescriptor descriptor, boolean silent)
saveProject
in interface ProjectPersistenceManager
descriptor
- the project descriptor.silent
- if true, saves without GUI interruptions.@OpenApi public Project createProject()
@OpenApi @CheckForNull public Project createProjectFromTemplate(java.lang.String templatePath)
templatePath
- absolute template path@OpenApi public void closeProject()
@OpenApi public void closeProject(Project project)
project
- project to close@OpenApi public boolean useModule(Project project, ProjectDescriptor module)
Need to update ProjectOptions
before using local module:
String moduleDir = moduleFile.getParent();
ProjectOptions projectOptions = project.getOptions();
List
if (!directories.contains(moduleDir))
{
projectOptions.addModuleDirectory(moduleDir);
}
useModule
in interface ProjectPersistenceManager
project
- projectmodule
- module@OpenApi public void reloadModule(Project project, ProjectDescriptor projectDescriptor)
reloadModule
in interface ProjectPersistenceManager
project
- the project.projectDescriptor
- the ProjectDescriptor of the module.@OpenApi public void importModule(Project project, ProjectDescriptor descriptor) throws ReadOnlyElementException
importModule
in interface ProjectPersistenceManager
project
- projectdescriptor
- descriptorReadOnlyElementException
- if user has no rights to perform this action.@OpenApi public void exportModule(Project prj, java.util.Collection packages, java.lang.String description, ProjectDescriptor module)
exportModule
in interface ProjectPersistenceManager
prj
- current projectpackages
- "shared" packages in projectdescription
- module descriptionmodule
- module location descriptor@OpenApi public boolean saveModule(Project project, IAttachedProject module, boolean silent, boolean temporalSave)
saveModule
in interface ProjectPersistenceManager
project
- projectmodule
- module to savesilent
- do not show UI messagestemporalSave
- do not change module location after save@OpenApi public boolean saveModule(Project project, IAttachedProject module, boolean silent, ProgressStatus status)
saveModule
in interface ProjectPersistenceManager
project
- projectmodule
- module to savesilent
- save in silent modestatus
- progress status@OpenApi public boolean saveModule(Project project, IAttachedProject module, boolean silent, ProgressStatus status, boolean temporalSave)
saveModule
in interface ProjectPersistenceManager
project
- projectmodule
- module to savesilent
- save in silent modestatus
- progress statustemporalSave
- do not change module location after save@OpenApi public boolean saveModule(Project project, IAttachedProject module, boolean silent, ProgressStatus status, java.net.URI saveTo)
project
- projectmodule
- module to savestatus
- statussilent
- save in silent modesaveTo
- where to save module, can be null, then module is saved to module.getURI()
location@OpenApi public boolean saveModule(Project project, IAttachedProject module, boolean silent, @CheckForNull ProgressStatus status, @CheckForNull java.net.URI saveTo, boolean temporalSave)
project
- projectmodule
- module to savesilent
- save in silent modestatus
- progress statussaveTo
- where to save module, can be null, then module is saved to module.getURI() locationtemporalSave
- do not change module location after save@OpenApi public void unloadModule(Project project, ProjectDescriptor moduleDescriptor)
unloadModule
in interface ProjectPersistenceManager
project
- projectmoduleDescriptor
- module descriptor@OpenApi @CheckForNull public IAttachedProject findAttachedProject(Project project, ProjectDescriptor projectDescriptor)
project
- project using module.projectDescriptor
- project descriptor of module.@OpenApi @CheckForNull public Project findProject(ProjectDescriptor projectDescriptor)
projectDescriptor
- project descriptor.null
if project not found.@OpenApi @Deprecated public void sharePackage(Project project, java.util.List<Package> packages)
project
- Project where packages will be shared.packages
- List of packaged, dedicated for sharing.@OpenApi public void sharePackage(Project project, java.util.List<Package> packages, @CheckForNull java.lang.String description)
project
- Project where packages will be shared.packages
- List of packaged, dedicated for sharing.description
- share description, null if do not change/set the description.java.lang.RuntimeException
- if either some being shared package becomes invalid in the
main project (that is, has been deleted or moved to a module)
or is locked by another user@OpenApi public boolean importProject(ProjectDescriptor pd)
importProject
in interface ProjectPersistenceManager
pd
- project descriptor to import.