use of org.eclipse.tracecompass.tmf.ui.viewers.ITmfViewer 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.ui.viewers.ITmfViewer in project tracecompass by tracecompass.
the class TmfViewerFolder method clear.
/**
* Disposes of all the viewers contained in the folder and restart to a
* clean state.
*/
public void clear() {
for (ITmfViewer viewer : fViewers.values()) {
viewer.dispose();
}
fViewers.clear();
fFolder.dispose();
initFolder();
}
Aggregations