tmf.ui: Introduce TmfSymbolMapUpdatedSignal
authorMatthew Khouzam <matthew.khouzam@ericsson.com>
Sun, 16 Oct 2016 10:47:12 +0000 (06:47 -0400)
committerMatthew Khouzam <matthew.khouzam@ericsson.com>
Tue, 8 Nov 2016 19:29:44 +0000 (14:29 -0500)
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>
analysis/org.eclipse.tracecompass.analysis.timing.ui/src/org/eclipse/tracecompass/internal/analysis/timing/ui/flamegraph/FlameGraphView.java
doc/org.eclipse.tracecompass.doc.dev/doc/Developer-Guide.mediawiki
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/symbols/SymbolProviderConfigDialog.java
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/symbols/TmfSymbolProviderUpdatedSignal.java [new file with mode: 0644]

index 309f06f25dc5a505d0c1200ac22e631e5a848f5c..463b901a7c07660898ecad120d9a406915f5bf38 100644 (file)
@@ -44,12 +44,14 @@ import org.eclipse.tracecompass.internal.analysis.timing.ui.callgraph.CallGraphA
 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;
@@ -120,7 +122,7 @@ public class FlameGraphView extends TmfView {
         }
         contributeToActionBars();
         loadSortOption();
-
+        TmfSignalManager.register(this);
         getSite().setSelectionProvider(fTimeGraphViewer.getSelectionProvider());
         createTimeEventContextMenu();
         fTimeGraphViewer.getTimeGraphControl().addMouseListener(new MouseAdapter() {
@@ -432,4 +434,17 @@ public class FlameGraphView extends TmfView {
         setSortOption(SortOption.fromName(sortOption));
     }
 
+    /**
+     * Symbol map provider updated
+     *
+     * @param signal
+     *            the signal
+     */
+    @TmfSignalHandler
+    public void symbolMapUpdated(TmfSymbolProviderUpdatedSignal signal) {
+        if (signal.getSource() != this) {
+            fTimeGraphViewer.refresh();
+        }
+    }
+
 }
index 062b673e5ad3d3ec0eb8f7c30f8df06fad252b87..b99decb16465ec5945abe05c2d0c673e82ee9334 100644 (file)
@@ -1034,6 +1034,20 @@ Sent by any component that allows the user to select a thread.
 
 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''
index 898e1598e18b98dbf4a071bd69698fa5f4e13214..d875adc3f0cbec90850baccc8f93dd38b61bf9df 100644 (file)
@@ -29,6 +29,7 @@ import org.eclipse.swt.layout.GridLayout;
 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;
 
@@ -166,6 +167,7 @@ public class SymbolProviderConfigDialog extends TitleAreaDialog implements IPref
         if (!cancel) {
             super.okPressed();
         }
+        TmfSignalManager.dispatchSignal(new TmfSymbolProviderUpdatedSignal(this));
     }
 
     @Override
diff --git a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/symbols/TmfSymbolProviderUpdatedSignal.java b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/symbols/TmfSymbolProviderUpdatedSignal.java
new file mode 100644 (file)
index 0000000..e00bf2b
--- /dev/null
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * 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);
+    }
+}
This page took 0.028052 seconds and 5 git commands to generate.