This will allow all views depending on the symbol map to update properly.
Change-Id: I48dcb4d16cd14cf6a6572385f95ce699aeb9fd09
Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/83319
Reviewed-by: Hudson CI
Reviewed-by: Genevieve Bastien <gbastien+lttng@versatic.net>
Tested-by: Genevieve Bastien <gbastien+lttng@versatic.net>
import org.eclipse.tracecompass.segmentstore.core.ISegment;
import org.eclipse.tracecompass.tmf.core.signal.TmfSelectionRangeUpdatedSignal;
import org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler;
+import org.eclipse.tracecompass.tmf.core.signal.TmfSignalManager;
import org.eclipse.tracecompass.tmf.core.signal.TmfTraceClosedSignal;
import org.eclipse.tracecompass.tmf.core.signal.TmfTraceSelectedSignal;
import org.eclipse.tracecompass.tmf.core.timestamp.TmfTimestamp;
import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
import org.eclipse.tracecompass.tmf.core.trace.TmfTraceUtils;
import org.eclipse.tracecompass.tmf.ui.editors.ITmfTraceEditor;
+import org.eclipse.tracecompass.tmf.ui.symbols.TmfSymbolProviderUpdatedSignal;
import org.eclipse.tracecompass.tmf.ui.views.TmfView;
import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.TimeGraphPresentationProvider;
import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.TimeGraphViewer;
}
contributeToActionBars();
loadSortOption();
-
+ TmfSignalManager.register(this);
getSite().setSelectionProvider(fTimeGraphViewer.getSelectionProvider());
createTimeEventContextMenu();
fTimeGraphViewer.getTimeGraphControl().addMouseListener(new MouseAdapter() {
setSortOption(SortOption.fromName(sortOption));
}
+ /**
+ * Symbol map provider updated
+ *
+ * @param signal
+ * the signal
+ */
+ @TmfSignalHandler
+ public void symbolMapUpdated(TmfSymbolProviderUpdatedSignal signal) {
+ if (signal.getSource() != this) {
+ fTimeGraphViewer.refresh();
+ }
+ }
+
}
Received by viewers that show information specific to a selected thread.
+=== TmfSymbolProviderUpdatedSignal ===
+
+''Purpose''
+
+This signal is used to indicate that the user has updated the symbol mapping.
+
+''Senders''
+
+Sent by symbol providers or managers when more information is available.
+
+''Receivers''
+
+Received by viewers that show information specific to mapped symbol, typically a function call.
+
=== TmfTraceSynchronizedSignal ===
''Purpose''
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
+import org.eclipse.tracecompass.tmf.core.signal.TmfSignalManager;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;
if (!cancel) {
super.okPressed();
}
+ TmfSignalManager.dispatchSignal(new TmfSymbolProviderUpdatedSignal(this));
}
@Override
--- /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
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.tmf.ui.symbols;
+
+import org.eclipse.tracecompass.tmf.core.signal.TmfSignal;
+
+/**
+ * Symbol provider is updated. It will be fired when the symbol provider loads a
+ * new mapping. This should be listened to by all views and viewers that need to
+ * display items using the symbol map.
+ *
+ * @author Matthew Khouzam
+ * @since 2.2
+ */
+public class TmfSymbolProviderUpdatedSignal extends TmfSignal {
+ /**
+ * Constructor
+ *
+ * @param source
+ * the symbol source
+ */
+ public TmfSymbolProviderUpdatedSignal(Object source) {
+ super(source);
+ }
+}