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
.jdt
.annotation
.Nullable
;
13 import org
.eclipse
.jface
.util
.IPropertyChangeListener
;
14 import org
.eclipse
.jface
.util
.PropertyChangeEvent
;
15 import org
.eclipse
.jface
.viewers
.TableViewer
;
16 import org
.eclipse
.swt
.widgets
.Composite
;
17 import org
.eclipse
.swt
.widgets
.Display
;
18 import org
.eclipse
.tracecompass
.analysis
.timing
.ui
.views
.segmentstore
.table
.AbstractSegmentStoreTableView
;
19 import org
.eclipse
.tracecompass
.analysis
.timing
.ui
.views
.segmentstore
.table
.AbstractSegmentStoreTableViewer
;
20 import org
.eclipse
.tracecompass
.internal
.tmf
.analysis
.xml
.ui
.TmfXmlUiStrings
;
21 import org
.eclipse
.tracecompass
.internal
.tmf
.analysis
.xml
.ui
.views
.XmlLatencyViewInfo
;
24 * The latency table view for pattern analysis
26 * @author Jean-Christian Kouame
28 public class PatternLatencyTableView
extends AbstractSegmentStoreTableView
{
31 public static final @NonNull String ID
= "org.eclipse.tracecompass.internal.tmf.analysis.xml.ui.views.latencytable"; //$NON-NLS-1$
33 private final XmlLatencyViewInfo fViewInfo
= new XmlLatencyViewInfo(ID
);
35 private PatternLatencyTableViewer fViewer
;
40 public PatternLatencyTableView() {
41 this.addPartPropertyListener(new IPropertyChangeListener() {
43 public void propertyChange(PropertyChangeEvent event
) {
44 if (event
.getProperty().equals(TmfXmlUiStrings
.XML_LATENCY_OUTPUT_DATA
)) {
45 Object newValue
= event
.getNewValue();
46 if (newValue
instanceof String
) {
47 String data
= (String
) newValue
;
48 fViewInfo
.setViewData(data
);
49 setPartName(fViewInfo
.getLabel());
58 public void createPartControl(@Nullable Composite parent
) {
59 String name
= getViewSite().getSecondaryId();
61 /* must initialize view info before calling super */
62 fViewInfo
.setName(name
);
64 super.createPartControl(parent
);
65 Display
.getDefault().asyncExec(new Runnable() {
68 setPartName(fViewInfo
.getLabel());
73 private void loadLatencyView() {
74 if (fViewer
!= null) {
75 fViewer
.updateViewer(fViewInfo
.getViewAnalysisId());
80 protected @NonNull AbstractSegmentStoreTableViewer
createSegmentStoreViewer(@NonNull TableViewer tableViewer
) {
81 PatternLatencyTableViewer viewer
= new PatternLatencyTableViewer(tableViewer
);