analysis: introduce latency table view
[deliverable/tracecompass.git] / analysis / org.eclipse.tracecompass.analysis.os.linux.ui / src / org / eclipse / tracecompass / internal / analysis / os / linux / ui / views / latency / LatencyView.java
CommitLineData
7b79ee46
FLN
1/*******************************************************************************
2 * Copyright (c) 2015 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 *
9 * Contributors:
10 * France Lapointe Nguyen - Initial API and implementation
11 *******************************************************************************/
12
13package org.eclipse.tracecompass.internal.analysis.os.linux.ui.views.latency;
14
15import org.eclipse.jdt.annotation.Nullable;
16import org.eclipse.jface.viewers.TableViewer;
17import org.eclipse.swt.SWT;
18import org.eclipse.swt.custom.SashForm;
19import org.eclipse.swt.widgets.Composite;
20import org.eclipse.tracecompass.tmf.ui.views.TmfView;
21
22/**
23 * View for the latency analysis
24 *
25 * @author France Lapointe Nguyen
26 */
27public class LatencyView extends TmfView {
28
29 // ------------------------------------------------------------------------
30 // Attributes
31 // ------------------------------------------------------------------------
32
33 /** The view's ID */
34 public static final String ID = "org.eclipse.tracecompass.analysis.os.linux.views.latency"; //$NON-NLS-1$
35
36 private @Nullable LatencyTableViewer fTableViewer;
37
38 // ------------------------------------------------------------------------
39 // Constructor
40 // ------------------------------------------------------------------------
41
42 /**
43 * Constructor
44 */
45 public LatencyView() {
46 super(ID);
47 }
48
49 // ------------------------------------------------------------------------
50 // ViewPart
51 // ------------------------------------------------------------------------
52
53 @Override
54 public void createPartControl(@Nullable Composite parent) {
55 SashForm sf = new SashForm(parent, SWT.NONE);
56 TableViewer tableViewer = new TableViewer(sf, SWT.FULL_SELECTION | SWT.VIRTUAL);
57 fTableViewer = new LatencyTableViewer(tableViewer);
58 setInitialData();
59 }
60
61 // ------------------------------------------------------------------------
62 // Operations
63 // ------------------------------------------------------------------------
64
65 @Override
66 public void setFocus() {
67 if (fTableViewer != null) {
68 fTableViewer.getTableViewer().getControl().setFocus();
69 }
70 }
71
72 @Override
73 public void dispose() {
74 super.dispose();
75 if (fTableViewer != null) {
76 fTableViewer.dispose();
77 }
78 }
79
80 /**
81 * Set initial data into the viewer
82 */
83 private void setInitialData() {
84 if (fTableViewer != null) {
85 fTableViewer.setData(fTableViewer.getAnalysisModule());
86 }
87 }
88}
This page took 0.029528 seconds and 5 git commands to generate.