From 860b39d1aa636b4c73dfc4100638435df40dd4f1 Mon Sep 17 00:00:00 2001 From: Matthew Khouzam Date: Wed, 11 May 2016 17:06:29 -0400 Subject: [PATCH 1/1] tmf.ui: make State System Explorer manually get analyses. 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 Reviewed-on: https://git.eclipse.org/r/72572 Reviewed-by: Hudson CI Reviewed-by: Genevieve Bastien --- .../statesystem/TmfStateSystemViewer.java | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/statesystem/TmfStateSystemViewer.java b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/statesystem/TmfStateSystemViewer.java index 5ed89b296c..50053b54d1 100644 --- a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/statesystem/TmfStateSystemViewer.java +++ b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/statesystem/TmfStateSystemViewer.java @@ -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 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 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; -- 2.34.1