Class TmfExperimentElement

All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, ITmfProjectModelElement, org.eclipse.ui.views.properties.IPropertySource, org.eclipse.ui.views.properties.IPropertySource2

public class TmfExperimentElement extends TmfCommonProjectElement implements org.eclipse.ui.views.properties.IPropertySource2
Implementation of TMF Experiment Model Element.

Version:
1.0
Author:
Francois Chouinard
  • Constructor Details

    • TmfExperimentElement

      public TmfExperimentElement(String name, org.eclipse.core.resources.IFolder folder, TmfExperimentFolder parent)
      Constructor
      Parameters:
      name - The name of the experiment
      folder - The folder reference
      parent - The experiment folder reference.
  • Method Details

    • init

      public static void init()
      Initialize statically at startup by getting extensions from the platform extension registry.
    • getResource

      public org.eclipse.core.resources.IFolder getResource()
      Description copied from interface: ITmfProjectModelElement
      Returns the resource associated with the project model element.
      Specified by:
      getResource in interface ITmfProjectModelElement
      Overrides:
      getResource in class TmfProjectModelElement
      Returns:
      the model resource.
    • getAvailableChildrenAnalyses

      public List<TmfAnalysisElement> getAvailableChildrenAnalyses()
      Overrides:
      getAvailableChildrenAnalyses in class TmfCommonProjectElement
      Returns:
      list of children analysis elements
    • getIcon

      public @NonNull org.eclipse.swt.graphics.Image getIcon()
      Description copied from interface: ITmfProjectModelElement
      Returns the icon of this element.
      Specified by:
      getIcon in interface ITmfProjectModelElement
      Overrides:
      getIcon in class TmfCommonProjectElement
      Returns:
      The icon
      Since:
      2.0
    • getLabelText

      public String getLabelText()
      Description copied from interface: ITmfProjectModelElement
      Returns the text of the label of this element.
      Specified by:
      getLabelText in interface ITmfProjectModelElement
      Returns:
      The label text
      Since:
      2.0
    • refreshTraceType

      public void refreshTraceType()
      Refreshes the trace type filed by reading the trace type persistent property of the resource reference. If trace type is null after refresh, set it to the generic trace type (for seamless upgrade)
      Overrides:
      refreshTraceType in class TmfCommonProjectElement
    • getTraces

      public List<TmfTraceElement> getTraces()
      Returns a list of TmfTraceElements contained in this experiment.
      Overrides:
      getTraces in class TmfCommonProjectElement
      Returns:
      a list of TmfTraceElements
    • addTrace

      public void addTrace(TmfTraceElement trace)
      Adds a trace to the experiment
      Parameters:
      trace - The trace element to add
    • addTrace

      public void addTrace(TmfTraceElement trace, boolean refresh)
      Adds a trace to the experiment
      Parameters:
      trace - The trace element to add
      refresh - Flag for refreshing the project
    • removeTrace

      public void removeTrace(TmfTraceElement trace) throws org.eclipse.core.runtime.CoreException
      Removes a trace from an experiment
      Parameters:
      trace - The trace to remove
      Throws:
      org.eclipse.core.runtime.CoreException - exception
    • removeTrace

      public void removeTrace(TmfTraceElement trace, boolean closeEditors) throws org.eclipse.core.runtime.CoreException
      Removes a trace from an experiment
      Parameters:
      trace - The trace to remove
      closeEditors - if true, editors associated with this trace are first closed before proceeding, otherwise it is the responsibility of the caller to first close editors before calling the method
      Throws:
      org.eclipse.core.runtime.CoreException - exception
      Since:
      4.0
    • copy

      public org.eclipse.core.resources.IResource copy(String newName, boolean copySuppFiles, boolean copyAsLink)
      Description copied from class: TmfCommonProjectElement
      Copy this model element at the same place as this element (ex./Traces/thisElementPath).
      Overrides:
      copy in class TmfCommonProjectElement
      Parameters:
      newName - The name of the new element
      copySuppFiles - Whether to copy supplementary files or not
      copyAsLink - Whether to copy as a link or not
      Returns:
      the new Resource object
    • createBookmarksFile

      public org.eclipse.core.resources.IFile createBookmarksFile(org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
      Description copied from class: TmfCommonProjectElement
      Returns the file resource used to store bookmarks after creating it if necessary. If the trace resource is a file, it is returned directly. If the trace resource is a folder, a linked file is returned. The file will be created if it does not exist.
      Overrides:
      createBookmarksFile in class TmfCommonProjectElement
      Parameters:
      monitor - the progress monitor
      Returns:
      the bookmarks file
      Throws:
      org.eclipse.core.runtime.CoreException - if the bookmarks file cannot be created
    • getEditorId

      public String getEditorId()
      Description copied from class: TmfCommonProjectElement
      Returns the optional editor ID from the trace type extension.
      Specified by:
      getEditorId in class TmfCommonProjectElement
      Returns:
      the editor ID or null if not defined.
    • instantiateTrace

      public TmfExperiment instantiateTrace()
      Instantiate a TmfExperiment object based on the experiment type and the corresponding extension.
      Specified by:
      instantiateTrace in class TmfCommonProjectElement
      Returns:
      the TmfExperiment or null for an error
    • getTypeName

      public String getTypeName()
      Description copied from class: TmfCommonProjectElement
      Get a friendly name for the type of element this common project element is, to be displayed in UI messages.
      Specified by:
      getTypeName in class TmfCommonProjectElement
      Returns:
      A string for the type of project element this object is, for example "trace" or "experiment"
    • getEditableValue

      public Object getEditableValue()
      Specified by:
      getEditableValue in interface org.eclipse.ui.views.properties.IPropertySource
    • getPropertyDescriptors

      public org.eclipse.ui.views.properties.IPropertyDescriptor[] getPropertyDescriptors()
      Specified by:
      getPropertyDescriptors in interface org.eclipse.ui.views.properties.IPropertySource
    • getPropertyValue

      public Object getPropertyValue(Object id)
      Specified by:
      getPropertyValue in interface org.eclipse.ui.views.properties.IPropertySource
    • resetPropertyValue

      public void resetPropertyValue(Object id)
      Specified by:
      resetPropertyValue in interface org.eclipse.ui.views.properties.IPropertySource
    • setPropertyValue

      public void setPropertyValue(Object id, Object value)
      Specified by:
      setPropertyValue in interface org.eclipse.ui.views.properties.IPropertySource
    • isPropertyResettable

      public boolean isPropertyResettable(Object id)
      Specified by:
      isPropertyResettable in interface org.eclipse.ui.views.properties.IPropertySource2
    • isPropertySet

      public boolean isPropertySet(Object id)
      Specified by:
      isPropertySet in interface org.eclipse.ui.views.properties.IPropertySource
      Specified by:
      isPropertySet in interface org.eclipse.ui.views.properties.IPropertySource2
    • getSuffix

      public String getSuffix()
      Return the suffix for resource names
      Returns:
      The folder suffix