Search in sources :

Example 11 with TmfTraceManager

use of org.eclipse.tracecompass.tmf.core.trace.TmfTraceManager in project tracecompass by tracecompass.

the class ControlFlowCheckActiveProvider method isActive.

@Override
public boolean isActive(ITimeGraphEntry element) {
    ThreadEntryModel model = ControlFlowView.getThreadEntryModel(element);
    if (model != null) {
        TmfTraceManager traceManager = TmfTraceManager.getInstance();
        TmfTraceContext traceContext = traceManager.getCurrentTraceContext();
        TmfTimeRange range = traceContext.getSelectionRange();
        /* Take precedence of selection over window range. */
        if (Objects.equals(range.getStartTime(), range.getEndTime())) {
            range = traceContext.getWindowRange();
        }
        Set<Long> ids = getActiveIds((TimeGraphEntry) element, range);
        return ids.contains(model.getId());
    }
    return false;
}
Also used : TmfTraceManager(org.eclipse.tracecompass.tmf.core.trace.TmfTraceManager) TmfTraceContext(org.eclipse.tracecompass.tmf.core.trace.TmfTraceContext) ThreadEntryModel(org.eclipse.tracecompass.internal.analysis.os.linux.core.threadstatus.ThreadEntryModel) TmfTimeRange(org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange)

Aggregations

TmfTraceManager (org.eclipse.tracecompass.tmf.core.trace.TmfTraceManager)11 ITmfTrace (org.eclipse.tracecompass.tmf.core.trace.ITmfTrace)9 SWTBotEditor (org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor)6 TmfTimeRange (org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange)6 Test (org.junit.Test)6 TmfWindowRangeUpdatedSignal (org.eclipse.tracecompass.tmf.core.signal.TmfWindowRangeUpdatedSignal)5 SWTBotView (org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView)3 TmfCommonProjectElement (org.eclipse.tracecompass.tmf.ui.project.model.TmfCommonProjectElement)3 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)2 Nullable (org.eclipse.jdt.annotation.Nullable)2 ISelection (org.eclipse.jface.viewers.ISelection)2 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)2 Shell (org.eclipse.swt.widgets.Shell)2 WidgetNotFoundException (org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException)2 DefaultCondition (org.eclipse.swtbot.swt.finder.waits.DefaultCondition)2 SWTBotMenu (org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu)2 SWTBotTable (org.eclipse.swtbot.swt.finder.widgets.SWTBotTable)2 SWTBotTableItem (org.eclipse.swtbot.swt.finder.widgets.SWTBotTableItem)2 SWTBotToolbarDropDownButton (org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarDropDownButton)2 TmfTraceElement (org.eclipse.tracecompass.tmf.ui.project.model.TmfTraceElement)2