use of org.eclipse.tracecompass.internal.analysis.os.linux.ui.views.controlflow.filters.ActiveThreadsFilter in project tracecompass by tracecompass.
the class ControlFlowView method createDynamicFilterConfigureAction.
private IAction createDynamicFilterConfigureAction() {
return new Action(PackageMessages.ControlFlowView_DynamicFiltersConfigureLabel, IAction.AS_PUSH_BUTTON) {
@Override
public void run() {
DynamicFilterDialog dialog = new DynamicFilterDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), fActiveThreadsFilter, getTrace());
if (dialog.open() == Window.OK) {
/* Remove the previous Active Threads filter */
checkNotNull(getTimeGraphViewer()).removeFilter(fActiveThreadsFilter);
ActiveThreadsFilter newFilter = dialog.getActiveThreadsResult();
ActiveThreadsFilter previousFilter = fActiveThreadsFilter;
/* Set the filter to the view */
fActiveThreadsFilter = newFilter;
boolean enabled = fActiveThreadsFilter.isEnabled();
if (enabled) {
checkNotNull(getTimeGraphViewer()).addFilter(newFilter);
}
/*
* Prevent double refresh from change state of setChecked
* and ensure that a refresh is done if the mode of the
* filter is changed or options are changed
*/
if (previousFilter.isEnabled() && newFilter.isEnabled()) {
boolean changed = !Objects.equals(previousFilter.getCpuRanges(), newFilter.getCpuRanges()) || previousFilter.isCpuRangesBased() != newFilter.isCpuRangesBased();
if (changed) {
refresh();
}
} else {
fActiveThreadsRapidToggle.setChecked(enabled);
}
}
}
};
}
use of org.eclipse.tracecompass.internal.analysis.os.linux.ui.views.controlflow.filters.ActiveThreadsFilter in project tracecompass by tracecompass.
the class ControlFlowView method traceSelected.
@TmfSignalHandler
@Override
public void traceSelected(TmfTraceSelectedSignal signal) {
super.traceSelected(signal);
/* Update the Flat and Hierarchical actions */
synchronized (fFlatTraces) {
if (fFlatTraces.contains(signal.getTrace())) {
fHierarchicalAction.setChecked(false);
fFlatAction.setChecked(true);
} else {
fFlatAction.setChecked(false);
fHierarchicalAction.setChecked(true);
}
}
/* Update the Dynamic Filters related actions */
ViewerFilter activeThreadFilter = null;
ViewerFilter[] traceFilters = getFiltersMap().get(signal.getTrace());
if (traceFilters != null) {
activeThreadFilter = getActiveThreadsFilter(traceFilters);
}
if (activeThreadFilter instanceof ActiveThreadsFilter) {
fActiveThreadsFilter = (ActiveThreadsFilter) activeThreadFilter;
} else {
fActiveThreadsFilter = new ActiveThreadsFilter(null, false, getTrace());
}
fActiveThreadsRapidToggle.setChecked(fActiveThreadsFilter.isEnabled());
}
Aggregations