Class TmfProjectRegistry
java.lang.Object
org.eclipse.tracecompass.tmf.ui.project.model.TmfProjectRegistry
- All Implemented Interfaces:
EventListener,org.eclipse.core.resources.IResourceChangeListener
public class TmfProjectRegistry
extends Object
implements org.eclipse.core.resources.IResourceChangeListener
Factory class storing TMF tracing projects and creating TMF project model elements.
- Version:
- 1.0
- Author:
- Francois Chouinard
-
Field Summary
Fields inherited from interface org.eclipse.core.resources.IResourceChangeListener
PROPERTY_EVENT_MASK -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddTracingNature(org.eclipse.core.resources.IProject project, org.eclipse.core.runtime.IProgressMonitor monitor) Add a the tracing nature to the given project resourcestatic org.eclipse.core.resources.IProjectcreateProject(String projectName, URI projectLocation, org.eclipse.core.runtime.IProgressMonitor monitor) Utility method to create a tracing project.static voiddispose()Disposes the project registrystatic ITmfProjectModelElementfindElement(org.eclipse.core.resources.IResource resource, boolean exact) Finds an existing project model element that matches the given resource.static TmfProjectElementgetProject(org.eclipse.core.resources.IProject project) Get the project model element for a project resourcestatic TmfProjectElementgetProject(org.eclipse.core.resources.IProject aProject, boolean force) Get the project model element for a project resourcestatic voidinit()Initializes the project registryvoidresourceChanged(org.eclipse.core.resources.IResourceChangeEvent event) voidtraceOpened(TmfTraceOpenedSignal signal) Handler for the Trace Opened signal
-
Method Details
-
init
public static void init()Initializes the project registry- Since:
- 3.3
-
dispose
public static void dispose()Disposes the project registry- Since:
- 2.3
-
getProject
Get the project model element for a project resource- Parameters:
project- the project resource- Returns:
- the project model element or null if it does not exist
-
getProject
public static TmfProjectElement getProject(org.eclipse.core.resources.IProject aProject, boolean force) Get the project model element for a project resource- Parameters:
aProject- the project resourceforce- a flag controlling whether a new project should be created if it doesn't exist- Returns:
- the project model element
-
createProject
public static org.eclipse.core.resources.IProject createProject(String projectName, URI projectLocation, org.eclipse.core.runtime.IProgressMonitor monitor) Utility method to create a tracing project.- Parameters:
projectName- - A project nameprojectLocation- - A project location URI. Use null for default location (which is workspace).monitor- - A progress monitor- Returns:
- the IProject object or null
-
addTracingNature
public static void addTracingNature(org.eclipse.core.resources.IProject project, org.eclipse.core.runtime.IProgressMonitor monitor) Add a the tracing nature to the given project resource- Parameters:
project- the project resourcemonitor- - A progress monitor- Since:
- 3.2
-
resourceChanged
public void resourceChanged(org.eclipse.core.resources.IResourceChangeEvent event) - Specified by:
resourceChangedin interfaceorg.eclipse.core.resources.IResourceChangeListener
-
traceOpened
Handler for the Trace Opened signal- Parameters:
signal- The incoming signal- Since:
- 3.1
-
findElement
public static ITmfProjectModelElement findElement(org.eclipse.core.resources.IResource resource, boolean exact) Finds an existing project model element that matches the given resource. Elements are not created if they do not already exist. If an exact match is not found andexactis false, returns the nearest existing parent element.- Parameters:
resource- the resourceexact- if an exact match is not found, returnsnullif true, or the nearest parent if false- Returns:
- the element, or
null - Since:
- 3.1
-