Received by any component that needs to be notified of trace synchronization.
+=== TmfMarkerEventSourceUpdatedSignal ===
+
+''Purpose''
+
+This signal is used to indicate that a marker event source has been updated.
+
+''Senders''
+
+Sent by a component that has triggered a change in a marker event source.
+
+''Receivers''
+
+Received by any component that needs to refresh the markers due to the change in marker event source.
+
== Debugging ==
TMF has built-in Eclipse tracing support for the debugging of signal interaction between components. To enable it, open the '''Run/Debug Configuration...''' dialog, select a configuration, click the '''Tracing''' tab, select the plug-in '''org.eclipse.tracecompass.tmf.core''', and check the '''signal''' item.
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2016 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tasse - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.tmf.core.signal;
+
+/**
+ * A marker event source has been updated
+ *
+ * @since 2.1
+ */
+public class TmfMarkerEventSourceUpdatedSignal extends TmfSignal {
+
+ /**
+ * @param source the signal source
+ */
+ public TmfMarkerEventSourceUpdatedSignal(Object source) {
+ super(source);
+ }
+
+}
markers.addAll(getTraceMarkerList(getZoomStartTime(), getZoomEndTime(), getResolution(), getMonitor()));
applyResults(() -> {
getTimeGraphViewer().setLinks(links);
+ getTimeGraphViewer().setMarkerCategories(getMarkerCategories());
getTimeGraphViewer().setMarkers(markers);
});
} else {
import org.eclipse.tracecompass.common.core.log.TraceCompassLog;
import org.eclipse.tracecompass.internal.tmf.ui.Activator;
import org.eclipse.tracecompass.tmf.core.resources.ITmfMarker;
+import org.eclipse.tracecompass.tmf.core.signal.TmfMarkerEventSourceUpdatedSignal;
import org.eclipse.tracecompass.tmf.core.signal.TmfSelectionRangeUpdatedSignal;
import org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler;
import org.eclipse.tracecompass.tmf.core.signal.TmfTimestampFormatUpdateSignal;
if (events != null) {
fTimeGraphWrapper.getTimeGraphViewer().setLinks(events);
}
+ fTimeGraphWrapper.getTimeGraphViewer().setMarkerCategories(getMarkerCategories());
fTimeGraphWrapper.getTimeGraphViewer().setMarkers(markers);
redraw();
});
fTimeGraphWrapper.refresh();
}
+ /**
+ * A marker event source has been updated
+ *
+ * @param signal
+ * the signal
+ * @since 2.1
+ */
+ @TmfSignalHandler
+ public void markerEventSourceUpdated(final TmfMarkerEventSourceUpdatedSignal signal) {
+ getTimeGraphViewer().setMarkerCategories(getMarkerCategories());
+ getTimeGraphViewer().setMarkers(null);
+ refresh();
+ }
+
// ------------------------------------------------------------------------
// Internal
// ------------------------------------------------------------------------
* Get the list of current marker categories.
*
* @return The list of marker categories
- * @since 2.0
+ * @since 2.1
*/
- private @NonNull List<String> getMarkerCategories() {
+ protected @NonNull List<String> getMarkerCategories() {
Set<String> categories = new LinkedHashSet<>(getViewMarkerCategories());
for (IMarkerEventSource markerEventSource : getMarkerEventSources(fTrace)) {
categories.addAll(markerEventSource.getMarkerCategories());