tmf: Generalize the support for call sites and model URIs
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core / src / org / eclipse / linuxtools / tmf / core / ctfadaptor / CtfTmfEvent.java
index 095f4d2613c3f725fb62abfd38378fc4132d5d21..2b8aff967edd05d1b654610b0d4e1f5fc8d146e3 100644 (file)
@@ -8,6 +8,7 @@
  *
  * Contributors:
  *     Alexandre Montplaisir - Initial API and implementation
+ *     Bernd Hufmann - Updated for source and model lookup interfaces
  *******************************************************************************/
 
 package org.eclipse.linuxtools.tmf.core.ctfadaptor;
@@ -22,6 +23,8 @@ import org.eclipse.linuxtools.tmf.core.event.ITmfEventType;
 import org.eclipse.linuxtools.tmf.core.event.TmfEvent;
 import org.eclipse.linuxtools.tmf.core.event.TmfEventField;
 import org.eclipse.linuxtools.tmf.core.event.TmfEventPropertySource;
+import org.eclipse.linuxtools.tmf.core.event.lookup.ITmfModelLookup;
+import org.eclipse.linuxtools.tmf.core.event.lookup.ITmfSourceLookup;
 import org.eclipse.linuxtools.tmf.core.trace.ITmfContext;
 import org.eclipse.ui.views.properties.IPropertySource;
 
@@ -33,7 +36,7 @@ import org.eclipse.ui.views.properties.IPropertySource;
  * @author Alexandre Montplaisir
  * @since 2.0
  */
-public final class CtfTmfEvent extends TmfEvent {
+public final class CtfTmfEvent extends TmfEvent implements ITmfSourceLookup, ITmfModelLookup {
 
     // ------------------------------------------------------------------------
     // Constants
@@ -179,11 +182,12 @@ public final class CtfTmfEvent extends TmfEvent {
     }
 
     /**
-     * Get the callsite for this event.
+     * Get the call site for this event.
      *
-     * @return the callsite information, or null if there is none
+     * @return the call site information, or null if there is none
      * @since 2.0
      */
+    @Override
     public CtfTmfCallsite getCallsite() {
         CTFCallsite callsite = null;
         if (getTrace() == null) {
@@ -205,6 +209,14 @@ public final class CtfTmfEvent extends TmfEvent {
         return null;
     }
 
+    /**
+     * @since 2.0
+     */
+    @Override
+    public String getModelUri() {
+        return getCustomAttribute(CtfConstants.MODEL_URI_KEY);
+    }
+
     /**
      * @since 2.0
      */
This page took 0.026085 seconds and 5 git commands to generate.