analysis.lami: Fix internal signaling with several views on the same report
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Wed, 30 Nov 2016 21:03:58 +0000 (16:03 -0500)
committerAlexandre Montplaisir <alexmonthy@efficios.com>
Thu, 1 Dec 2016 18:18:04 +0000 (13:18 -0500)
Use the parent LAMI tab page instance as the key for internal signaling.

The signal key is designed to restrict the signal to interested objects.
It was based on the hash of the immutable fResultTable field. Since for multiple
view of the same report the fResultTable is the same object, signals were
processed by objects that were not concerned. Using the result table
instance/hash as a key is not sufficient.

Bug: 495322

Change-Id: Ifba2056b10cd254d1a8c6c030c4b7263463ac834
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Alexandre Montplaisir <alexmonthy@efficios.com>
Reviewed-on: https://git.eclipse.org/r/86103
Reviewed-by: Hudson CI
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
analysis/org.eclipse.tracecompass.analysis.lami.ui/src/org/eclipse/tracecompass/internal/provisional/analysis/lami/ui/signals/LamiSelectionUpdateSignal.java
analysis/org.eclipse.tracecompass.analysis.lami.ui/src/org/eclipse/tracecompass/internal/provisional/analysis/lami/ui/viewers/ILamiViewer.java
analysis/org.eclipse.tracecompass.analysis.lami.ui/src/org/eclipse/tracecompass/internal/provisional/analysis/lami/ui/viewers/LamiBarChartViewer.java
analysis/org.eclipse.tracecompass.analysis.lami.ui/src/org/eclipse/tracecompass/internal/provisional/analysis/lami/ui/viewers/LamiScatterViewer.java
analysis/org.eclipse.tracecompass.analysis.lami.ui/src/org/eclipse/tracecompass/internal/provisional/analysis/lami/ui/viewers/LamiTableViewer.java
analysis/org.eclipse.tracecompass.analysis.lami.ui/src/org/eclipse/tracecompass/internal/provisional/analysis/lami/ui/viewers/LamiXYChartViewer.java
analysis/org.eclipse.tracecompass.analysis.lami.ui/src/org/eclipse/tracecompass/internal/provisional/analysis/lami/ui/views/LamiReportViewTabPage.java
analysis/org.eclipse.tracecompass.analysis.lami.ui/src/org/eclipse/tracecompass/internal/provisional/analysis/lami/ui/views/LamiViewerControl.java

index 69dbb0f4e62621301c8b67b4d7455fff5ab3951e..52c1edd32d9bdd486302af94950a914e905cdcdb 100644 (file)
@@ -12,6 +12,7 @@ package org.eclipse.tracecompass.internal.provisional.analysis.lami.ui.signals;
 import java.util.HashSet;
 import java.util.Set;
 
+import org.eclipse.tracecompass.internal.provisional.analysis.lami.ui.views.LamiReportViewTabPage;
 import org.eclipse.tracecompass.tmf.core.signal.TmfSignal;
 
 /**
@@ -22,12 +23,13 @@ import org.eclipse.tracecompass.tmf.core.signal.TmfSignal;
 public class LamiSelectionUpdateSignal extends TmfSignal {
 
     private final Set<Integer> fEntryIndexes;
-    /*
-     * TODO: replace this with an object to equals. A signalHash can only
-     * guaranty that objects are different, not that they are the same. Using
-     * this is looking for trouble.
+
+    /**
+     * Use the {@link LamiReportViewTabPage LamiReportViewTabPage} object as the
+     * unique key for LAMI internal signaling. The {@link LamiReportViewTabPage}
+     * object is also the synchronization point for LAMI internal signaling.
      */
-    private final int fSignalHash;
+    private final LamiReportViewTabPage fSignalKey;
 
     /**
      * Constructor for a new signal.
@@ -36,13 +38,14 @@ public class LamiSelectionUpdateSignal extends TmfSignal {
      *            The object sending this signal
      * @param entryIndexList
      *            The list of selected indices
-     * @param signalHash
-     *            The hash for exclusivity signaling
+     * @param signalKey
+     *            The {@link LamiReportViewTabPage LamiReportViewTabPage} acting
+     *            as a key for the signal.
      */
-    public LamiSelectionUpdateSignal(Object source, Set<Integer> entryIndexList, int signalHash) {
+    public LamiSelectionUpdateSignal(Object source, Set<Integer> entryIndexList, LamiReportViewTabPage signalKey) {
         super(source);
         fEntryIndexes = new HashSet<>(entryIndexList);
-        fSignalHash = signalHash;
+        fSignalKey = signalKey;
     }
 
 
@@ -63,12 +66,12 @@ public class LamiSelectionUpdateSignal extends TmfSignal {
 
 
     /**
-     * Getter for the exclusivity hash
+     * Getter for the exclusivity key
      *
      * @return
-     *          The exclusivity hash
+     *          The exclusivity key
      */
-    public int getSignalHash() {
-        return fSignalHash;
+    public LamiReportViewTabPage getSignalKey() {
+        return fSignalKey;
     }
 }
index ab7977aa1c0ba63603b46ff763aeac267b0081cb..12832d81e618e363c9868e7c32caae23dca8adc5 100644 (file)
@@ -13,7 +13,7 @@ import org.eclipse.jface.viewers.TableViewer;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.tracecompass.internal.provisional.analysis.lami.core.module.LamiChartModel;
-import org.eclipse.tracecompass.internal.provisional.analysis.lami.core.module.LamiResultTable;
+import org.eclipse.tracecompass.internal.provisional.analysis.lami.ui.views.LamiReportViewTabPage;
 
 /**
  * Common interface for all Lami viewers.
@@ -32,13 +32,13 @@ public interface ILamiViewer {
      *
      * @param parent
      *            The parent composite
-     * @param resultTable
-     *            The result table to display
+     * @param page
+     *            The {@link LamiReportViewTabPage} parent page
      * @return The new viewer
      */
-    static ILamiViewer createLamiTable(Composite parent, LamiResultTable resultTable) {
+    static ILamiViewer createLamiTable(Composite parent, LamiReportViewTabPage page) {
         TableViewer tableViewer = new TableViewer(parent, SWT.FULL_SELECTION | SWT.MULTI | SWT.VIRTUAL);
-        return new LamiTableViewer(tableViewer, resultTable);
+        return new LamiTableViewer(tableViewer, page);
     }
 
     /**
@@ -47,18 +47,18 @@ public interface ILamiViewer {
      *
      * @param parent
      *            The parent composite
-     * @param resultTable
-     *            The result table to use as a data source
+     * @param page
+     *            The {@link LamiReportViewTabPage} parent page
      * @param chartModel
      *            The information about the chart to display
      * @return The new viewer
      */
-    static ILamiViewer createLamiChart(Composite parent, LamiResultTable resultTable, LamiChartModel chartModel) {
+    static ILamiViewer createLamiChart(Composite parent, LamiReportViewTabPage page, LamiChartModel chartModel) {
         switch (chartModel.getChartType()) {
         case BAR_CHART:
-            return new LamiBarChartViewer(parent, resultTable, chartModel);
+            return new LamiBarChartViewer(parent, page, chartModel);
         case XY_SCATTER:
-            return new LamiScatterViewer(parent, resultTable, chartModel);
+            return new LamiScatterViewer(parent, page, chartModel);
         case PIE_CHART:
         default:
             throw new UnsupportedOperationException("Unsupported chart type: " + chartModel.toString()); //$NON-NLS-1$
index a79404332ae0e2c9bebf02e9647ec90731e69440..78aae0bcc56b5096128e160c7a6a3397ccef8a06 100644 (file)
@@ -38,9 +38,9 @@ import org.eclipse.swt.widgets.Composite;
 import org.eclipse.tracecompass.internal.provisional.analysis.lami.core.aspect.LamiTableEntryAspect;
 import org.eclipse.tracecompass.internal.provisional.analysis.lami.core.module.LamiChartModel;
 import org.eclipse.tracecompass.internal.provisional.analysis.lami.core.module.LamiChartModel.ChartType;
-import org.eclipse.tracecompass.internal.provisional.analysis.lami.core.module.LamiResultTable;
 import org.eclipse.tracecompass.internal.provisional.analysis.lami.core.module.LamiTableEntry;
 import org.eclipse.tracecompass.internal.provisional.analysis.lami.ui.signals.LamiSelectionUpdateSignal;
+import org.eclipse.tracecompass.internal.provisional.analysis.lami.ui.views.LamiReportViewTabPage;
 import org.eclipse.tracecompass.tmf.core.signal.TmfSignalManager;
 import org.swtchart.IAxis;
 import org.swtchart.IAxisTick;
@@ -93,14 +93,13 @@ public class LamiBarChartViewer extends LamiXYChartViewer {
      *
      * @param parent
      *            The parent composite to draw in.
-     * @param resultTable
-     *            The result table containing the data from which to build the
-     *            chart
+     * @param page
+     *            The {@link LamiReportViewTabPage} parent page
      * @param chartModel
      *            The information about the chart to build
      */
-    public LamiBarChartViewer(Composite parent, LamiResultTable resultTable, LamiChartModel chartModel) {
-        super(parent, resultTable, chartModel);
+    public LamiBarChartViewer(Composite parent, LamiReportViewTabPage page, LamiChartModel chartModel) {
+        super(parent, page, chartModel);
 
         List<LamiTableEntryAspect> xAxisAspects = getXAxisAspects();
         List<LamiTableEntryAspect> yAxisAspects = getYAxisAspects();
@@ -340,7 +339,7 @@ public class LamiBarChartViewer extends LamiXYChartViewer {
             setSelection(selections);
             /* Signal all Lami viewers & views of the selection */
             LamiSelectionUpdateSignal signal = new LamiSelectionUpdateSignal(this,
-                    selections, getResultTable().hashCode());
+                    selections, getPage());
             TmfSignalManager.dispatchSignal(signal);
             redraw();
         }
index d25c446bb0a525a2343866e99df343090bcdfc0b..b2cfafe231da014e25ed46d4698f394c7f923a50 100644 (file)
@@ -43,11 +43,11 @@ import org.eclipse.swt.widgets.Listener;
 import org.eclipse.tracecompass.internal.provisional.analysis.lami.core.aspect.LamiTableEntryAspect;
 import org.eclipse.tracecompass.internal.provisional.analysis.lami.core.module.LamiChartModel;
 import org.eclipse.tracecompass.internal.provisional.analysis.lami.core.module.LamiChartModel.ChartType;
-import org.eclipse.tracecompass.internal.provisional.analysis.lami.core.module.LamiResultTable;
 import org.eclipse.tracecompass.internal.provisional.analysis.lami.core.module.LamiTableEntry;
 import org.eclipse.tracecompass.internal.provisional.analysis.lami.ui.format.LamiLabelFormat;
 import org.eclipse.tracecompass.internal.provisional.analysis.lami.ui.format.LamiTimeStampFormat;
 import org.eclipse.tracecompass.internal.provisional.analysis.lami.ui.signals.LamiSelectionUpdateSignal;
+import org.eclipse.tracecompass.internal.provisional.analysis.lami.ui.views.LamiReportViewTabPage;
 import org.eclipse.tracecompass.tmf.core.signal.TmfSignalManager;
 import org.swtchart.IAxisTick;
 import org.swtchart.ILineSeries;
@@ -86,13 +86,13 @@ public class LamiScatterViewer extends LamiXYChartViewer {
      *
      * @param parent
      *            parent
-     * @param resultTable
-     *            Result table populating this chart
+     * @param page
+     *            The {@link LamiReportViewTabPage} parent page
      * @param graphModel
      *            Model of this chart
      */
-    public LamiScatterViewer(Composite parent, LamiResultTable resultTable, LamiChartModel graphModel) {
-        super(parent, resultTable, graphModel);
+    public LamiScatterViewer(Composite parent, LamiReportViewTabPage page, LamiChartModel graphModel) {
+        super(parent, page, graphModel);
         if (getChartModel().getChartType() != ChartType.XY_SCATTER) {
             throw new IllegalStateException("Chart type not a Scatter Chart " + getChartModel().getChartType().toString()); //$NON-NLS-1$
         }
@@ -550,7 +550,7 @@ public class LamiScatterViewer extends LamiXYChartViewer {
             setSelection(selections);
             /* Signal all Lami viewers & views of the selection */
             LamiSelectionUpdateSignal signal = new LamiSelectionUpdateSignal(this,
-                    selections, checkNotNull(getResultTable().hashCode()));
+                    selections, getPage());
             TmfSignalManager.dispatchSignal(signal);
             refresh();
         }
index 0c745961feb7557055b0a047848b23da90c5d213..24ce4dd9657a5bd556ae7cdb6f376136600c57c0 100644 (file)
@@ -9,8 +9,6 @@
 
 package org.eclipse.tracecompass.internal.provisional.analysis.lami.ui.viewers;
 
-
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
 import static org.eclipse.tracecompass.common.core.NonNullUtils.nullToEmptyString;
 
 import java.util.HashSet;
@@ -28,10 +26,10 @@ import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.TableColumn;
 import org.eclipse.tracecompass.internal.provisional.analysis.lami.core.aspect.LamiTableEntryAspect;
-import org.eclipse.tracecompass.internal.provisional.analysis.lami.core.module.LamiResultTable;
 import org.eclipse.tracecompass.internal.provisional.analysis.lami.core.module.LamiTableEntry;
 import org.eclipse.tracecompass.internal.provisional.analysis.lami.ui.signals.LamiSelectionUpdateSignal;
 import org.eclipse.tracecompass.internal.provisional.analysis.lami.ui.views.LamiReportView;
+import org.eclipse.tracecompass.internal.provisional.analysis.lami.ui.views.LamiReportViewTabPage;
 import org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler;
 import org.eclipse.tracecompass.tmf.core.signal.TmfSignalManager;
 import org.eclipse.tracecompass.tmf.ui.viewers.table.TmfSimpleTableViewer;
@@ -47,7 +45,7 @@ public final class LamiTableViewer extends TmfSimpleTableViewer implements ILami
     // Attributes
     // ------------------------------------------------------------------------
 
-    private final LamiResultTable fResultTable;
+    private final LamiReportViewTabPage fPage;
     private Set<Integer> fSelections;
 
     // ------------------------------------------------------------------------
@@ -89,13 +87,13 @@ public final class LamiTableViewer extends TmfSimpleTableViewer implements ILami
 
             Set<Integer> selectionIndexes = new HashSet<>();
             for (Object selectedEntry : selections.toArray() ) {
-                selectionIndexes.add(fResultTable.getEntries().indexOf(selectedEntry));
+                selectionIndexes.add(fPage.getResultTable().getEntries().indexOf(selectedEntry));
             }
 
             fSelections = selectionIndexes;
 
             /* Signal all Lami viewers & views of the selection */
-            LamiSelectionUpdateSignal signal = new LamiSelectionUpdateSignal(LamiTableViewer.this, selectionIndexes, checkNotNull(fResultTable).hashCode());
+            LamiSelectionUpdateSignal signal = new LamiSelectionUpdateSignal(LamiTableViewer.this, selectionIndexes, fPage);
             TmfSignalManager.dispatchSignal(signal);
         }
     }
@@ -109,17 +107,17 @@ public final class LamiTableViewer extends TmfSimpleTableViewer implements ILami
      *
      * @param tableViewer
      *            Table viewer of the view
-     * @param resultTable
-     *            Data table populating this viewer
+     * @param page
+     *            The {@link LamiReportViewTabPage} parent page
      */
-    public LamiTableViewer(TableViewer tableViewer, LamiResultTable resultTable) {
+    public LamiTableViewer(TableViewer tableViewer, LamiReportViewTabPage page) {
         super(tableViewer);
         /*
          * The table viewer should always be the first element in the control.
          */
         tableViewer.getTable().moveAbove(null);
 
-        fResultTable = resultTable;
+        fPage = page;
         fSelections = new HashSet<>();
 
         /* Default sort order of the content provider is by its first column */
@@ -135,7 +133,7 @@ public final class LamiTableViewer extends TmfSimpleTableViewer implements ILami
     // ------------------------------------------------------------------------
 
     private void createColumns() {
-        final List<LamiTableEntryAspect> aspects = fResultTable.getTableClass().getAspects();
+        final List<LamiTableEntryAspect> aspects = fPage.getResultTable().getTableClass().getAspects();
 
         Display.getDefault().asyncExec(new Runnable() {
             @Override
@@ -165,14 +163,14 @@ public final class LamiTableViewer extends TmfSimpleTableViewer implements ILami
             tableViewer.setSelection(StructuredSelection.EMPTY);
 
             /* Fill the table data */
-            tableViewer.setInput(fResultTable.getEntries());
+            tableViewer.setInput(fPage.getResultTable().getEntries());
             LamiTableContentProvider latencyContentProvider = (LamiTableContentProvider) getTableViewer().getContentProvider();
             tableViewer.setItemCount(latencyContentProvider.getNbEntries());
 
             /* Set the column's alignment and pack them */
             TableColumn[] cols = tableViewer.getTable().getColumns();
             for (int i = 0; i < cols.length; i++) {
-                LamiTableEntryAspect colAspect = fResultTable.getTableClass().getAspects().get(i);
+                LamiTableEntryAspect colAspect = fPage.getResultTable().getTableClass().getAspects().get(i);
                 int alignment = (colAspect.isContinuous() ? SWT.RIGHT : SWT.LEFT);
                 cols[i].setAlignment(alignment);
 
@@ -186,7 +184,11 @@ public final class LamiTableViewer extends TmfSimpleTableViewer implements ILami
              * we have no guarantee of time of execution of the fill data.
              */
             if (!fSelections.isEmpty()) {
-                int[] selectionsIndexes = fSelections.stream().map(index -> fResultTable.getEntries().get(index)).mapToInt(entry -> ((LamiTableContentProvider) getTableViewer().getContentProvider()).getIndexOf(entry)).toArray();
+                int[] selectionsIndexes = fSelections.stream()
+                        .map(index -> fPage.getResultTable().getEntries().get(index))
+                        .mapToInt(entry -> ((LamiTableContentProvider) getTableViewer().getContentProvider()).getIndexOf(entry))
+                        .toArray();
+
                 Display.getDefault().asyncExec(() -> {
                     getTableViewer().getTable().setSelection(selectionsIndexes);
                     getTableViewer().getTable().redraw();
@@ -214,7 +216,7 @@ public final class LamiTableViewer extends TmfSimpleTableViewer implements ILami
     @TmfSignalHandler
     public void updateSelection(LamiSelectionUpdateSignal signal) {
 
-        if (fResultTable.hashCode() != signal.getSignalHash() || equals(signal.getSource())) {
+        if (fPage != signal.getSignalKey() || equals(signal.getSource())) {
             /* The signal is not for us */
             return;
          }
@@ -224,7 +226,7 @@ public final class LamiTableViewer extends TmfSimpleTableViewer implements ILami
         Set<Integer> selections = signal.getEntryIndex();
 
         int[] selectionsIndexes = selections.stream()
-                .map(index -> fResultTable.getEntries().get(index))
+                .map(index -> fPage.getResultTable().getEntries().get(index))
                 .mapToInt(entry -> latencyContentProvider.getIndexOf(entry))
                 .toArray();
 
index dbf5c313b8c48950b1d6c19c82e6c959877d4332..eb5d8fffb4b0ed6e0d9d5f48aa2ecb6a87f7af80 100644 (file)
@@ -47,6 +47,7 @@ import org.eclipse.tracecompass.internal.provisional.analysis.lami.core.module.L
 import org.eclipse.tracecompass.internal.provisional.analysis.lami.ui.format.LamiDecimalUnitFormat;
 import org.eclipse.tracecompass.internal.provisional.analysis.lami.ui.format.LamiTimeStampFormat;
 import org.eclipse.tracecompass.internal.provisional.analysis.lami.ui.signals.LamiSelectionUpdateSignal;
+import org.eclipse.tracecompass.internal.provisional.analysis.lami.ui.views.LamiReportViewTabPage;
 import org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler;
 import org.eclipse.tracecompass.tmf.ui.viewers.TmfViewer;
 import org.eclipse.ui.ISharedImages;
@@ -165,8 +166,8 @@ public abstract class LamiXYChartViewer extends TmfViewer implements ILamiViewer
         refreshDisplayLabels();
     };
 
-    private final LamiResultTable fResultTable;
     private final LamiChartModel fChartModel;
+    private final LamiReportViewTabPage fPage;
 
     private final Chart fChart;
 
@@ -188,17 +189,16 @@ public abstract class LamiXYChartViewer extends TmfViewer implements ILamiViewer
      *
      * @param parent
      *            The parent composite to draw in.
-     * @param resultTable
-     *            The result table containing the data from which to build the
-     *            chart
+     * @param page
+     *            The {@link LamiReportViewTabPage} parent page
      * @param chartModel
      *            The information about the chart to build
      */
-    public LamiXYChartViewer(Composite parent, LamiResultTable resultTable, LamiChartModel chartModel) {
+    public LamiXYChartViewer(Composite parent, LamiReportViewTabPage page, LamiChartModel chartModel) {
         super(parent);
 
         fParent = parent;
-        fResultTable = resultTable;
+        fPage = page;
         fChartModel = chartModel;
         fSelection = new HashSet<>();
 
@@ -209,7 +209,7 @@ public abstract class LamiXYChartViewer extends TmfViewer implements ILamiViewer
         fChart.addListener(SWT.Resize, fResizeListener);
 
         /* Set Chart title */
-        fChartTitle = fResultTable.getTableClass().getTableTitle();
+        fChartTitle = fPage.getResultTable().getTableClass().getTableTitle();
 
         /* Set X axis title */
         if (fChartModel.getXSeriesColumns().size() == 1) {
@@ -536,7 +536,16 @@ public abstract class LamiXYChartViewer extends TmfViewer implements ILamiViewer
      * @return The chart result table.
      */
     protected LamiResultTable getResultTable() {
-        return fResultTable;
+        return fPage.getResultTable();
+    }
+
+    /**
+     * Get the chart {@code LamiReportViewTabPage} parent.
+     *
+     * @return The {@code LamiReportViewTabPage} parent.
+     */
+    protected LamiReportViewTabPage getPage() {
+        return fPage;
     }
 
     /**
@@ -752,7 +761,7 @@ public abstract class LamiXYChartViewer extends TmfViewer implements ILamiViewer
      */
     @TmfSignalHandler
     public void updateSelection(LamiSelectionUpdateSignal signal) {
-        if (getResultTable().hashCode() != signal.getSignalHash() || equals(signal.getSource())) {
+        if (getPage() != signal.getSignalKey() || equals(signal.getSource())) {
             /* The signal is not for us */
             return;
         }
index 19c29aedb0a5e06e1b205731f416c8bfa9bb51fc..e9e8781ada7abe97f93e127b5df369f1d912c70d 100644 (file)
@@ -91,14 +91,14 @@ public final class LamiReportViewTabPage extends TmfComponent {
         fControl = parent;
 
         /* Prepare the table viewer, which is always present */
-        LamiViewerControl tableViewerControl = new LamiViewerControl(fControl, fResultTable);
+        LamiViewerControl tableViewerControl = new LamiViewerControl(fControl, this);
         fTableViewerControl = tableViewerControl;
 
         /* Automatically open the table viewer initially */
         tableViewerControl.getToggleAction().run();
 
         /* Simulate a new external signal to the default viewer */
-        LamiSelectionUpdateSignal signal = new LamiSelectionUpdateSignal(LamiReportViewTabPage.this, fSelectionIndexes, checkNotNull(fResultTable).hashCode());
+        LamiSelectionUpdateSignal signal = new LamiSelectionUpdateSignal(LamiReportViewTabPage.this, fSelectionIndexes, this);
         TmfSignalManager.dispatchSignal(signal);
 
         fControl.addDisposeListener(e -> {
@@ -312,13 +312,13 @@ public final class LamiReportViewTabPage extends TmfComponent {
                 isXLogScale,
                 isYLogScale);
 
-        LamiViewerControl viewerControl = new LamiViewerControl(fControl, fResultTable, model);
+        LamiViewerControl viewerControl = new LamiViewerControl(fControl, this, model);
         fCustomGraphViewerControls.add(viewerControl);
         viewerControl.getToggleAction().run();
 
         /* Signal the current selection to the newly created graph */
         LamiSelectionUpdateSignal signal = new LamiSelectionUpdateSignal(LamiReportViewTabPage.this,
-                fSelectionIndexes, checkNotNull(fResultTable).hashCode());
+                fSelectionIndexes, this);
         TmfSignalManager.dispatchSignal(signal);
     }
 
@@ -338,12 +338,12 @@ public final class LamiReportViewTabPage extends TmfComponent {
         LamiResultTable table = fResultTable;
         Object source = signal.getSource();
 
-        if (table.hashCode() != signal.getSignalHash() ||
-                source == this ||
-                /*
-                 * Don't forward signals from other tab pages, especially those
-                 * from other views.
-                 */
+        /*
+         * Don't forward signals from other tab pages, especially those
+         * from other views/tab page.
+         */
+        if (this != signal.getSignalKey() ||
+                this == source ||
                 source instanceof LamiReportViewTabPage) {
             /* The signal is not for us */
             return;
@@ -405,7 +405,7 @@ public final class LamiReportViewTabPage extends TmfComponent {
         Set<Integer> selections = getIndexOfEntriesIntersectingTimerange(table, range);
 
         /* Update all LamiViewer */
-        LamiSelectionUpdateSignal signal1 = new LamiSelectionUpdateSignal(LamiReportViewTabPage.this, selections, table.hashCode());
+        LamiSelectionUpdateSignal signal1 = new LamiSelectionUpdateSignal(LamiReportViewTabPage.this, selections, this);
         TmfSignalManager.dispatchSignal(signal1);
     }
 
index 2ff51df9c5deb1189401354123cb1ab23150efdd..379b4b41c6e96825f3c7fa604a971ca251570f30 100644 (file)
@@ -15,7 +15,6 @@ import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.tracecompass.internal.analysis.lami.ui.Activator;
 import org.eclipse.tracecompass.internal.provisional.analysis.lami.core.module.LamiChartModel;
-import org.eclipse.tracecompass.internal.provisional.analysis.lami.core.module.LamiResultTable;
 import org.eclipse.tracecompass.internal.provisional.analysis.lami.ui.viewers.ILamiViewer;
 
 /**
@@ -37,16 +36,16 @@ public final class LamiViewerControl {
      *
      * @param parent
      *            The parent composite
-     * @param table
-     *            The results table populating the table viewer
+     * @param page
+     *            The {@link LamiReportViewTabPage} page parent
      */
-    public LamiViewerControl(Composite parent, LamiResultTable table) {
+    public LamiViewerControl(Composite parent, LamiReportViewTabPage page) {
         fToggleAction = new Action() {
             @Override
             public void run() {
                 ILamiViewer viewer = fViewer;
                 if (viewer == null) {
-                    fViewer = ILamiViewer.createLamiTable(parent, table);
+                    fViewer = ILamiViewer.createLamiTable(parent, page);
                 } else {
                     viewer.dispose();
                     fViewer = null;
@@ -64,18 +63,18 @@ public final class LamiViewerControl {
      *
      * @param parent
      *            The parent composite
-     * @param table
-     *            The table containing the source data
+     * @param page
+     *            The {@link LamiReportViewTabPage} parent page
      * @param graphModel
      *            The graph model
      */
-    public LamiViewerControl(Composite parent, LamiResultTable table, LamiChartModel graphModel) {
+    public LamiViewerControl(Composite parent, LamiReportViewTabPage page, LamiChartModel graphModel) {
         fToggleAction = new Action() {
             @Override
             public void run() {
                 ILamiViewer viewer = fViewer;
                 if (viewer == null) {
-                    fViewer = ILamiViewer.createLamiChart(parent, table, graphModel);
+                    fViewer = ILamiViewer.createLamiChart(parent, page, graphModel);
                 } else {
                     viewer.dispose();
                     fViewer = null;
This page took 0.035528 seconds and 5 git commands to generate.