lttng: Add latency statistics
[deliverable/tracecompass.git] / analysis / org.eclipse.tracecompass.analysis.os.linux.ui / src / org / eclipse / tracecompass / internal / analysis / os / linux / ui / views / latency / LatencyTableViewer.java
CommitLineData
7b79ee46
FLN
1/*******************************************************************************
2 * Copyright (c) 2015 Ericsson
3 *
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *
9 * Contributors:
10 * France Lapointe Nguyen - Initial API and implementation
11 *******************************************************************************/
12
13package org.eclipse.tracecompass.internal.analysis.os.linux.ui.views.latency;
14
15import org.eclipse.jdt.annotation.Nullable;
ce8319b6
BH
16import org.eclipse.jface.action.Action;
17import org.eclipse.jface.action.IAction;
18import org.eclipse.jface.action.IMenuManager;
19import org.eclipse.jface.action.Separator;
20import org.eclipse.jface.viewers.IStructuredSelection;
7b79ee46 21import org.eclipse.jface.viewers.TableViewer;
7b79ee46 22import org.eclipse.tracecompass.analysis.os.linux.core.latency.LatencyAnalysis;
152630e0 23import org.eclipse.tracecompass.analysis.timing.core.segmentstore.AbstractSegmentStoreAnalysisModule;
b9fff7ad 24import org.eclipse.tracecompass.analysis.timing.ui.views.segmentstore.AbstractSegmentStoreTableViewer;
ce8319b6 25import org.eclipse.tracecompass.internal.analysis.os.linux.ui.views.latency.statistics.LatencyStatisticsView;
7b79ee46 26import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
7b79ee46 27import org.eclipse.tracecompass.tmf.core.trace.TmfTraceUtils;
ce8319b6
BH
28import org.eclipse.ui.IWorkbench;
29import org.eclipse.ui.IWorkbenchPage;
30import org.eclipse.ui.PartInitException;
31import org.eclipse.ui.PlatformUI;
7b79ee46
FLN
32
33/**
34 * Displays the latency analysis data in a column table
35 *
36 * @author France Lapointe Nguyen
37 */
b9fff7ad 38public class LatencyTableViewer extends AbstractSegmentStoreTableViewer {
7b79ee46
FLN
39
40 // ------------------------------------------------------------------------
41 // Constructor
42 // ------------------------------------------------------------------------
43
44 /**
45 * Constructor
46 *
47 * @param tableViewer
b9fff7ad 48 * The table viewer
7b79ee46
FLN
49 */
50 public LatencyTableViewer(TableViewer tableViewer) {
51 super(tableViewer);
7b79ee46
FLN
52 }
53
54 // ------------------------------------------------------------------------
55 // Operations
56 // ------------------------------------------------------------------------
57
21de574d 58 @Override
b9fff7ad
BH
59 protected @Nullable AbstractSegmentStoreAnalysisModule getSegmentStoreAnalysisModule(ITmfTrace trace) {
60 return TmfTraceUtils.getAnalysisModuleOfClass(trace, LatencyAnalysis.class, LatencyAnalysis.ID);
7b79ee46 61 }
ce8319b6
BH
62
63 @Override
64 protected void appendToTablePopupMenu(IMenuManager manager, IStructuredSelection sel) {
65 super.appendToTablePopupMenu(manager, sel);
66 manager.add(new Separator());
67 IAction showStatisticsAction = new Action(Messages.LatencyTable_ShowStatisticsActionName) {
68 @Override
69 public void run() {
70 final IWorkbench wb = PlatformUI.getWorkbench();
71 final IWorkbenchPage activePage = wb.getActiveWorkbenchWindow().getActivePage();
72 try {
73 activePage.showView(LatencyStatisticsView.ID);
74 } catch (PartInitException e) {
75 }
76 }
77 };
78
79 manager.add(showStatisticsAction);
80 }
7b79ee46 81}
This page took 0.048568 seconds and 5 git commands to generate.