1 /*******************************************************************************
2 * Copyright (c) 2015 Ericsson
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
10 * France Lapointe Nguyen - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.tracecompass
.internal
.analysis
.os
.linux
.ui
.views
.latency
;
15 import org
.eclipse
.jdt
.annotation
.Nullable
;
16 import org
.eclipse
.jface
.action
.Action
;
17 import org
.eclipse
.jface
.action
.IAction
;
18 import org
.eclipse
.jface
.action
.IMenuManager
;
19 import org
.eclipse
.jface
.action
.Separator
;
20 import org
.eclipse
.jface
.viewers
.IStructuredSelection
;
21 import org
.eclipse
.jface
.viewers
.TableViewer
;
22 import org
.eclipse
.tracecompass
.analysis
.os
.linux
.core
.latency
.LatencyAnalysis
;
23 import org
.eclipse
.tracecompass
.analysis
.timing
.core
.segmentstore
.AbstractSegmentStoreAnalysisModule
;
24 import org
.eclipse
.tracecompass
.analysis
.timing
.ui
.views
.segmentstore
.AbstractSegmentStoreTableViewer
;
25 import org
.eclipse
.tracecompass
.internal
.analysis
.os
.linux
.ui
.views
.latency
.statistics
.LatencyStatisticsView
;
26 import org
.eclipse
.tracecompass
.tmf
.core
.trace
.ITmfTrace
;
27 import org
.eclipse
.tracecompass
.tmf
.core
.trace
.TmfTraceUtils
;
28 import org
.eclipse
.ui
.IWorkbench
;
29 import org
.eclipse
.ui
.IWorkbenchPage
;
30 import org
.eclipse
.ui
.PartInitException
;
31 import org
.eclipse
.ui
.PlatformUI
;
34 * Displays the latency analysis data in a column table
36 * @author France Lapointe Nguyen
38 public class LatencyTableViewer
extends AbstractSegmentStoreTableViewer
{
40 // ------------------------------------------------------------------------
42 // ------------------------------------------------------------------------
50 public LatencyTableViewer(TableViewer tableViewer
) {
54 // ------------------------------------------------------------------------
56 // ------------------------------------------------------------------------
59 protected @Nullable AbstractSegmentStoreAnalysisModule
getSegmentStoreAnalysisModule(ITmfTrace trace
) {
60 return TmfTraceUtils
.getAnalysisModuleOfClass(trace
, LatencyAnalysis
.class, LatencyAnalysis
.ID
);
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
) {
70 final IWorkbench wb
= PlatformUI
.getWorkbench();
71 final IWorkbenchPage activePage
= wb
.getActiveWorkbenchWindow().getActivePage();
73 activePage
.showView(LatencyStatisticsView
.ID
);
74 } catch (PartInitException e
) {
79 manager
.add(showStatisticsAction
);