lttng: Support to select start and end event in LatencyAnalysisViewer
authorBernd Hufmann <Bernd.Hufmann@ericsson.com>
Fri, 25 Sep 2015 11:28:54 +0000 (07:28 -0400)
committerBernd Hufmann <bernd.hufmann@ericsson.com>
Fri, 25 Sep 2015 22:32:03 +0000 (18:32 -0400)
Change-Id: I325f51a687ff82b08f6216912ec03d4adb5e407d
Signed-off-by: Bernd Hufmann <Bernd.Hufmann@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/56709
Reviewed-by: Hudson CI
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Tested-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
analysis/org.eclipse.tracecompass.analysis.os.linux.ui/src/org/eclipse/tracecompass/internal/analysis/os/linux/ui/views/latency/LatencyTableViewer.java
analysis/org.eclipse.tracecompass.analysis.os.linux.ui/src/org/eclipse/tracecompass/internal/analysis/os/linux/ui/views/latency/Messages.java
analysis/org.eclipse.tracecompass.analysis.os.linux.ui/src/org/eclipse/tracecompass/internal/analysis/os/linux/ui/views/latency/messages.properties

index 7f68c6f6bbcf39a396001642bd247d5694559f66..6cc5970905aa0e827f9a03871fdc83bbab62504d 100644 (file)
 package org.eclipse.tracecompass.internal.analysis.os.linux.ui.views.latency;
 
 import org.eclipse.jdt.annotation.Nullable;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IMenuManager;
 import org.eclipse.jface.viewers.ColumnLabelProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.StructuredSelection;
 import org.eclipse.jface.viewers.TableViewer;
 import org.eclipse.swt.events.SelectionAdapter;
@@ -216,6 +220,28 @@ public class LatencyTableViewer extends TmfSimpleTableViewer {
         analysis.schedule();
     }
 
+    @Override
+    protected void appendToTablePopupMenu(IMenuManager manager, IStructuredSelection sel) {
+        final ISegment segment = (ISegment) sel.getFirstElement();
+
+        IAction gotoStartTime = new Action(Messages.LatencyView_goToStartEvent) {
+            @Override
+            public void run() {
+                broadcast(new TmfSelectionRangeUpdatedSignal(LatencyTableViewer.this, new TmfNanoTimestamp(segment.getStart())));
+            }
+        };
+
+        IAction gotoEndTime = new Action(Messages.LatencyView_goToEndEvent) {
+            @Override
+            public void run() {
+                broadcast(new TmfSelectionRangeUpdatedSignal(LatencyTableViewer.this, new TmfNanoTimestamp(segment.getEnd())));
+            }
+        };
+
+       manager.add(gotoStartTime);
+       manager.add(gotoEndTime);
+    }
+
     // ------------------------------------------------------------------------
     // Getters
     // ------------------------------------------------------------------------
index 52f8046dab1571d3bd635c358b9d520e23876d12..f8cff13044aa89699cce8d0376f4a22017703877 100644 (file)
@@ -50,6 +50,17 @@ public class Messages extends NLS {
      * Title of the y axis of the scatter graph
      */
     public static @Nullable String LatencyView_yAxis;
+
+    /**
+     * Title of action to goto start time time
+     */
+    public static @Nullable String LatencyView_goToStartEvent;
+
+    /**
+     * Title of action to goto end event
+     */
+    public static @Nullable String LatencyView_goToEndEvent;
+
     static {
         // initialize resource bundle
         NLS.initializeMessages(BUNDLE_NAME, Messages.class);
This page took 0.027965 seconds and 5 git commands to generate.