use of org.eclipse.tracecompass.internal.analysis.os.linux.ui.actions.UnfollowThreadAction in project tracecompass by tracecompass.
the class ResourcesView method fillTimeEventContextMenu.
@Override
protected void fillTimeEventContextMenu(@NonNull IMenuManager menuManager) {
ISelection selection = getSite().getSelectionProvider().getSelection();
if (selection instanceof IStructuredSelection) {
IStructuredSelection sSel = (IStructuredSelection) selection;
if (sSel.getFirstElement() instanceof TimeGraphEntry) {
TimeGraphEntry resourcesEntry = (TimeGraphEntry) sSel.getFirstElement();
ITmfTreeDataModel model = resourcesEntry.getEntryModel();
if (sSel.toArray()[1] instanceof NamedTimeEvent && ((ResourcesEntryModel) model).getType() == Type.CURRENT_THREAD) {
ITmfTrace trace = getTrace(resourcesEntry);
NamedTimeEvent event = (NamedTimeEvent) sSel.toArray()[1];
TmfTraceContext ctx = TmfTraceManager.getInstance().getCurrentTraceContext();
HostThread data = (HostThread) ctx.getData(HostThread.SELECTED_HOST_THREAD_KEY);
if (data != null) {
menuManager.add(new UnfollowThreadAction(ResourcesView.this));
} else {
menuManager.add(new FollowThreadAction(ResourcesView.this, null, event.getValue(), trace));
}
}
}
}
super.fillTimeEventContextMenu(menuManager);
}
Aggregations