1 /*******************************************************************************
2 * Copyright (c) 2015 Ericsson
4 * All rights reserved. This program and the accompanying materials are made
5 * 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 * Bernd Hufmann - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.tracecompass
.internal
.analysis
.os
.linux
.ui
.views
.latency
.statistics
;
15 import org
.eclipse
.jdt
.annotation
.Nullable
;
16 import org
.eclipse
.swt
.widgets
.Composite
;
17 import org
.eclipse
.tracecompass
.common
.core
.NonNullUtils
;
18 import org
.eclipse
.tracecompass
.tmf
.core
.trace
.ITmfTrace
;
19 import org
.eclipse
.tracecompass
.tmf
.core
.trace
.TmfTraceManager
;
20 import org
.eclipse
.tracecompass
.tmf
.ui
.views
.TmfView
;
23 * Abstract view to to be extended to display latency statistics.
25 * @author Bernd Hufmann
28 public abstract class AbstractLatencyStatisticsView
extends TmfView
{
30 @Nullable private AbstractLatencyStatisticsViewer fStatsViewer
= null;
35 public AbstractLatencyStatisticsView() {
36 super("StatisticsView"); //$NON-NLS-1$
40 public void createPartControl(@Nullable Composite parent
) {
41 super.createPartControl(parent
);
42 AbstractLatencyStatisticsViewer statsViewer
= createLatencyStatisticsViewer(NonNullUtils
.checkNotNull(parent
));
43 ITmfTrace trace
= TmfTraceManager
.getInstance().getActiveTrace();
45 statsViewer
.loadTrace(trace
);
47 fStatsViewer
= statsViewer
;
51 public void setFocus() {
52 AbstractLatencyStatisticsViewer statsViewer
= fStatsViewer
;
53 if (statsViewer
!= null) {
54 statsViewer
.getControl().setFocus();
59 public void dispose() {
61 AbstractLatencyStatisticsViewer statsViewer
= fStatsViewer
;
62 if (statsViewer
!= null) {
63 statsViewer
.dispose();
68 * Creates a latency statistics viewer instance.
71 * the parent composite to create the viewer in.
72 * @return the latency statistics viewer implementation
74 protected abstract AbstractLatencyStatisticsViewer
createLatencyStatisticsViewer(Composite parent
);