timing: Add a generic table view for any segment provider
[deliverable/tracecompass.git] / analysis / org.eclipse.tracecompass.analysis.timing.ui / src / org / eclipse / tracecompass / analysis / timing / ui / views / segmentstore / table / SegmentStoreTableView.java
1 /*******************************************************************************
2 * Copyright (c) 2016 École Polytechnique de Montréal
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
10 package org.eclipse.tracecompass.analysis.timing.ui.views.segmentstore.table;
11
12 import org.eclipse.jdt.annotation.NonNull;
13 import org.eclipse.jdt.annotation.Nullable;
14 import org.eclipse.jface.viewers.TableViewer;
15 import org.eclipse.swt.widgets.Composite;
16 import org.eclipse.tracecompass.common.core.NonNullUtils;
17 import org.eclipse.ui.PlatformUI;
18
19 /**
20 * View for displaying a segment store analysis in a table.
21 *
22 * @author Geneviève Bastien
23 * @since 1.2
24 */
25 public class SegmentStoreTableView extends AbstractSegmentStoreTableView {
26
27 /**
28 * ID of this view
29 */
30 public static final String ID = "org.eclipse.tracecompass.analysis.timing.ui.segstore.table"; //$NON-NLS-1$
31
32 @Override
33 public void createPartControl(@Nullable Composite parent) {
34 super.createPartControl(parent);
35 setPartName(PlatformUI.getWorkbench().getViewRegistry().find(getViewId()).getLabel());
36 }
37
38 @Override
39 protected @NonNull AbstractSegmentStoreTableViewer createSegmentStoreViewer(@NonNull TableViewer tableViewer) {
40 // Set the title of this view
41 String analysisId = NonNullUtils.nullToEmptyString(getViewSite().getSecondaryId());
42 return new SegmentStoreTableViewer(tableViewer, analysisId);
43 }
44 }
This page took 0.031256 seconds and 5 git commands to generate.