view.execgraph = Execution Graph View
view.callgraphDensity= Function Durations Distribution
view.flameGraph= Flame Graph
+view.segstore.table = Segment Store Table
-callgraph.analysis = Call Graph Analysis
\ No newline at end of file
+callgraph.analysis = Call Graph Analysis
name="%view.flameGraph"
restorable="true">
</view>
+ <view
+ category="org.eclipse.linuxtools.tmf.ui.views.category"
+ class="org.eclipse.tracecompass.analysis.timing.ui.views.segmentstore.table.SegmentStoreTableView"
+ icon="icons/eview16/latency.png"
+ id="org.eclipse.tracecompass.analysis.timing.ui.segstore.table"
+ name="%view.segstore.table"
+ restorable="true">
+ </view>
</extension>
</plugin>
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.tracecompass.internal.analysis.timing.ui.views.segmentstore.ExportToTsvAction;
+import org.eclipse.tracecompass.tmf.core.signal.TmfTraceSelectedSignal;
+import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
+import org.eclipse.tracecompass.tmf.core.trace.TmfTraceManager;
import org.eclipse.tracecompass.tmf.ui.views.TmfView;
import com.google.common.annotations.VisibleForTesting;
@Override
public void createPartControl(@Nullable Composite parent) {
+ super.createPartControl(parent);
SashForm sf = new SashForm(parent, SWT.NONE);
TableViewer tableViewer = new TableViewer(sf, SWT.FULL_SELECTION | SWT.VIRTUAL);
fSegmentStoreViewer = createSegmentStoreViewer(tableViewer);
getViewSite().getActionBars().getMenuManager().add(fExportAction);
+ ITmfTrace trace = TmfTraceManager.getInstance().getActiveTrace();
+ if (trace != null) {
+ TmfTraceSelectedSignal signal = new TmfTraceSelectedSignal(this, trace);
+ if (fSegmentStoreViewer != null) {
+ fSegmentStoreViewer.traceSelected(signal);
+ }
+ }
setInitialData();
}
super(tableViewer);
// Sort order of the content provider is by start time by default
getTableViewer().setContentProvider(new SegmentStoreContentProvider());
- ITmfTrace trace = TmfTraceManager.getInstance().getActiveTrace();
- if (trace != null) {
- fSegmentProvider = getSegmentStoreProvider(trace);
- }
createColumns();
getTableViewer().getTable().addSelectionListener(new TableSelectionListener());
addPackListener();
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2016 École Polytechnique de Montréal
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.analysis.timing.ui.views.segmentstore.table;
+
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.tracecompass.common.core.NonNullUtils;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * View for displaying a segment store analysis in a table.
+ *
+ * @author Geneviève Bastien
+ * @since 1.2
+ */
+public class SegmentStoreTableView extends AbstractSegmentStoreTableView {
+
+ /**
+ * ID of this view
+ */
+ public static final String ID = "org.eclipse.tracecompass.analysis.timing.ui.segstore.table"; //$NON-NLS-1$
+
+ @Override
+ public void createPartControl(@Nullable Composite parent) {
+ super.createPartControl(parent);
+ setPartName(PlatformUI.getWorkbench().getViewRegistry().find(getViewId()).getLabel());
+ }
+
+ @Override
+ protected @NonNull AbstractSegmentStoreTableViewer createSegmentStoreViewer(@NonNull TableViewer tableViewer) {
+ // Set the title of this view
+ String analysisId = NonNullUtils.nullToEmptyString(getViewSite().getSecondaryId());
+ return new SegmentStoreTableViewer(tableViewer, analysisId);
+ }
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2016 École Polytechnique de Montréal
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.analysis.timing.ui.views.segmentstore.table;
+
+import org.eclipse.jdt.annotation.Nullable;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.tracecompass.analysis.timing.core.segmentstore.ISegmentStoreProvider;
+import org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule;
+import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
+
+/**
+ * Displays the segment store provider data in a column table
+ *
+ * @author Geneviève Bastien
+ * @since 1.2
+ */
+public class SegmentStoreTableViewer extends AbstractSegmentStoreTableViewer {
+
+ private final String fAnalysisId;
+
+ // ------------------------------------------------------------------------
+ // Constructor
+ // ------------------------------------------------------------------------
+
+ /**
+ * Constructor
+ *
+ * @param tableViewer
+ * Table viewer of the view
+ * @param analysisId
+ * The ID of the analysis this viewer is for
+ */
+ public SegmentStoreTableViewer(TableViewer tableViewer, String analysisId) {
+ super(tableViewer);
+ fAnalysisId = analysisId;
+ }
+
+ @Override
+ protected @Nullable ISegmentStoreProvider getSegmentStoreProvider(ITmfTrace trace) {
+ IAnalysisModule module = trace.getAnalysisModule(fAnalysisId);
+ if (!(module instanceof ISegmentStoreProvider)) {
+ return null;
+ }
+ return (ISegmentStoreProvider) module;
+ }
+
+}
*/
public static String SegmentStoreTableViewer_goToEndEvent;
+ /** Title of the table, to be appended to the analysis name for the title of the view */
+ public static String SegmentStoreTableViewer_genericTitle;
+
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
SegmentStoreTableViewer_startTime=Start Time
SegmentStoreTableViewer_goToStartEvent=Go to start time
SegmentStoreTableViewer_goToEndEvent=Go to end time
+SegmentStoreTableViewer_genericTitle=Table