Add support for LTTng 2.0 command add-context
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng2.ui / src / org / eclipse / linuxtools / internal / lttng2 / ui / views / control / model / impl / TraceEventComponent.java
index f67b3cff0c999cba0627f28d0e8d351e94995de1..7c2f85a224eb5f0405bdd342d9a78e0a4ad22d38 100644 (file)
  **********************************************************************/
 package org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl;
 
+import java.util.List;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.linuxtools.internal.lttng2.ui.Activator;
 import org.eclipse.linuxtools.internal.lttng2.ui.views.control.Messages;
 import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.IEventInfo;
@@ -182,6 +187,13 @@ public class TraceEventComponent extends TraceControlComponent {
        return ((TraceChannelComponent)getParent()).getSessionName(); 
     }
 
+    /**
+     * @return session from parent
+     */
+    public TraceSessionComponent getSession() {
+       return ((TraceChannelComponent)getParent()).getSession(); 
+    }
+
     /**
      * @return channel name from parent
      */
@@ -199,4 +211,23 @@ public class TraceEventComponent extends TraceControlComponent {
     // ------------------------------------------------------------------------
     // Operations
     // ------------------------------------------------------------------------
+    
+    /**
+     * Add contexts to given channels and or events
+     * @param contexts - a list of contexts to add
+     * @throws ExecutionException
+     */
+    public void addContexts(List<String> contexts) throws ExecutionException {
+        addContexts(contexts, new NullProgressMonitor());
+    }
+
+    /**
+     * Add contexts to given channels and or events
+     * @param contexts - a list of contexts to add
+     * @param monitor - a progress monitor
+     * @throws ExecutionException
+     */
+    public void addContexts(List<String> contexts, IProgressMonitor monitor) throws ExecutionException {
+        getControlService().addContexts(getSessionName(),getChannelName(), getName(), isKernel(), contexts, monitor);
+    }
 }
This page took 0.024102 seconds and 5 git commands to generate.