tmf.core/ui: Move some logic of the symbol provider to core
[deliverable/tracecompass.git] / analysis / org.eclipse.tracecompass.analysis.timing.ui / src / org / eclipse / tracecompass / internal / analysis / timing / ui / callgraph / CallGraphTableViewer.java
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 *******************************************************************************/
9
10 package org.eclipse.tracecompass.internal.analysis.timing.ui.callgraph;
11
12 import org.eclipse.core.runtime.IProgressMonitor;
13 import org.eclipse.core.runtime.IStatus;
14 import org.eclipse.core.runtime.Status;
15 import org.eclipse.core.runtime.jobs.Job;
16 import org.eclipse.jdt.annotation.NonNull;
17 import org.eclipse.jdt.annotation.Nullable;
18 import org.eclipse.jface.viewers.TableViewer;
19 import org.eclipse.tracecompass.analysis.timing.core.segmentstore.ISegmentStoreProvider;
20 import org.eclipse.tracecompass.analysis.timing.ui.views.segmentstore.table.AbstractSegmentStoreTableViewer;
21 import org.eclipse.tracecompass.common.core.NonNullUtils;
22 import org.eclipse.tracecompass.internal.analysis.timing.core.callgraph.CallGraphAnalysis;
23 import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
24 import org.eclipse.tracecompass.tmf.core.trace.TmfTraceUtils;
25
26 /**
27 * Displays the Call Stack data in a column table
28 *
29 * @author Sonia Farrah
30 */
31 public class CallGraphTableViewer extends AbstractSegmentStoreTableViewer {
32
33 // ------------------------------------------------------------------------
34 // Constructor
35 // ------------------------------------------------------------------------
36
37 /**
38 * Constructor
39 *
40 * @param tableViewer
41 * The table viewer
42 */
43 public CallGraphTableViewer(@NonNull TableViewer tableViewer) {
44 super(tableViewer);
45 }
46
47 // ------------------------------------------------------------------------
48 // Operations
49 // ------------------------------------------------------------------------
50
51 @Override
52 protected @Nullable ISegmentStoreProvider getSegmentStoreProvider(@NonNull ITmfTrace trace) {
53 CallGraphAnalysis fModule = TmfTraceUtils.getAnalysisModuleOfClass(trace, CallGraphAnalysis.class, CallGraphAnalysis.ID);
54 if (fModule == null) {
55 return null;
56 }
57 fModule.schedule();
58 Job job = new Job(Messages.CallGraphAnalysis) {
59
60 @Override
61 protected IStatus run(IProgressMonitor monitor) {
62 fModule.waitForCompletion(NonNullUtils.checkNotNull(monitor));
63 if (monitor.isCanceled()) {
64 return Status.CANCEL_STATUS;
65 }
66 return Status.OK_STATUS;
67 }
68 };
69 job.schedule();
70 return fModule;
71 }
72 }
This page took 0.036471 seconds and 5 git commands to generate.