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 Type
    Method
    Description
    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
    static org.eclipse.core.resources.IProject
    createProject(String projectName, URI projectLocation, org.eclipse.core.runtime.IProgressMonitor monitor)
    Utility method to create a tracing project.
    static void
    Disposes the project registry
    findElement(org.eclipse.core.resources.IResource resource, boolean exact)
    Finds an existing project model element that matches the given resource.
    getProject(org.eclipse.core.resources.IProject project)
    Get the project model element for a project resource
    getProject(org.eclipse.core.resources.IProject aProject, boolean force)
    Get the project model element for a project resource
    static void
    Initializes the project registry
    void
    resourceChanged(org.eclipse.core.resources.IResourceChangeEvent event)
     
    void
    Handler for the Trace Opened signal

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      public static TmfProjectElement getProject(org.eclipse.core.resources.IProject project)
      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 resource
      force - 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 name
      projectLocation - - 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 resource
      monitor - - A progress monitor
      Since:
      3.2
    • resourceChanged

      public void resourceChanged(org.eclipse.core.resources.IResourceChangeEvent event)
      Specified by:
      resourceChanged in interface org.eclipse.core.resources.IResourceChangeListener
    • traceOpened

      public void traceOpened(TmfTraceOpenedSignal signal)
      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 and exact is false, returns the nearest existing parent element.
      Parameters:
      resource - the resource
      exact - if an exact match is not found, returns null if true, or the nearest parent if false
      Returns:
      the element, or null
      Since:
      3.1