Fix for column width problem in Linux
authorBernd Hufmann <bhufmann@gmail.com>
Thu, 29 Nov 2012 16:49:00 +0000 (11:49 -0500)
committerBernd Hufmann <bhufmann@gmail.com>
Thu, 29 Nov 2012 20:29:13 +0000 (15:29 -0500)
Change-Id: Ib439b88740fd8585fa32a8ebaf263bb41c031817
Reviewed-on: https://git.eclipse.org/r/8933
Tested-by: Hudson CI
Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com>
IP-Clean: Patrick Tasse <patrick.tasse@gmail.com>

org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/events/TmfEventsTable.java

index 46ec27f874e3dd1b114c55e0f4f0cd8251279654..9d852e75d074901672c83b9ddc7afbfe287813cb 100644 (file)
@@ -1093,8 +1093,8 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
      * @since 1.1
      */
     protected void applyFilter(ITmfFilter filter) {
-       stopFilterThread();
-       stopSearchThread();
+        stopFilterThread();
+        stopSearchThread();
         fFilterMatchCount = 0;
         fFilterCheckCount = 0;
         fCache.applyFilter(filter);
@@ -1465,9 +1465,20 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
         if (fPackDone) {
             return;
         }
-        for (final TableColumn column : fTable.getColumns()) {
+        boolean isLinux = System.getProperty("os.name").contains("Linux") ? true : false; //$NON-NLS-1$ //$NON-NLS-2$
+
+        TableColumn tableColumns[] = fTable.getColumns();
+        for (int i = 0; i < tableColumns.length; i++) {
+            final TableColumn column = tableColumns[i];
             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.
+            if (isLinux && (i == 0)) {
+                column.setWidth(column.getWidth() + SEARCH_IMAGE.getBounds().width);
+            }
+
             if (column.getWidth() < headerWidth) {
                 column.setWidth(headerWidth);
             }
This page took 0.029025 seconds and 5 git commands to generate.