timing: ss statistics use the common statistics
[deliverable/tracecompass.git] / tmf / org.eclipse.tracecompass.tmf.analysis.xml.ui / src / org / eclipse / tracecompass / internal / tmf / analysis / xml / ui / views / latency / PatternStatisticsView.java
CommitLineData
5b901f94
JCK
1/*******************************************************************************
2 * Copyright (c) 2016 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 *******************************************************************************/
9package org.eclipse.tracecompass.internal.tmf.analysis.xml.ui.views.latency;
10
11import org.eclipse.jdt.annotation.NonNull;
12import org.eclipse.jface.util.IPropertyChangeListener;
13import org.eclipse.jface.util.PropertyChangeEvent;
14import org.eclipse.swt.widgets.Composite;
fb042960 15import org.eclipse.tracecompass.analysis.timing.ui.views.segmentstore.statistics.AbstractSegmentsStatisticsView;
5b901f94
JCK
16import org.eclipse.tracecompass.internal.tmf.analysis.xml.ui.TmfXmlUiStrings;
17import org.eclipse.tracecompass.internal.tmf.analysis.xml.ui.views.XmlLatencyViewInfo;
fb042960 18import org.eclipse.tracecompass.tmf.ui.viewers.tree.AbstractTmfTreeViewer;
5b901f94
JCK
19
20/**
21 * The statistic view for pattern latency analysis
22 *
23 * @author Jean-Christian Kouame
24 */
fb042960 25public class PatternStatisticsView extends AbstractSegmentsStatisticsView {
5b901f94
JCK
26
27 private PatternStatisticsViewer fViewer;
28 /** The view's ID */
29 public static final @NonNull String ID = "org.eclipse.tracecompass.internal.tmf.analysis.xml.ui.views.statistics"; //$NON-NLS-1$
30
31 private final XmlLatencyViewInfo fViewInfo = new XmlLatencyViewInfo(ID);
32
33 /**
34 * Constructor
35 */
36 public PatternStatisticsView() {
37 this.addPartPropertyListener(new IPropertyChangeListener() {
38 @Override
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 loadStatisticView();
46 }
47 }
48 }
49 });
50 }
51
52 private void loadStatisticView() {
53 if (fViewer != null) {
54 fViewer.updateViewer(fViewInfo.getViewAnalysisId());
55 }
56 }
57
58 @Override
fb042960 59 protected @NonNull AbstractTmfTreeViewer createSegmentStoreStatisticsViewer(@NonNull Composite parent) {
5b901f94
JCK
60 PatternStatisticsViewer viewer = new PatternStatisticsViewer(parent);
61 fViewer = viewer;
62 loadStatisticView();
63 return viewer;
64 }
65}
This page took 0.035258 seconds and 5 git commands to generate.