use of org.eclipse.tracecompass.internal.analysis.os.linux.ui.actions.FollowThreadAction in project tracecompass by tracecompass.
the class ControlFlowView method fillTimeGraphEntryContextMenu.
/**
* @since 2.0
*/
@Override
protected void fillTimeGraphEntryContextMenu(@NonNull IMenuManager menuManager) {
ISelection selection = getSite().getSelectionProvider().getSelection();
if (selection instanceof StructuredSelection) {
StructuredSelection sSel = (StructuredSelection) selection;
if (sSel.getFirstElement() instanceof TimeGraphEntry) {
TimeGraphEntry entry = (TimeGraphEntry) sSel.getFirstElement();
ITmfTreeDataModel entryModel = entry.getEntryModel();
if (entryModel instanceof ThreadEntryModel) {
menuManager.add(new FollowThreadAction(ControlFlowView.this, entry.getName(), ((ThreadEntryModel) entryModel).getThreadId(), getTrace(entry)));
}
}
}
}
use of org.eclipse.tracecompass.internal.analysis.os.linux.ui.actions.FollowThreadAction 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