Search in sources :

Example 1 with ITmfViewer

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();
        }
    }
}
Also used : TmfTraceRangeUpdatedSignal(org.eclipse.tracecompass.tmf.core.signal.TmfTraceRangeUpdatedSignal) TmfStatisticsViewer(org.eclipse.tracecompass.internal.tmf.ui.viewers.statistics.TmfStatisticsViewer) ITmfViewer(org.eclipse.tracecompass.tmf.ui.viewers.ITmfViewer) TmfSignalHandler(org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler)

Example 2 with ITmfViewer

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();
}
Also used : ITmfViewer(org.eclipse.tracecompass.tmf.ui.viewers.ITmfViewer)

Aggregations

ITmfViewer (org.eclipse.tracecompass.tmf.ui.viewers.ITmfViewer)2 TmfStatisticsViewer (org.eclipse.tracecompass.internal.tmf.ui.viewers.statistics.TmfStatisticsViewer)1 TmfSignalHandler (org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler)1 TmfTraceRangeUpdatedSignal (org.eclipse.tracecompass.tmf.core.signal.TmfTraceRangeUpdatedSignal)1