tmf.ui: reflow events table
authorMatthew Khouzam <matthew.khouzam@ericsson.com>
Thu, 7 May 2015 14:16:02 +0000 (10:16 -0400)
committerMatthew Khouzam <matthew.khouzam@ericsson.com>
Thu, 7 May 2015 17:51:05 +0000 (13:51 -0400)
Change-Id: Ia36fd20caa4f1f38d34de2299f1a58dbe537b639
Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/47448
Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com>
Tested-by: Patrick Tasse <patrick.tasse@gmail.com>
org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/events/TmfEventsTable.java

index 22f09e869c66b294f68c82cd62e28ab8b4f78952..3134d62f64023855558d497300f88754cf3a3884 100644 (file)
@@ -203,8 +203,7 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
             "icons/elcl16/search_match.gif"); //$NON-NLS-1$
     private static final Image SEARCH_MATCH_BOOKMARK_IMAGE = Activator.getDefault().getImageFromPath(
             "icons/elcl16/search_match_bookmark.gif"); //$NON-NLS-1$
-    private static final Image FILTER_IMAGE = Activator.getDefault()
-            .getImageFromPath("icons/elcl16/filter_items.gif"); //$NON-NLS-1$
+    private static final Image FILTER_IMAGE = Activator.getDefault().getImageFromPath("icons/elcl16/filter_items.gif"); //$NON-NLS-1$
     private static final Image STOP_IMAGE = Activator.getDefault().getImageFromPath("icons/elcl16/stop.gif"); //$NON-NLS-1$
     private static final String SEARCH_HINT = Messages.TmfEventsTable_SearchHint;
     private static final String FILTER_HINT = Messages.TmfEventsTable_FilterHint;
@@ -245,8 +244,11 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
         /** Event aspect represented by this column */
         String ASPECT = "$aspect"; //$NON-NLS-1$
 
-        /** Table item list of style ranges
-         * @since 1.0*/
+        /**
+         * Table item list of style ranges
+         *
+         * @since 1.0
+         */
         String STYLE_RANGES = "$style_ranges"; //$NON-NLS-1$
     }
 
@@ -296,7 +298,8 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
     private final Object fSearchSyncObj = new Object();
 
     /**
-     * List of selection change listeners (element type: <code>ISelectionChangedListener</code>).
+     * List of selection change listeners (element type:
+     * <code>ISelectionChangedListener</code>).
      *
      * @see #fireSelectionChanged
      */
@@ -362,8 +365,8 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
             final org.eclipse.tracecompass.tmf.ui.widgets.virtualtable.ColumnData[] columnData) {
         /*
          * We'll do a "best-effort" to keep trace types still using this API to
-         * keep working, by defining a TmfEventTableColumn for each
-         * ColumnData they passed.
+         * keep working, by defining a TmfEventTableColumn for each ColumnData
+         * they passed.
          */
         this(parent, cacheSize, convertFromColumnData(columnData));
     }
@@ -447,8 +450,8 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
             }
             column.addControlListener(new ControlAdapter() {
                 /*
-                 * Make sure that the margin column is always first
-                 * and keep the column order variable up to date.
+                 * Make sure that the margin column is always first and keep the
+                 * column order variable up to date.
                  */
                 @Override
                 public void controlMoved(ControlEvent e) {
@@ -544,7 +547,8 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
                         setFilterStatusRowItemData(item);
                         return;
                     }
-                    index = index - 1; // -1 for top filter status row
+                    /* -1 for top filter status row */
+                    index = index - 1;
                 }
 
                 final CachedEvent cachedEvent = fCache.getEvent(index);
@@ -580,70 +584,73 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
             }
         });
 
-        final Listener tooltipListener = new Listener () {
+        final Listener tooltipListener = new Listener() {
             Shell tooltipShell = null;
+
             @Override
             public void handleEvent(final Event event) {
                 switch (event.type) {
-                    case SWT.MouseHover:
-                        final TableItem item = fTable.getItem(new Point(event.x, event.y));
-                        if (item == null) {
-                            return;
-                        }
-                        final Long rank = (Long) item.getData(Key.RANK);
-                        if (rank == null) {
-                            return;
-                        }
-                        final String tooltipText = (String) item.getData(Key.BOOKMARK);
-                        final Rectangle bounds = item.getImageBounds(0);
-                        bounds.width = BOOKMARK_IMAGE.getBounds().width;
-                        if (!bounds.contains(event.x,event.y)) {
-                            return;
-                        }
-                        if ((tooltipShell != null) && !tooltipShell.isDisposed()) {
-                            tooltipShell.dispose();
-                        }
-                        tooltipShell = new Shell(fTable.getShell(), SWT.ON_TOP | SWT.NO_FOCUS | SWT.TOOL);
-                        tooltipShell.setBackground(PlatformUI.getWorkbench().getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
-                        final FillLayout layout = new FillLayout();
-                        layout.marginWidth = 2;
-                        tooltipShell.setLayout(layout);
-                        final Label label = new Label(tooltipShell, SWT.WRAP);
-                        String text = rank.toString() + (tooltipText != null ? ": " + tooltipText : EMPTY_STRING); //$NON-NLS-1$
-                        label.setForeground(PlatformUI.getWorkbench().getDisplay().getSystemColor(SWT.COLOR_INFO_FOREGROUND));
-                        label.setBackground(PlatformUI.getWorkbench().getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
-                        label.setText(text);
-                        label.addListener(SWT.MouseExit, this);
-                        label.addListener(SWT.MouseDown, this);
-                        label.addListener(SWT.MouseWheel, this);
-                        final Point size = tooltipShell.computeSize(SWT.DEFAULT, SWT.DEFAULT);
-                        /*
-                         * Bug in Linux.  The coordinates of the event have an origin that excludes the table header but
-                         * the method toDisplay() expects coordinates relative to an origin that includes the table header.
-                         */
-                        int y = event.y;
-                        if (IS_LINUX) {
-                            y += fTable.getHeaderHeight();
-                        }
-                        Point pt = fTable.toDisplay(event.x, y);
-                        pt.x += BOOKMARK_IMAGE.getBounds().width;
-                        pt.y += item.getBounds().height;
-                        tooltipShell.setBounds(pt.x, pt.y, size.x, size.y);
-                        tooltipShell.setVisible(true);
-                        break;
-                    case SWT.Dispose:
-                    case SWT.KeyDown:
-                    case SWT.MouseMove:
-                    case SWT.MouseExit:
-                    case SWT.MouseDown:
-                    case SWT.MouseWheel:
-                        if (tooltipShell != null) {
-                            tooltipShell.dispose();
-                            tooltipShell = null;
-                        }
-                        break;
-                    default:
-                        break;
+                case SWT.MouseHover:
+                    final TableItem item = fTable.getItem(new Point(event.x, event.y));
+                    if (item == null) {
+                        return;
+                    }
+                    final Long rank = (Long) item.getData(Key.RANK);
+                    if (rank == null) {
+                        return;
+                    }
+                    final String tooltipText = (String) item.getData(Key.BOOKMARK);
+                    final Rectangle bounds = item.getImageBounds(0);
+                    bounds.width = BOOKMARK_IMAGE.getBounds().width;
+                    if (!bounds.contains(event.x, event.y)) {
+                        return;
+                    }
+                    if ((tooltipShell != null) && !tooltipShell.isDisposed()) {
+                        tooltipShell.dispose();
+                    }
+                    tooltipShell = new Shell(fTable.getShell(), SWT.ON_TOP | SWT.NO_FOCUS | SWT.TOOL);
+                    tooltipShell.setBackground(PlatformUI.getWorkbench().getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
+                    final FillLayout layout = new FillLayout();
+                    layout.marginWidth = 2;
+                    tooltipShell.setLayout(layout);
+                    final Label label = new Label(tooltipShell, SWT.WRAP);
+                    String text = rank.toString() + (tooltipText != null ? ": " + tooltipText : EMPTY_STRING); //$NON-NLS-1$
+                    label.setForeground(PlatformUI.getWorkbench().getDisplay().getSystemColor(SWT.COLOR_INFO_FOREGROUND));
+                    label.setBackground(PlatformUI.getWorkbench().getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
+                    label.setText(text);
+                    label.addListener(SWT.MouseExit, this);
+                    label.addListener(SWT.MouseDown, this);
+                    label.addListener(SWT.MouseWheel, this);
+                    final Point size = tooltipShell.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+                    /*
+                     * Bug in Linux. The coordinates of the event have an origin
+                     * that excludes the table header but the method toDisplay()
+                     * expects coordinates relative to an origin that includes
+                     * the table header.
+                     */
+                    int y = event.y;
+                    if (IS_LINUX) {
+                        y += fTable.getHeaderHeight();
+                    }
+                    Point pt = fTable.toDisplay(event.x, y);
+                    pt.x += BOOKMARK_IMAGE.getBounds().width;
+                    pt.y += item.getBounds().height;
+                    tooltipShell.setBounds(pt.x, pt.y, size.x, size.y);
+                    tooltipShell.setVisible(true);
+                    break;
+                case SWT.Dispose:
+                case SWT.KeyDown:
+                case SWT.MouseMove:
+                case SWT.MouseExit:
+                case SWT.MouseDown:
+                case SWT.MouseWheel:
+                    if (tooltipShell != null) {
+                        tooltipShell.dispose();
+                        tooltipShell = null;
+                    }
+                    break;
+                default:
+                    break;
                 }
             }
         };
@@ -683,9 +690,10 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
                 }
 
                 /*
-                 * We will paint the table item's foreground. In Windows, if you paint
-                 * the background but let the widget draw the foreground, it will
-                 * override your background, unless the item is selected or hot.
+                 * We will paint the table item's foreground. In Windows, if you
+                 * paint the background but let the widget draw the foreground,
+                 * it will override your background, unless the item is selected
+                 * or hot.
                  */
                 event.detail &= ~SWT.FOREGROUND;
 
@@ -764,16 +772,22 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
                     final long rank = (Long) e.data;
                     int index = (int) rank;
                     if (fTable.getData(Key.FILTER_OBJ) != null) {
-                        index = fCache.getFilteredEventIndex(rank) + 1; // +1 for top filter status row
+                        // +1 for top filter status row
+                        index = fCache.getFilteredEventIndex(rank) + 1;
                     }
-                    fTable.setSelection(index + 1); // +1 for header row
+                    // +1 for header row
+                    fTable.setSelection(index + 1);
                     fSelectedRank = rank;
                     updateStatusLine(null);
                 } else if (e.data instanceof ITmfLocation) {
-                    // DOES NOT WORK: rank undefined in context from seekLocation()
-                    // ITmfLocation<?> location = (ITmfLocation<?>) e.data;
-                    // TmfContext context = fTrace.seekLocation(location);
-                    // fTable.setSelection((int) context.getRank());
+                    /**
+                     * DOES NOT WORK: rank undefined in context from
+                     * seekLocation() <code>
+                     * ITmfLocation<?> location = (ITmfLocation<?>) e.data;
+                     * TmfContext context = fTrace.seekLocation(location);
+                     * fTable.setSelection((int) context.getRank());
+                     *  </code>
+                     */
                     return;
                 } else {
                     return;
@@ -901,7 +915,7 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
                             marker.setAttribute(IMarker.LINE_NUMBER, Long.valueOf(cs.getLineNumber()).intValue());
                             IDE.openEditor(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(), marker);
                             marker.delete();
-                        } else if (files.size() == 0){
+                        } else if (files.size() == 0) {
                             displayException(new FileNotFoundException('\'' + cs.toString() + '\'' + '\n' + Messages.TmfEventsTable_OpenSourceCodeNotFound));
                         }
                     } catch (CoreException e) {
@@ -952,8 +966,7 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
 
                                 IDE.openEditor(activePage, marker, OpenStrategy.activateOnOpen());
                                 marker.delete();
-                            }
-                            catch (CoreException e) {
+                            } catch (CoreException e) {
                                 displayException(e);
                             }
                         } else {
@@ -1111,11 +1124,14 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
                     }
                 }
 
-                // only show collapse filter if at least one trace can be collapsed
+                /*
+                 * Only show collapse filter if at least one trace can be
+                 * collapsed.
+                 */
                 boolean isCollapsible = false;
                 if (fTrace != null) {
                     for (ITmfTrace trace : TmfTraceManager.getTraceSet(fTrace)) {
-                        Class <? extends ITmfEvent> eventClass = trace.getEventType();
+                        Class<? extends ITmfEvent> eventClass = trace.getEventType();
                         isCollapsible = ITmfCollapsibleEvent.class.isAssignableFrom(eventClass);
                         if (isCollapsible) {
                             break;
@@ -1173,7 +1189,6 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
         fRawViewer.setMenu(menu);
     }
 
-
     /**
      * Append an item to the event table's pop-up menu.
      *
@@ -1237,7 +1252,7 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
      *             shouldn't be called anymore.
      */
     @Deprecated
-    protected void setColumnHeaders(final org.eclipse.tracecompass.tmf.ui.widgets.virtualtable.ColumnData [] columnData) {
+    protected void setColumnHeaders(final org.eclipse.tracecompass.tmf.ui.widgets.virtualtable.ColumnData[] columnData) {
         /* No-op */
     }
 
@@ -1488,7 +1503,10 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
                         txtKey = Key.FILTER_TXT;
                     }
 
-                    // The control that will be the editor must be a child of the Table
+                    /*
+                     * The control that will be the editor must be a child of
+                     * the Table
+                     */
                     final Text newEditor = (Text) fTable.createTableEditorControl(Text.class);
                     final String headerString = (String) column.getData(txtKey);
                     if (headerString != null) {
@@ -1510,7 +1528,10 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
                                 updateHeader(newEditor.getText());
                                 applyHeader();
 
-                                // Set focus on the table so that the next carriage return goes to the next result
+                                /*
+                                 * Set focus on the table so that the next
+                                 * carriage return goes to the next result
+                                 */
                                 TmfEventsTable.this.getTable().setFocus();
                             } else if (e.character == SWT.ESC) {
                                 tableEditor.getEditor().dispose();
@@ -1703,7 +1724,8 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
         fCache.applyFilter(filter);
         fTable.clearAll();
         fTable.setData(Key.FILTER_OBJ, filter);
-        fTable.setItemCount(3); // +1 for header row, +2 for top and bottom filter status rows
+        /* +1 for header row, +2 for top and bottom filter status rows */
+        fTable.setItemCount(3);
         startFilterThread();
         fireFilterApplied(filter);
     }
@@ -1725,14 +1747,17 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
         }
         fTable.setData(Key.FILTER_OBJ, null);
         if (fTrace != null) {
-            fTable.setItemCount((int) fTrace.getNbEvents() + 1); // +1 for header row
+            /* +1 for header row */
+            fTable.setItemCount((int) fTrace.getNbEvents() + 1);
         } else {
-            fTable.setItemCount(1); // +1 for header row
+            /* +1 for header row */
+            fTable.setItemCount(1);
         }
         fFilterMatchCount = 0;
         fFilterCheckCount = 0;
         if (fSelectedRank >= 0) {
-            fTable.setSelection((int) fSelectedRank + 1); // +1 for header row
+            /* +1 for header row */
+            fTable.setSelection((int) fSelectedRank + 1);
         } else {
             fTable.setSelection(0);
         }
@@ -1837,7 +1862,11 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
                     if (fTable.isDisposed()) {
                         return;
                     }
-                    fTable.setItemCount((int) fFilterMatchCount + 3); // +1 for header row, +2 for top and bottom filter status rows
+                    /*
+                     * +1 for header row, +2 for top and bottom filter status
+                     * rows
+                     */
+                    fTable.setItemCount((int) fFilterMatchCount + 3);
                     fTable.refresh();
                     synchronized (syncObj) {
                         refreshBusy = false;
@@ -1875,14 +1904,19 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
             final int selectionIndex = fTable.getSelectionIndex();
             int startIndex;
             if (selectionIndex > 0) {
-                startIndex = selectionIndex; // -1 for header row, +1 for next event
+                /* -1 for header row, +1 for next event */
+                startIndex = selectionIndex;
             } else {
-                // header row is selected, start at top event
-                startIndex = Math.max(0, fTable.getTopIndex() - 1); // -1 for header row
+                /*
+                 * header row is selected, start at top event
+                 */
+                /* -1 for header row */
+                startIndex = Math.max(0, fTable.getTopIndex() - 1);
             }
             final ITmfFilterTreeNode eventFilter = (ITmfFilterTreeNode) fTable.getData(Key.FILTER_OBJ);
             if (eventFilter != null) {
-                startIndex = Math.max(0, startIndex - 1); // -1 for top filter status row
+                // -1 for top filter status row
+                startIndex = Math.max(0, startIndex - 1);
             }
             fSearchThread = new SearchThread(searchFilter, eventFilter, startIndex, fSelectedRank, Direction.FORWARD);
             fSearchThread.schedule();
@@ -1904,14 +1938,19 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
             final int selectionIndex = fTable.getSelectionIndex();
             int startIndex;
             if (selectionIndex > 0) {
-                startIndex = selectionIndex - 2; // -1 for header row, -1 for previous event
+                /* -1 for header row, -1 for previous event */
+                startIndex = selectionIndex - 2;
             } else {
-                // header row is selected, start at precedent of top event
-                startIndex = fTable.getTopIndex() - 2; // -1 for header row, -1 for previous event
+                /*
+                 * Header row is selected, start at precedent of top event
+                 */
+                /* -1 for header row, -1 for previous event */
+                startIndex = fTable.getTopIndex() - 2;
             }
             final ITmfFilterTreeNode eventFilter = (ITmfFilterTreeNode) fTable.getData(Key.FILTER_OBJ);
             if (eventFilter != null) {
-                startIndex = startIndex - 1; // -1 for top filter status row
+                /* -1 for top filter status row */
+                startIndex = startIndex - 1;
             }
             fSearchThread = new SearchThread(searchFilter, eventFilter, startIndex, fSelectedRank, Direction.BACKWARD);
             fSearchThread.schedule();
@@ -1978,7 +2017,11 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
             final Display display = Display.getDefault();
             if (startIndex < 0) {
                 rank = (int) fTrace.getNbEvents() - 1;
-            } else if (startIndex >= (fTable.getItemCount() - (eventFilter == null ? 1 : 3))) { // -1 for header row, -2 for top and bottom filter status rows
+                /*
+                 * -1 for header row, -3 for header and top and bottom filter
+                 * status rows
+                 */
+            } else if (startIndex >= (fTable.getItemCount() - (eventFilter == null ? 1 : 3))) {
                 rank = 0;
             } else {
                 int idx = startIndex;
@@ -2080,7 +2123,8 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
             if (eventFilter != null) {
                 index = fCache.getFilteredEventIndex(foundRank);
             }
-            final int selection = index + 1 + (eventFilter != null ? +1 : 0); // +1 for header row, +1 for top filter status row
+            /* +1 for header row, +1 for top filter status row */
+            final int selection = index + 1 + (eventFilter != null ? +1 : 0);
 
             display.asyncExec(new Runnable() {
                 @Override
@@ -2120,8 +2164,7 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
      * Create the resources.
      */
     private void createResources() {
-        fGrayColor = fResourceManager.createColor(ColorUtil.blend(fTable.getBackground().getRGB(), fTable
-                .getForeground().getRGB()));
+        fGrayColor = fResourceManager.createColor(ColorUtil.blend(fTable.getBackground().getRGB(), fTable.getForeground().getRGB()));
         fGreenColor = fTable.getDisplay().getSystemColor(SWT.COLOR_DARK_GREEN);
     }
 
@@ -2182,7 +2225,6 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
         fPackDone = true;
     }
 
-
     private void packMarginColumn() {
         TableColumn[] columns = fTable.getColumns();
         if (columns.length > 0) {
@@ -2193,9 +2235,11 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
     private void packSingleColumn(int i, final TableColumn column) {
         final int headerWidth = column.getWidth();
         column.pack();
-        // Workaround for Linux which doesn't consider the image width of
-        // search/filter row in TableColumn.pack() after having executed
-        // TableItem.setImage((Image)null) for other rows than search/filter row.
+        /*
+         * Workaround for Linux which doesn't consider the image width of
+         * search/filter row in TableColumn.pack() after having executed
+         * TableItem.setImage(null) for other rows than search/filter row.
+         */
         boolean isCollapseFilter = fTable.getData(Key.FILTER_OBJ) instanceof TmfCollapseFilter;
         if (IS_LINUX && (i == 0) && isCollapseFilter) {
             column.setWidth(column.getWidth() + SEARCH_IMAGE.getBounds().width);
@@ -2227,8 +2271,10 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
             for (TmfEventTableColumn column : columns) {
                 ITmfEvent passedEvent = event;
                 if (!(column instanceof TmfMarginColumn) && (event instanceof CachedEvent)) {
-                    // Make sure that the event object from the trace is passed
-                    // to all columns but the TmfMarginColumn
+                    /*
+                     * Make sure that the event object from the trace is passed
+                     * to all columns but the TmfMarginColumn
+                     */
                     passedEvent = ((CachedEvent) event).event;
                 }
                 if (passedEvent == null) {
@@ -2260,13 +2306,13 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
     }
 
     /**
-     * Returns an array of zero-relative integers that map
-     * the creation order of the receiver's columns to the
-     * order in which they are currently being displayed.
+     * Returns an array of zero-relative integers that map the creation order of
+     * the receiver's columns to the order in which they are currently being
+     * displayed.
      * <p>
-     * Specifically, the indices of the returned array represent
-     * the current visual order of the columns, and the contents
-     * of the array represent the creation order of the columns.
+     * Specifically, the indices of the returned array represent the current
+     * visual order of the columns, and the contents of the array represent the
+     * creation order of the columns.
      *
      * @return the current visual order of the receiver's columns
      * @since 1.0
@@ -2276,15 +2322,15 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
     }
 
     /**
-     * Sets the order that the columns in the receiver should
-     * be displayed in to the given argument which is described
-     * in terms of the zero-relative ordering of when the columns
-     * were added.
+     * Sets the order that the columns in the receiver should be displayed in to
+     * the given argument which is described in terms of the zero-relative
+     * ordering of when the columns were added.
      * <p>
-     * Specifically, the contents of the array represent the
-     * original position of each column at the time its creation.
+     * Specifically, the contents of the array represent the original position
+     * of each column at the time its creation.
      *
-     * @param order the new order to display the columns
+     * @param order
+     *            the new order to display the columns
      * @since 1.0
      */
     public void setColumnOrder(int[] order) {
@@ -2329,12 +2375,17 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
                 if (fTrace != null) {
                     if (!fTable.isDisposed() && (fTrace != null)) {
                         if (fTable.getData(Key.FILTER_OBJ) == null) {
-                            fTable.setItemCount((int) fTrace.getNbEvents() + 1); // +1 for header row
+                            // +1 for header row
+                            fTable.setItemCount((int) fTrace.getNbEvents() + 1);
                         } else {
                             stopFilterThread();
                             fFilterMatchCount = 0;
                             fFilterCheckCount = 0;
-                            fTable.setItemCount(3); // +1 for header row, +2 for top and bottom filter status rows
+                            /*
+                             * +1 for header row, +2 for top and bottom filter
+                             * status rows
+                             */
+                            fTable.setItemCount(3);
                             startFilterThread();
                         }
                     }
@@ -2348,7 +2399,8 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
      * Assign the status line manager
      *
      * @param statusLineManager
-     *            The status line manager, or null to disable status line messages
+     *            The status line manager, or null to disable status line
+     *            messages
      */
     public void setStatusLineManager(IStatusLineManager statusLineManager) {
         if (fStatusLineManager != null && statusLineManager == null) {
@@ -2452,10 +2504,12 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
     }
 
     /**
-     * Notifies any selection changed listeners that the viewer's selection has changed.
-     * Only listeners registered at the time this method is called are notified.
+     * Notifies any selection changed listeners that the viewer's selection has
+     * changed. Only listeners registered at the time this method is called are
+     * notified.
      *
-     * @param event a selection changed event
+     * @param event
+     *            a selection changed event
      *
      * @see ISelectionChangedListener#selectionChanged
      */
@@ -2594,7 +2648,8 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
         if (rank != -1) {
             int index = rank;
             if (fTable.getData(Key.FILTER_OBJ) != null) {
-                index = fCache.getFilteredEventIndex(rank) + 1; // +1 for top filter status row
+                // +1 for top filter status row
+                index = fCache.getFilteredEventIndex(rank) + 1;
             } else if (rank >= fTable.getItemCount()) {
                 fPendingGotoRank = rank;
             }
@@ -2634,9 +2689,12 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
             public void run() {
                 if (!fTable.isDisposed() && (fTrace != null)) {
                     if (fTable.getData(Key.FILTER_OBJ) == null) {
-                        fTable.setItemCount((int) fTrace.getNbEvents() + 1); // +1 for header row
-                        if ((fPendingGotoRank != -1) && ((fPendingGotoRank + 1) < fTable.getItemCount())) { // +1 for header row
-                            fTable.setSelection((int) fPendingGotoRank + 1); // +1 for header row
+                        /* +1 for header row */
+                        fTable.setItemCount((int) fTrace.getNbEvents() + 1);
+                        /* +1 for header row */
+                        if ((fPendingGotoRank != -1) && ((fPendingGotoRank + 1) < fTable.getItemCount())) {
+                            /* +1 for header row */
+                            fTable.setSelection((int) fPendingGotoRank + 1);
                             fPendingGotoRank = -1;
                             updateStatusLine(null);
                         }
@@ -2662,9 +2720,13 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
     public void selectionRangeUpdated(final TmfSelectionRangeUpdatedSignal signal) {
         if ((signal.getSource() != this) && (fTrace != null) && (!fTable.isDisposed())) {
 
-            // Create a request for one event that will be queued after other ongoing requests. When this request is completed
-            // do the work to select the actual event with the timestamp specified in the signal. This procedure prevents
-            // the method fTrace.getRank() from interfering and delaying ongoing requests.
+            /*
+             * Create a request for one event that will be queued after other
+             * ongoing requests. When this request is completed do the work to
+             * select the actual event with the timestamp specified in the
+             * signal. This procedure prevents the method fTrace.getRank() from
+             * interfering and delaying ongoing requests.
+             */
             final TmfEventRequest subRequest = new TmfEventRequest(ITmfEvent.class,
                     TmfTimeRange.ETERNITY, 0, 1, ExecutionType.FOREGROUND) {
 
@@ -2682,7 +2744,10 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
                         return;
                     }
 
-                    // Verify if the event is within the trace range and adjust if necessary
+                    /*
+                     * Verify if the event is within the trace range and adjust
+                     * if necessary
+                     */
                     ITmfTimestamp timestamp = ts;
                     if (timestamp.compareTo(fTrace.getStartTime()) == -1) {
                         timestamp = fTrace.getStartTime();
@@ -2710,9 +2775,11 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
                                 return;
                             }
                             if (fTable.getData(Key.FILTER_OBJ) != null) {
-                                index = fCache.getFilteredEventIndex(rank) + 1; // +1 for top filter status row
+                                /* +1 for top filter status row */
+                                index = fCache.getFilteredEventIndex(rank) + 1;
                             }
-                            fTable.setSelection(index + 1); // +1 for header row
+                            /* +1 for header row */
+                            fTable.setSelection(index + 1);
                             fRawViewer.selectAndReveal(rank);
                             updateStatusLine(null);
                         }
@@ -2731,7 +2798,8 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
     /**
      * Display an exception in a message box
      *
-     * @param e the exception
+     * @param e
+     *            the exception
      */
     private static void displayException(final Exception e) {
         final MessageBox mb = new MessageBox(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
This page took 0.044134 seconds and 5 git commands to generate.