Tmf: Add the experiment type to the trace type extension point
authorGeneviève Bastien <gbastien+lttng@versatic.net>
Tue, 14 Jan 2014 20:56:37 +0000 (15:56 -0500)
committerGenevieve Bastien <gbastien+lttng@versatic.net>
Tue, 4 Mar 2014 15:03:46 +0000 (10:03 -0500)
This will allow to define experiment types using the same extension point as
the trace type, so the same handlers and contribution items can be used.

Change-Id: I8ae7da262e2a1e7eab78cf9e763f1fbc0babf5fb
Signed-off-by: Geneviève Bastien <gbastien+lttng@versatic.net>
Reviewed-on: https://git.eclipse.org/r/13787
Tested-by: Hudson CI
Reviewed-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
IP-Clean: Bernd Hufmann <bernd.hufmann@ericsson.com>
Tested-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
org.eclipse.linuxtools.tmf.core/plugin.properties
org.eclipse.linuxtools.tmf.core/plugin.xml
org.eclipse.linuxtools.tmf.core/schema/org.eclipse.linuxtools.tmf.core.tracetype.exsd
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/project/model/TmfTraceType.java
org.eclipse.linuxtools.tmf.ui/plugin.xml
org.eclipse.linuxtools.tmf.ui/schema/org.eclipse.linuxtools.tmf.ui.tracetypeui.exsd
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfTraceTypeUIUtils.java

index 237a0e0183a3f0f3b0bc2a7545046c5cc7443660..be7438f4d24bd6ed45838ff233e5ac741ddf4b5b 100644 (file)
@@ -17,3 +17,6 @@ Bundle-Name = Linux Tools TMF Core Plug-in
 # CTF trace type
 tracetype.category.ctf = Common Trace Format
 tracetype.type.ctf = Generic CTF Trace
+
+# Experiment type
+experimenttype.type.generic = Generic Experiment
index c361fbf5038c3d7f13fa8a2ff45945d39193b25b..960af79353c7857e7e4fa1dcce58d53cc2a2a639 100644 (file)
             name="%tracetype.type.ctf"
             trace_type="org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace">
       </type>
+      <experiment
+            id="org.eclipse.linuxtools.tmf.core.experiment.generic"
+            name="%experimenttype.type.generic"
+            experiment_type="org.eclipse.linuxtools.tmf.core.trace.TmfExperiment">
+      </experiment>
    </extension>
 </plugin>
index 61e2a51d54c61c679f79e79383b21eb1e076b030..63d9eb93c927bdbac430e66962b452592eba2730 100644 (file)
@@ -6,7 +6,7 @@
          <meta.schema plugin="org.eclipse.linuxtools.tmf.core" id="tracetype" name="TMF Trace Type"/>
       </appinfo>
       <documentation>
-         This extension point is used to contribute new trace types to the generic components of the TMF framework.
+         This extension point is used to contribute new trace types or experiment types to the generic components of the TMF framework.
       </documentation>
    </annotation>
 
@@ -20,6 +20,7 @@
          <choice minOccurs="0" maxOccurs="unbounded">
             <element ref="category"/>
             <element ref="type"/>
+            <element ref="experiment"/>
          </choice>
          <attribute name="point" type="string" use="required">
             <annotation>
       </complexType>
    </element>
 
+   <element name="experiment">
+      <complexType>
+         <attribute name="id" type="string" use="required">
+            <annotation>
+               <documentation>
+                  The unique ID that identifies this experiment type.
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="name" type="string" use="required">
+            <annotation>
+               <documentation>
+                  The type name as it is displayed to the end user.
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="category" type="string">
+            <annotation>
+               <documentation>
+                  An optional attribute that is composed of the category ID. The referenced category must be declared in a corresponding category element.
+               </documentation>
+               <appinfo>
+                  <meta.attribute kind="identifier" basedOn="org.eclipse.linuxtools.tmf.core.tracetype/category/@id"/>
+               </appinfo>
+            </annotation>
+         </attribute>
+         <attribute name="experiment_type" type="string" use="required">
+            <annotation>
+               <documentation>
+                  The fully qualified name of a class that extends the &lt;samp&gt;TmfExperiment&lt;/samp&gt; class
+               </documentation>
+               <appinfo>
+                  <meta.attribute kind="java" basedOn="org.eclipse.linuxtools.tmf.core.trace.TmfExperiment:"/>
+               </appinfo>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
    <annotation>
       <appinfo>
          <meta.section type="since"/>
          <meta.section type="examples"/>
       </appinfo>
       <documentation>
-         Example use of the tmftracetype extension point for generic CTF traces (CtfTmfTrace):
+         Example use of the tmftracetype extension point for generic CTF traces (CtfTmfTrace) and a category-less generic experiment type:
 
 &lt;extension
       point=&quot;org.eclipse.linuxtools.tmf.core.tracetype&quot;&gt;
          name=&quot;Generic CTF Trace&quot;
          trace_type=&quot;org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace&quot;&gt;
    &lt;/type&gt;
+   &lt;experiment
+         id=&quot;org.eclipse.linuxtools.tmf.core.experiment.generic&quot;
+         name=&quot;Generic experiment&quot;
+         experiment_type=&quot;org.eclipse.linuxtools.tmf.core.trace.TmfExperiment&quot;&gt;
+   &lt;/experiment&gt;
 &lt;/extension&gt;
       </documentation>
    </annotation>
 
 * trace_type: Has to implement ITmfTrace. It&apos;s *highly* recommend to extend &apos;TmfTrace&apos; to get default implementations.
 * event_type: Has to implement ITmfEvent. Once again, TmfEvent provides a reference implementation that should work in most cases.
+
+Experiment types using this extension point have to specify the following class:
+
+* experiment_type: Has to extend TmfExperiment. This class is the default experiment class, to be used to analyse sets of traces, where each trace is treated equally.
       </documentation>
    </annotation>
 
index e3fa565acec580c486ae772f133da9df88ae1b9b..5ead4213af04322c2158f41cab4b6c5f60bf9208 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2011, 2014 Ericsson
+ * Copyright (c) 2011, 2014 Ericsson, École Polytechnique de Montréal
  *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
@@ -9,6 +9,7 @@
  * Contributors:
  *   Patrick Tasse - Initial API and implementation
  *   Matthew Khouzam - Added import functionalities
+ *   Geneviève Bastien - Added support for experiment types
  *******************************************************************************/
 
 package org.eclipse.linuxtools.tmf.core.project.model;
@@ -55,6 +56,9 @@ public final class TmfTraceType {
     /** Extension point element 'Type' */
     public static final String TYPE_ELEM = "type"; //$NON-NLS-1$
 
+    /** Extension point element 'Experiment' */
+    public static final String EXPERIMENT_ELEM = "experiment"; //$NON-NLS-1$
+
     /** Extension point attribute 'ID' */
     public static final String ID_ATTR = "id"; //$NON-NLS-1$
 
@@ -70,6 +74,9 @@ public final class TmfTraceType {
     /** Extension point attribute 'event_type' */
     public static final String EVENT_TYPE_ATTR = "event_type"; //$NON-NLS-1$
 
+    /** Extension point attribute 'experiment_type' */
+    public static final String EXPERIMENT_TYPE_ATTR = "experiment_type"; //$NON-NLS-1$
+
     /** Extension point attribute 'isDirectory' */
     public static final String IS_DIR_ATTR = "isDirectory"; //$NON-NLS-1$
 
@@ -84,6 +91,9 @@ public final class TmfTraceType {
      */
     public static final String CUSTOM_XML_CATEGORY = "Custom XML"; //$NON-NLS-1$
 
+    /** Default experiment type */
+    public static final String DEFAULT_EXPERIMENT_TYPE = "org.eclipse.linuxtools.tmf.core.experiment.generic"; //$NON-NLS-1$
+
     // The mapping of available trace type IDs to their corresponding
     // configuration element
     private final Map<String, IConfigurationElement> fTraceTypeAttributes = new HashMap<>();
index 2e1fcc6138bb3386261835004cf4d0e9e0df6607..1859346cbed3f6ecde19bad93d49249d04ef36b0 100644 (file)
             icon="icons/eview16/events_view.gif"
             tracetype="org.eclipse.linuxtools.tmf.ui.type.ctf">
       </type>
+      <experiment
+            tracetype="org.eclipse.linuxtools.tmf.core.experiment.generic"
+            icon="icons/elcl16/experiment.gif">
+      </experiment>
    </extension>
 </plugin>
index d8c55fde0529709457a1b4d9b9539637af655650..b0a8fee37c9658e5bcc348f53ed60998abe58854 100644 (file)
@@ -19,6 +19,7 @@
       <complexType>
          <choice minOccurs="0" maxOccurs="unbounded">
             <element ref="type"/>
+            <element ref="experiment"/>
          </choice>
          <attribute name="point" type="string" use="required">
             <annotation>
       </complexType>
    </element>
 
+   <element name="experiment">
+      <complexType>
+         <sequence>
+            <element ref="eventsTableType" minOccurs="0" maxOccurs="1"/>
+            <element ref="defaultEditor" minOccurs="0" maxOccurs="1"/>
+         </sequence>
+         <attribute name="tracetype" type="string" use="required">
+            <annotation>
+               <documentation>
+                  The unique ID that identifies this experiment type.
+               </documentation>
+               <appinfo>
+                  <meta.attribute kind="identifier" basedOn="org.eclipse.linuxtools.tmf.core.tracetype/experiment/@id"/>
+               </appinfo>
+            </annotation>
+         </attribute>
+         <attribute name="icon" type="string">
+            <annotation>
+               <documentation>
+                  The icon associated to the experiment type.
+               </documentation>
+               <appinfo>
+                  <meta.attribute kind="resource"/>
+               </appinfo>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
    <element name="eventsTableType">
       <annotation>
          <documentation>
@@ -131,7 +161,7 @@ If empty, the default events editor will be used.
          <meta.section type="examples"/>
       </appinfo>
       <documentation>
-         Example use of the extension point: the GDB trace type, which specifies a custom icon and a custom editor. The &apos;type/tracetype&apos; element has to point to an existing tmf.core.tracetype extension!
+         Example use of the extension point: the GDB trace type, which specifies a custom icon and a custom editor, also the generic experiment, which specifies a custom icon. The &apos;type/tracetype&apos; element has to point to an existing tmf.core.tracetype extension!
 
 &lt;extension
       point=&quot;org.eclipse.linuxtools.tmf.ui.tracetypeui&quot;&gt;
@@ -142,6 +172,10 @@ If empty, the default events editor will be used.
             class=&quot;org.eclipse.linuxtools.internal.gdbtrace.ui.views.events.GdbEventsTable&quot;&gt;
       &lt;/eventsTableType&gt;
    &lt;/type&gt;
+   &lt;experiment_type
+         tracetype=&quot;org.eclipse.linuxtools.tmf.core.experiment.generic&quot;
+         icon=&quot;icons/elcl16/experiment.gif&quot;&gt;
+   &lt;/experiment_type&gt;
 &lt;/extension&gt;
       </documentation>
    </annotation>
index 202b2b928008e30bac6cce84a46f792740b32410..7b65ecdc8c9c7232cf41f9864d754abd934ba35f 100644 (file)
@@ -55,6 +55,12 @@ public final class TmfTraceTypeUIUtils {
     /** Extension point element 'type' (should match the type in TmfTraceType) */
     public static final String TYPE_ELEM = "type"; //$NON-NLS-1$
 
+    /**
+     * Extension point element 'experiment' (should match the type in
+     * TmfTraceType)
+     */
+    public static final String EXPERIMENT_ELEM = "experiment"; //$NON-NLS-1$
+
     /** Extension point element 'Default editor' */
     public static final String DEFAULT_EDITOR_ELEM = "defaultEditor"; //$NON-NLS-1$
 
This page took 0.030054 seconds and 5 git commands to generate.