Class TmfExperimentElement
java.lang.Object
org.eclipse.tracecompass.tmf.ui.project.model.TmfProjectModelElement
org.eclipse.tracecompass.tmf.ui.project.model.TmfCommonProjectElement
org.eclipse.tracecompass.tmf.ui.project.model.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 Summary
ConstructorsConstructorDescriptionTmfExperimentElement(String name, org.eclipse.core.resources.IFolder folder, TmfExperimentFolder parent) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTrace(TmfTraceElement trace) Adds a trace to the experimentvoidaddTrace(TmfTraceElement trace, boolean refresh) Adds a trace to the experimentorg.eclipse.core.resources.IResourceCopy this model element at the same place as this element (ex./Traces/thisElementPath).org.eclipse.core.resources.IFilecreateBookmarksFile(org.eclipse.core.runtime.IProgressMonitor monitor) Returns the file resource used to store bookmarks after creating it if necessary.Returns the optional editor ID from the trace type extension.@NonNull org.eclipse.swt.graphics.ImagegetIcon()Returns the icon of this element.Returns the text of the label of this element.org.eclipse.ui.views.properties.IPropertyDescriptor[]org.eclipse.core.resources.IFolderReturns the resource associated with the project model element.Return the suffix for resource namesReturns a list of TmfTraceElements contained in this experiment.Get a friendly name for the type of element this common project element is, to be displayed in UI messages.static voidinit()Initialize statically at startup by getting extensions from the platform extension registry.Instantiate aTmfExperimentobject based on the experiment type and the corresponding extension.booleanbooleanisPropertySet(Object id) voidRefreshes the trace type filed by reading the trace type persistent property of the resource reference.voidremoveTrace(TmfTraceElement trace) Removes a trace from an experimentvoidremoveTrace(TmfTraceElement trace, boolean closeEditors) Removes a trace from an experimentvoidvoidsetPropertyValue(Object id, Object value) Methods inherited from class org.eclipse.tracecompass.tmf.ui.project.model.TmfCommonProjectElement
closeEditors, copy, copy, copySupplementaryFolder, copySupplementaryFolder, deleteSupplementaryFolder, deleteSupplementaryResources, deleteSupplementaryResources, dispose, getAvailableAnalysis, getBookmarksFile, getChildElementReports, getDestinationPathRelativeToParent, getElementPath, getSupplementaryResources, getTrace, getTraceType, hasSupplementaryResources, prepareSupplementaryFolder, refreshSupplementaryFolder, refreshSupplementaryFolder, renameSupplementaryFolderMethods inherited from class org.eclipse.tracecompass.tmf.ui.project.model.TmfProjectModelElement
equals, getAdapter, getChildren, getLocation, getName, getParent, getPath, getProject, getTraceSupplementaryFolder, hashCode, prepareTraceSupplementaryFolder, prepareTraceSupplementaryFolder, refresh, refreshViewer, toStringMethods inherited from interface org.eclipse.tracecompass.tmf.ui.project.model.ITmfProjectModelElement
getChild, hasChildren
-
Constructor Details
-
TmfExperimentElement
public TmfExperimentElement(String name, org.eclipse.core.resources.IFolder folder, TmfExperimentFolder parent) Constructor- Parameters:
name- The name of the experimentfolder- The folder referenceparent- 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:ITmfProjectModelElementReturns the resource associated with the project model element.- Specified by:
getResourcein interfaceITmfProjectModelElement- Overrides:
getResourcein classTmfProjectModelElement- Returns:
- the model resource.
-
getAvailableChildrenAnalyses
- Overrides:
getAvailableChildrenAnalysesin classTmfCommonProjectElement- Returns:
- list of children analysis elements
-
getIcon
public @NonNull org.eclipse.swt.graphics.Image getIcon()Description copied from interface:ITmfProjectModelElementReturns the icon of this element.- Specified by:
getIconin interfaceITmfProjectModelElement- Overrides:
getIconin classTmfCommonProjectElement- Returns:
- The icon
- Since:
- 2.0
-
getLabelText
Description copied from interface:ITmfProjectModelElementReturns the text of the label of this element.- Specified by:
getLabelTextin interfaceITmfProjectModelElement- 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:
refreshTraceTypein classTmfCommonProjectElement
-
getTraces
Returns a list of TmfTraceElements contained in this experiment.- Overrides:
getTracesin classTmfCommonProjectElement- Returns:
- a list of TmfTraceElements
-
addTrace
Adds a trace to the experiment- Parameters:
trace- The trace element to add
-
addTrace
Adds a trace to the experiment- Parameters:
trace- The trace element to addrefresh- Flag for refreshing the project
-
removeTrace
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 removecloseEditors- 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:TmfCommonProjectElementCopy this model element at the same place as this element (ex./Traces/thisElementPath).- Overrides:
copyin classTmfCommonProjectElement- Parameters:
newName- The name of the new elementcopySuppFiles- Whether to copy supplementary files or notcopyAsLink- 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:TmfCommonProjectElementReturns 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:
createBookmarksFilein classTmfCommonProjectElement- Parameters:
monitor- the progress monitor- Returns:
- the bookmarks file
- Throws:
org.eclipse.core.runtime.CoreException- if the bookmarks file cannot be created
-
getEditorId
Description copied from class:TmfCommonProjectElementReturns the optional editor ID from the trace type extension.- Specified by:
getEditorIdin classTmfCommonProjectElement- Returns:
- the editor ID or
nullif not defined.
-
instantiateTrace
Instantiate aTmfExperimentobject based on the experiment type and the corresponding extension.- Specified by:
instantiateTracein classTmfCommonProjectElement- Returns:
- the
TmfExperimentornullfor an error
-
getTypeName
Description copied from class:TmfCommonProjectElementGet a friendly name for the type of element this common project element is, to be displayed in UI messages.- Specified by:
getTypeNamein classTmfCommonProjectElement- Returns:
- A string for the type of project element this object is, for example "trace" or "experiment"
-
getEditableValue
- Specified by:
getEditableValuein interfaceorg.eclipse.ui.views.properties.IPropertySource
-
getPropertyDescriptors
public org.eclipse.ui.views.properties.IPropertyDescriptor[] getPropertyDescriptors()- Specified by:
getPropertyDescriptorsin interfaceorg.eclipse.ui.views.properties.IPropertySource
-
getPropertyValue
- Specified by:
getPropertyValuein interfaceorg.eclipse.ui.views.properties.IPropertySource
-
resetPropertyValue
- Specified by:
resetPropertyValuein interfaceorg.eclipse.ui.views.properties.IPropertySource
-
setPropertyValue
- Specified by:
setPropertyValuein interfaceorg.eclipse.ui.views.properties.IPropertySource
-
isPropertyResettable
- Specified by:
isPropertyResettablein interfaceorg.eclipse.ui.views.properties.IPropertySource2
-
isPropertySet
- Specified by:
isPropertySetin interfaceorg.eclipse.ui.views.properties.IPropertySource- Specified by:
isPropertySetin interfaceorg.eclipse.ui.views.properties.IPropertySource2
-
getSuffix
Return the suffix for resource names- Returns:
- The folder suffix
-