tmf.ui: make State System Explorer manually get analyses.
authorMatthew Khouzam <matthew.khouzam@ericsson.com>
Wed, 11 May 2016 21:06:29 +0000 (17:06 -0400)
committerMatthew Khouzam <matthew.khouzam@ericsson.com>
Mon, 16 May 2016 16:47:48 +0000 (12:47 -0400)
SSE already gets all analyses for every child, this patch eschews
using helper functions. Using them would actually make things more
complicated.

Change-Id: I6b72a10c38f4404d112fa88ed86e06752a39ec4d
Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/72572
Reviewed-by: Hudson CI
Reviewed-by: Genevieve Bastien <gbastien+lttng@versatic.net>
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/statesystem/TmfStateSystemViewer.java

index 5ed89b296c044b05cddda98146259dab3ce34c5e..50053b54d194e08c483d0ec2c7dedceeb8f952d4 100644 (file)
@@ -34,6 +34,7 @@ import org.eclipse.tracecompass.statesystem.core.exceptions.StateSystemDisposedE
 import org.eclipse.tracecompass.statesystem.core.exceptions.TimeRangeException;
 import org.eclipse.tracecompass.statesystem.core.interval.ITmfStateInterval;
 import org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue;
+import org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule;
 import org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler;
 import org.eclipse.tracecompass.tmf.core.signal.TmfTimestampFormatUpdateSignal;
 import org.eclipse.tracecompass.tmf.core.statesystem.ITmfAnalysisModuleWithStateSystems;
@@ -42,7 +43,6 @@ import org.eclipse.tracecompass.tmf.core.timestamp.TmfTimestamp;
 import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
 import org.eclipse.tracecompass.tmf.core.trace.TmfTraceContext;
 import org.eclipse.tracecompass.tmf.core.trace.TmfTraceManager;
-import org.eclipse.tracecompass.tmf.core.trace.TmfTraceUtils;
 import org.eclipse.tracecompass.tmf.ui.viewers.tree.AbstractTmfTreeViewer;
 import org.eclipse.tracecompass.tmf.ui.viewers.tree.ITmfTreeColumnDataProvider;
 import org.eclipse.tracecompass.tmf.ui.viewers.tree.ITmfTreeViewerEntry;
@@ -207,15 +207,21 @@ public class TmfStateSystemViewer extends AbstractTmfTreeViewer {
 
     private static TmfTreeViewerEntry createTraceEntry(ITmfTrace trace) {
         TmfTreeViewerEntry traceEntry = new TmfTreeViewerEntry(trace.getName());
-        Iterable<ITmfAnalysisModuleWithStateSystems> modules = TmfTraceUtils.getAnalysisModulesOfClass(trace, ITmfAnalysisModuleWithStateSystems.class);
-        for (ITmfAnalysisModuleWithStateSystems module : modules) {
-            /* Just schedule the module, the data will be filled when available */
-            module.schedule();
-            if (!module.waitForInitialization()) {
-                continue;
-            }
-            for (ITmfStateSystem ss : module.getStateSystems()) {
-                traceEntry.addChild(new StateSystemEntry(ss));
+        Iterable<IAnalysisModule> modules = trace.getAnalysisModules();
+        for (IAnalysisModule module : modules) {
+            if (module instanceof ITmfAnalysisModuleWithStateSystems) {
+                ITmfAnalysisModuleWithStateSystems moduleWithStateSystem = (ITmfAnalysisModuleWithStateSystems) module;
+                /*
+                 * Just schedule the module, the data will be filled when
+                 * available
+                 */
+                moduleWithStateSystem.schedule();
+                if (!moduleWithStateSystem.waitForInitialization()) {
+                    continue;
+                }
+                for (ITmfStateSystem ss : moduleWithStateSystem.getStateSystems()) {
+                    traceEntry.addChild(new StateSystemEntry(ss));
+                }
             }
         }
         return traceEntry;
This page took 0.026657 seconds and 5 git commands to generate.