use of org.eclipse.tracecompass.tmf.core.signal.TmfSelectionRangeUpdatedSignal in project tracecompass by tracecompass.
the class FlameGraphView method fillTimeEventContextMenu.
/**
* Fill context menu
*
* @param menuManager
* a menuManager to fill
*/
protected void fillTimeEventContextMenu(@NonNull IMenuManager menuManager) {
ISelection selection = getSite().getSelectionProvider().getSelection();
if (selection instanceof IStructuredSelection) {
for (Object object : ((IStructuredSelection) selection).toList()) {
if (object instanceof FlamegraphEvent) {
final FlamegraphEvent flamegraphEvent = (FlamegraphEvent) object;
menuManager.add(new Action(Messages.FlameGraphView_GotoMaxDuration) {
@Override
public void run() {
ISegment maxSeg = flamegraphEvent.getStatistics().getDurationStatistics().getMaxObject();
if (maxSeg == null) {
return;
}
TmfSelectionRangeUpdatedSignal sig = new TmfSelectionRangeUpdatedSignal(this, TmfTimestamp.fromNanos(maxSeg.getStart()), TmfTimestamp.fromNanos(maxSeg.getEnd()), fTrace);
broadcast(sig);
}
});
menuManager.add(new Action(Messages.FlameGraphView_GotoMinDuration) {
@Override
public void run() {
ISegment minSeg = flamegraphEvent.getStatistics().getDurationStatistics().getMinObject();
if (minSeg == null) {
return;
}
TmfSelectionRangeUpdatedSignal sig = new TmfSelectionRangeUpdatedSignal(this, TmfTimestamp.fromNanos(minSeg.getStart()), TmfTimestamp.fromNanos(minSeg.getEnd()), fTrace);
broadcast(sig);
}
});
}
}
}
}
Aggregations