1 /*******************************************************************************
2 * Copyright (c) 2016 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
8 *******************************************************************************/
9 package org
.eclipse
.tracecompass
.internal
.tmf
.analysis
.xml
.ui
.views
.latency
;
11 import org
.eclipse
.jdt
.annotation
.NonNull
;
12 import org
.eclipse
.jface
.util
.IPropertyChangeListener
;
13 import org
.eclipse
.jface
.util
.PropertyChangeEvent
;
14 import org
.eclipse
.swt
.widgets
.Composite
;
15 import org
.eclipse
.tracecompass
.analysis
.timing
.ui
.views
.segmentstore
.statistics
.AbstractSegmentsStatisticsView
;
16 import org
.eclipse
.tracecompass
.internal
.tmf
.analysis
.xml
.ui
.TmfXmlUiStrings
;
17 import org
.eclipse
.tracecompass
.internal
.tmf
.analysis
.xml
.ui
.views
.XmlLatencyViewInfo
;
18 import org
.eclipse
.tracecompass
.tmf
.ui
.viewers
.tree
.AbstractTmfTreeViewer
;
21 * The statistic view for pattern latency analysis
23 * @author Jean-Christian Kouame
25 public class PatternStatisticsView
extends AbstractSegmentsStatisticsView
{
27 private PatternStatisticsViewer fViewer
;
29 public static final @NonNull String ID
= "org.eclipse.tracecompass.internal.tmf.analysis.xml.ui.views.statistics"; //$NON-NLS-1$
31 private final XmlLatencyViewInfo fViewInfo
= new XmlLatencyViewInfo(ID
);
36 public PatternStatisticsView() {
37 this.addPartPropertyListener(new IPropertyChangeListener() {
39 public void propertyChange(PropertyChangeEvent event
) {
40 if (event
.getProperty().equals(TmfXmlUiStrings
.XML_LATENCY_OUTPUT_DATA
)) {
41 Object newValue
= event
.getNewValue();
42 if (newValue
instanceof String
) {
43 String data
= (String
) newValue
;
44 fViewInfo
.setViewData(data
);
45 setPartName(fViewInfo
.getLabel());
53 private void loadStatisticView() {
54 if (fViewer
!= null) {
55 fViewer
.updateViewer(fViewInfo
.getViewAnalysisId());
60 protected @NonNull AbstractTmfTreeViewer
createSegmentStoreStatisticsViewer(@NonNull Composite parent
) {
61 PatternStatisticsViewer viewer
= new PatternStatisticsViewer(parent
);