TMF: Add info for output extension point in analysis module documentation
authorGeneviève Bastien <gbastien+lttng@versatic.net>
Tue, 3 Jun 2014 19:27:47 +0000 (15:27 -0400)
committerGenevieve Bastien <gbastien+lttng@versatic.net>
Fri, 6 Jun 2014 12:46:20 +0000 (08:46 -0400)
Change-Id: Ia6bf075226a58031d46954af98c192663b347177
Signed-off-by: Geneviève Bastien <gbastien+lttng@versatic.net>
Reviewed-on: https://git.eclipse.org/r/27986
Tested-by: Hudson CI
org.eclipse.linuxtools.tmf.help/doc/Developer-Guide.mediawiki

index ad50f8234337a96950371b7a088ce8ed6f784c3c..6708d4763f1f9d01ae10f8904651b871f7b7d8fb 100644 (file)
@@ -3329,12 +3329,38 @@ Note that with these extension points, it is possible to use the same module cla
 
 Analyses will typically produce outputs the user can examine. Outputs can be a text dump, a .dot file, an XML file, a view, etc. All output types must implement the '''IAnalysisOutput''' interface.
 
-An output can be registered to an analysis module at any moment by calling the '''IAnalysisModule#registerOutput()''' method. Analyses themselves will know what outputs are available and may register them in the analysis constructor or after analysis completion.
+An output can be registered to an analysis module at any moment by calling the '''IAnalysisModule#registerOutput()''' method. Analyses themselves may know what outputs are available and may register them in the analysis constructor or after analysis completion.
 
 The various concrete output types are:
 
 * '''TmfAnalysisViewOutput''': It takes a view ID as parameter and, when selected, opens the view.
 
+=== Using the extension point to add outputs ===
+
+Analysis outputs can also be hooked to an analysis using the same extension point ''org.eclipse.linuxtools.tmf.core.analysis'' in the plugin.xml file. Outputs can be matched either to a specific analysis identified by an ID, or to all analysis modules extending or implementing a given class or interface.
+
+The following code shows how to add a view output to the analysis defined above directly in the plugin.xml file. This extension does not have to be in the same plugin as the extension defining the analysis. Typically, an analysis module can be defined in a core plugin, along with some outputs that do not require UI elements. Other outputs, like views, who need UI elements, will be defined in a ui plugin.
+
+<pre>
+<extension
+         point="org.eclipse.linuxtools.tmf.core.analysis">
+      <output
+            class="org.eclipse.linuxtools.tmf.ui.analysis.TmfAnalysisViewOutput"
+            id="my.plugin.package.ui.views.myView">
+         <analysisId
+               id="my.lttng.kernel.analysis.id">
+         </analysisId>
+      </output>
+      <output
+            class="org.eclipse.linuxtools.tmf.ui.analysis.TmfAnalysisViewOutput"
+            id="my.plugin.package.ui.views.myMoreGenericView">
+         <analysisModuleClass
+               class="my.plugin.package.core.MyAnalysisModuleClass">
+         </analysisModuleClass>
+      </output>
+</extension>
+</pre>
+
 == Providing help for the module ==
 
 For now, the only way to provide a meaningful help message to the user is by overriding the '''IAnalysisModule#getHelpText()''' method and return a string that will be displayed in a message box.
This page took 0.027972 seconds and 5 git commands to generate.