1
/*******************************************************************************
2
* Copyright (c) 2013, 2014 École Polytechnique de Montréal
4
* All rights reserved. This program and the accompanying materials are
5
* made available under the terms of the Eclipse Public License v1.0 which
6
* accompanies this distribution, and is available at
7
* http://www.eclipse.org/legal/epl-v10.html
10
* Geneviève Bastien - Initial API and implementation
11
*******************************************************************************/
13
package org.eclipse.linuxtools.tmf.core.analysis;
15
import org.eclipse.jdt.annotation.NonNull;
16
import org.eclipse.linuxtools.tmf.core.exceptions.TmfAnalysisException;
17
import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
18
import org.osgi.framework.Bundle;
21
* Interface for modules helpers that provide basic module information and
22
* creates module from a source when requested.
24
* @author Geneviève Bastien
27
public interface IAnalysisModuleHelper extends IAnalysisRequirementProvider {
29
// ------------------------------------
31
// ------------------------------------
34
* Gets the id of the analysis module
36
* @return The id of the module
41
* Gets the name of the analysis module
43
* @return The id of the module
48
* Gets whether the analysis should be run automatically at trace opening
50
* @return true if analysis is to be run automatically
52
boolean isAutomatic();
55
* Gets a generic help message/documentation for this analysis module
57
* This help text will be displayed to the user and may contain information
58
* on what the module does, how to use it and how to correctly generate the
59
* trace to make it available
61
* TODO: Help texts could be quite long. They should reside in their own
62
* file and be accessed either with text, for a command line man page, or
63
* through the eclipse help context. There should be a custom way to make it
64
* available through the helper, without instantiating the analysis, though
65
* help text after analysis instantiation may be richer.
67
* @return The generic help text
72
* Gets a specific help message/documentation for this analysis module
73
* applied on the given trace. This help message can add information on the
74
* status of this analysis for a given trace, whether it can be executed or
77
* This help text will be displayed to the user and may contain information
78
* on what the module does, how to use it and how to correctly generate the
79
* trace to make it available
82
* A trace for which to get specific help message
83
* @return The generic help text
85
String getHelpText(@NonNull ITmfTrace trace);
88
* Gets the icon for this module
90
* @return The icon path
95
* Gets the bundle this analysis module is part of
102
* Does an analysis apply to a given trace type (otherwise, it is not shown)
105
* The trace to analyze
106
* @return whether the analysis applies
108
boolean appliesToTraceType(Class<? extends ITmfTrace> traceclass);
111
* Gets the list of valid trace types that the analysis can operate on.
113
* @return List of the trace type
115
Iterable<Class<? extends ITmfTrace>> getValidTraceTypes();
117
// ---------------------------------------
119
// ---------------------------------------
122
* Creates a new instance of the {@link IAnalysisModule} represented by this
123
* helper and initializes it with the trace.
125
* After the module is fully created, this method should call
126
* {@link TmfAnalysisManager#analysisModuleCreated(IAnalysisModule)} in
127
* order for the new module listeners to be executed on this module.
130
* The trace to be linked to the module
131
* @return A new {@link IAnalysisModule} instance initialized with the
133
* @throws TmfAnalysisException
134
* Exceptions that occurred when setting trace
136
IAnalysisModule newModule(ITmfTrace trace) throws TmfAnalysisException;