Package org.eclipse.emf.ecp.core
Interface ECPProjectManager
-
- All Known Implementing Classes:
ECPProjectManagerImpl
public interface ECPProjectManager
The ECPProjectManager provides access to ECPProjects and manages their lifecycle. It is available as an OSGi service or usingECPUtil
It publishes observable events on theECPObserverBus
. Related Observer types:ECPProjectsChangedObserver
,ECPProjectContentChangedObserver
,ECPProjectOpenClosedObserver
,ECPProjectPreDeleteObserver
. UseECPUtil#getECPObserverBus()
to retrieve the ObserverBus andECPObserverBus#register(ECPObserver)
to register an Observer.- Author:
- Eike Stepper, Jonas, Eugen Neufeld
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ECPProject
createProject(ECPProject project, java.lang.String name)
Method to construct a new Project based on an existing project as template.ECPProject
createProject(ECPProvider provider, java.lang.String name)
Method to construct an offline Project, this method callscreateProject(ECPProvider, String, ECPProperties)
with empty properties.ECPProject
createProject(ECPProvider provider, java.lang.String name, ECPProperties properties)
Method to construct an offline Project and notify listeners about this add.ECPProject
createProject(ECPRepository repository, java.lang.String name, ECPProperties properties)
Method to construct an shared Project, e.g.ECPProject
getProject(java.lang.Object adaptable)
Retrieves the project the adaptable belongs to if possible.ECPProject
getProject(java.lang.String name)
Searches for a project based on the providedString
.java.util.Collection<ECPProject>
getProjects()
Returns all known projects.
-
-
-
Method Detail
-
createProject
ECPProject createProject(ECPProvider provider, java.lang.String name) throws ECPProjectWithNameExistsException
Method to construct an offline Project, this method callscreateProject(ECPProvider, String, ECPProperties)
with empty properties. IfECPProvider.hasCreateProjectWithoutRepositorySupport()
returns false an UnsupportedOperationException is thrown.- Parameters:
provider
- theECPProvider
of this projectname
- the name of the project- Returns:
- created
ECPProject
- Throws:
ECPProjectWithNameExistsException
- when a project with the same name already exists
-
createProject
ECPProject createProject(ECPProvider provider, java.lang.String name, ECPProperties properties) throws ECPProjectWithNameExistsException
Method to construct an offline Project and notify listeners about this add. IfECPProvider.hasCreateProjectWithoutRepositorySupport()
returns false an UnsupportedOperationException is thrown.- Parameters:
provider
- theECPProvider
of this projectname
- the name of the projectproperties
- the project properties- Returns:
- created
ECPProject
- Throws:
ECPProjectWithNameExistsException
- when a project with the same name already exists
-
createProject
ECPProject createProject(ECPRepository repository, java.lang.String name, ECPProperties properties) throws ECPProjectWithNameExistsException
Method to construct an shared Project, e.g. during a checkout, and notify listeners about this add.- Parameters:
repository
- theECPRepository
of this projectname
- the name of the projectproperties
- the project properties- Returns:
- created
ECPProject
- Throws:
ECPProjectWithNameExistsException
- when a project with the same name already exists
-
createProject
ECPProject createProject(ECPProject project, java.lang.String name)
Method to construct a new Project based on an existing project as template. If the template project is shared, so is the created project.- Parameters:
project
- the templateECPProject
name
- the name of the created project- Returns:
- the clone of the
ECPProject
-
getProject
ECPProject getProject(java.lang.Object adaptable)
Retrieves the project the adaptable belongs to if possible. This method checks whether the adaptable isECPProjectAware
and else uses the AdapterUtil to adapt to a project.- Parameters:
adaptable
- the Object to adapt- Returns:
- the adapted
ECPProject
-
getProject
ECPProject getProject(java.lang.String name)
Searches for a project based on the providedString
.- Parameters:
name
- of the project to search for- Returns:
- the
ECPProject
-
getProjects
java.util.Collection<ECPProject> getProjects()
Returns all known projects.- Returns:
- an array of all known projects
-
-