use of org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler in project tracecompass by tracecompass.
the class TmfStatisticsViewImpl method traceSelected.
/**
* Handler called when an trace is selected. Checks if the trace
* has changed and requests the selected trace if it has not yet been
* cached.
*
* @param signal
* Contains the information about the selection.
*/
@TmfSignalHandler
public void traceSelected(TmfTraceSelectedSignal signal) {
// Does not reload the same trace if already opened
if (signal.getTrace() != fTrace) {
/*
* Dispose the current viewer and adapt the new one to the trace
* type of the trace selected
*/
fStatsViewers.clear();
// Update the current trace
fTrace = signal.getTrace();
createStatisticsViewers();
fStatsViewers.layout();
TmfTraceRangeUpdatedSignal updateSignal = new TmfTraceRangeUpdatedSignal(this, fTrace, fTrace.getTimeRange());
for (ITmfViewer viewer : fStatsViewers.getViewers()) {
TmfStatisticsViewer statsViewer = (TmfStatisticsViewer) viewer;
statsViewer.sendPartialRequestOnNextUpdate();
statsViewer.traceRangeUpdated(updateSignal);
}
} else {
/*
* If the same trace is reselected, sends a notification to
* the viewers to make sure they reload correctly their partial
* event count.
*/
for (ITmfViewer viewer : fStatsViewers.getViewers()) {
TmfStatisticsViewer statsViewer = (TmfStatisticsViewer) viewer;
// Will update the partial event count if needed.
statsViewer.sendPartialRequestOnNextUpdate();
}
}
}
use of org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler in project tracecompass by tracecompass.
the class TmfUml2SDSyncLoader method traceSelected.
/**
* Signal handler for the trace selected signal.
*
* Spawns a request to index the trace (checkpoints creation) as well as it
* fills the first page.
*
* @param signal
* The trace selected signal
*/
@TmfSignalHandler
public void traceSelected(TmfTraceSelectedSignal signal) {
// Update the trace reference
ITmfTrace trace = signal.getTrace();
if (!trace.equals(fTrace)) {
fTrace = trace;
}
loadTrace();
}
use of org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler in project tracecompass by tracecompass.
the class TmfTimeViewer method traceRangeUpdated.
/**
* Signal handler for handling of the trace range updated signal.
*
* @param signal
* The trace range signal {@link TmfTraceRangeUpdatedSignal}
*/
@TmfSignalHandler
public void traceRangeUpdated(@Nullable TmfTraceRangeUpdatedSignal signal) {
if (signal == null || signal.getTrace() != fTrace) {
return;
}
TmfTimeRange fullRange = signal.getRange();
long traceStartTime = fullRange.getStartTime().toNanos();
long traceEndTime = fullRange.getEndTime().toNanos();
setStartTime(traceStartTime);
setEndTime(traceEndTime);
}
use of org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler in project tracecompass by tracecompass.
the class TmfTimeViewer method traceUpdated.
/**
* Signal handler for handling of the trace updated signal.
*
* @param signal
* The trace updated signal {@link TmfTraceUpdatedSignal}
*/
@TmfSignalHandler
public void traceUpdated(@Nullable TmfTraceUpdatedSignal signal) {
if (signal == null || signal.getTrace() != fTrace) {
return;
}
TmfTimeRange fullRange = signal.getTrace().getTimeRange();
long traceStartTime = fullRange.getStartTime().toNanos();
long traceEndTime = fullRange.getEndTime().toNanos();
setStartTime(traceStartTime);
setEndTime(traceEndTime);
}
use of org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler in project tracecompass by tracecompass.
the class TmfEventsTable method eventFilterApplied.
/**
* Receive a signal to apply a filter. This will apply the filter if the
* source is not this viewer already
*
* @param signal
* The signal
* @since 4.2
*/
@TmfSignalHandler
public void eventFilterApplied(TmfFilterAppliedSignal signal) {
if (signal.getSource() == this) {
// This view is the source of the signal, ignore
return;
}
Runnable runnable = () -> {
if (fTable.isDisposed()) {
return;
}
ITmfFilter eventFilter = signal.getFilter().getEventFilter();
if (eventFilter == null) {
fTable.setData(Key.SEARCH_OBJ, null);
fTable.refresh();
} else {
fTable.setData(Key.SEARCH_OBJ, eventFilter);
fTable.refresh();
searchNext();
}
};
Display display = PlatformUI.getWorkbench().getDisplay();
if (display == Display.getCurrent()) {
runnable.run();
} else {
Display.getDefault().asyncExec(runnable);
}
}
Aggregations