Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeneviève Bastien2014-06-09 14:08:56 +0000
committerGenevieve Bastien2014-06-11 20:15:32 +0000
commit104194daad0cbf4b0c442c68cf41d2ef5d570b18 (patch)
treee88c599014d1ea7c40ce4119f2e6c746758cd54d
parent083e873d03eab859860502ff3b4a638240850249 (diff)
downloadorg.eclipse.linuxtools-104194daad0cbf4b0c442c68cf41d2ef5d570b18.tar.gz
org.eclipse.linuxtools-104194daad0cbf4b0c442c68cf41d2ef5d570b18.tar.xz
org.eclipse.linuxtools-104194daad0cbf4b0c442c68cf41d2ef5d570b18.zip
TMF: Bug 416055: Fix behavior of synchronization view
Change-Id: I596e07eb8eb5cc688f0f1810d02f91cfc616a9b1 Signed-off-by: Geneviève Bastien <gbastien+lttng@versatic.net> Reviewed-on: https://git.eclipse.org/r/28200 Tested-by: Hudson CI Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com> Tested-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/synchronization/TmfSynchronizationView.java34
1 files changed, 34 insertions, 0 deletions
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/synchronization/TmfSynchronizationView.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/synchronization/TmfSynchronizationView.java
index ce06df91b6..d17bd113ff 100644
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/synchronization/TmfSynchronizationView.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/synchronization/TmfSynchronizationView.java
@@ -14,9 +14,15 @@ package org.eclipse.linuxtools.tmf.ui.views.synchronization;
import java.util.Map;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
+import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException;
import org.eclipse.linuxtools.tmf.core.signal.TmfSignalHandler;
+import org.eclipse.linuxtools.tmf.core.signal.TmfTraceSelectedSignal;
import org.eclipse.linuxtools.tmf.core.signal.TmfTraceSynchronizedSignal;
import org.eclipse.linuxtools.tmf.core.synchronization.SynchronizationAlgorithm;
+import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
+import org.eclipse.linuxtools.tmf.core.trace.TmfExperiment;
+import org.eclipse.linuxtools.tmf.core.trace.TmfTraceManager;
import org.eclipse.linuxtools.tmf.ui.views.TmfView;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
@@ -71,6 +77,10 @@ public class TmfSynchronizationView extends TmfView {
nameCol.pack();
valueCol.pack();
+ ITmfTrace trace = TmfTraceManager.getInstance().getActiveTrace();
+ if (trace != null) {
+ traceSelected(new TmfTraceSelectedSignal(this, trace));
+ }
}
private void updateTable() {
@@ -107,6 +117,30 @@ public class TmfSynchronizationView extends TmfView {
}
/**
+ * Handler called when a trace is selected
+ *
+ * @param signal
+ * Contains information about the selected trace
+ */
+ @TmfSignalHandler
+ public void traceSelected(TmfTraceSelectedSignal signal) {
+ fAlgoSync = null;
+ if (signal.getTrace() instanceof TmfExperiment) {
+ try {
+ fAlgoSync = ((TmfExperiment) signal.getTrace()).synchronizeTraces();
+ } catch (TmfTraceException e) {
+ Activator.getDefault().logError("Error while getting the synchronization data of experiment", e); //$NON-NLS-1$
+ }
+ }
+ Display.getDefault().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ updateTable();
+ }
+ });
+ }
+
+ /**
* Handler called when traces are synchronized
*
* @param signal

Back to the top