Class TmfOpenTraceHelper
java.lang.Object
org.eclipse.tracecompass.tmf.ui.project.model.TmfOpenTraceHelper
Open trace helper
Helper class for opening trace resources and loading them to a tracing
project.
- Author:
- Matthew Khouzam
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Job that creates a new trace instance for the specified project element and opens its associated editor. -
Method Summary
Modifier and TypeMethodDescriptionstatic org.eclipse.core.runtime.IStatus
openFromElement
(TmfCommonProjectElement traceElement) Open a trace (or experiment) from a project element.static org.eclipse.core.runtime.IStatus
openTraceFromPath
(TmfTraceFolder destinationFolder, String path, org.eclipse.swt.widgets.Shell shell) Opens a trace from a path while importing it to the destination folder.static org.eclipse.core.runtime.IStatus
openTraceFromPath
(TmfTraceFolder destinationFolder, String path, org.eclipse.swt.widgets.Shell shell, String tracetypeHint) Opens a trace from a path while importing it to the destination folder.static void
reopenTraceFromElement
(TmfCommonProjectElement traceElement, org.eclipse.ui.IReusableEditor editor) Reopen a trace or experiment from a project element in the provided editor
-
Method Details
-
openTraceFromPath
public static org.eclipse.core.runtime.IStatus openTraceFromPath(TmfTraceFolder destinationFolder, String path, org.eclipse.swt.widgets.Shell shell) throws org.eclipse.core.runtime.CoreException Opens a trace from a path while importing it to the destination folder. The trace is linked as a resource.- Parameters:
destinationFolder
- The destination trace folderpath
- the file to importshell
- the shell to use for dialogs- Returns:
- IStatus OK if successful. In addition to the OK status, a code OK
means the trace will be opened correctly, otherwise, a code of
IStatus.INFO
means the operation completely successfully, but the path won't be opened as a trace. - Throws:
org.eclipse.core.runtime.CoreException
- core exceptions if something is not well set up in the back end
-
openTraceFromPath
public static org.eclipse.core.runtime.IStatus openTraceFromPath(TmfTraceFolder destinationFolder, String path, org.eclipse.swt.widgets.Shell shell, String tracetypeHint) throws org.eclipse.core.runtime.CoreException Opens a trace from a path while importing it to the destination folder. The trace is linked as a resource.- Parameters:
destinationFolder
- The destination trace folderpath
- the file to importshell
- the shell to use for dialogstracetypeHint
- The trace type id, can be null- Returns:
- IStatus OK if successful. In addition to the OK status, a code OK
means the trace will be opened correctly, otherwise, a code of
IStatus.INFO
means the operation completely successfully, but the path won't be opened as a trace. - Throws:
org.eclipse.core.runtime.CoreException
- core exceptions if something is not well set up in the back end
-
openFromElement
public static org.eclipse.core.runtime.IStatus openFromElement(TmfCommonProjectElement traceElement) Open a trace (or experiment) from a project element. If the trace is already opened, its editor is activated and brought to top.- Parameters:
traceElement
- theTmfTraceElement
to open- Returns:
- The status of the opening. If the status is
IStatus.OK
, then the element will be opened. In addition to the OK status, a code OK means that a trace trace will be opened correctly, otherwise, a code ofIStatus.INFO
means the operation completely successfully, but the path won't be opened as a trace. - Since:
- 5.2
-
reopenTraceFromElement
public static void reopenTraceFromElement(TmfCommonProjectElement traceElement, org.eclipse.ui.IReusableEditor editor) Reopen a trace or experiment from a project element in the provided editor- Parameters:
traceElement
- theTmfTraceElement
to openeditor
- the reusable editor
-