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 *******************************************************************************/
12 package org
.eclipse
.tracecompass
.internal
.analysis
.os
.linux
.ui
.views
.latency
.statistics
;
14 import org
.eclipse
.jdt
.annotation
.Nullable
;
15 import org
.eclipse
.swt
.widgets
.Composite
;
16 import org
.eclipse
.tracecompass
.common
.core
.NonNullUtils
;
17 import org
.eclipse
.tracecompass
.tmf
.core
.trace
.ITmfTrace
;
18 import org
.eclipse
.tracecompass
.tmf
.core
.trace
.TmfTraceManager
;
19 import org
.eclipse
.tracecompass
.tmf
.ui
.views
.TmfView
;
22 * Abstract view to to be extended to display segment store statistics.
24 * @author Bernd Hufmann
27 public abstract class AbstractSegmentStoreStatisticsView
extends TmfView
{
29 @Nullable private AbstractSegmentStoreStatisticsViewer fStatsViewer
= null;
34 public AbstractSegmentStoreStatisticsView() {
35 super("StatisticsView"); //$NON-NLS-1$
39 public void createPartControl(@Nullable Composite parent
) {
40 super.createPartControl(parent
);
41 AbstractSegmentStoreStatisticsViewer statsViewer
= createSegmentStoreStatisticsViewer(NonNullUtils
.checkNotNull(parent
));
42 ITmfTrace trace
= TmfTraceManager
.getInstance().getActiveTrace();
44 statsViewer
.loadTrace(trace
);
46 fStatsViewer
= statsViewer
;
50 public void setFocus() {
51 AbstractSegmentStoreStatisticsViewer statsViewer
= fStatsViewer
;
52 if (statsViewer
!= null) {
53 statsViewer
.getControl().setFocus();
58 public void dispose() {
60 AbstractSegmentStoreStatisticsViewer statsViewer
= fStatsViewer
;
61 if (statsViewer
!= null) {
62 statsViewer
.dispose();
67 * Creates a segment store statistics viewer instance.
70 * the parent composite to create the viewer in.
71 * @return the latency statistics viewer implementation
73 protected abstract AbstractSegmentStoreStatisticsViewer
createSegmentStoreStatisticsViewer(Composite parent
);