tmf: Do not expose TmfEventTableColumn in TmfVirtualTable
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / tmf / ui / widgets / virtualtable / TmfVirtualTable.java
index 94800631e9183209f9d6f067868880fb34084eac..7dd7dec1696058951b2959bef809847355822832 100644 (file)
 
 package org.eclipse.linuxtools.tmf.ui.widgets.virtualtable;
 
-import java.util.List;
-
 import org.eclipse.linuxtools.internal.tmf.ui.Activator;
-import org.eclipse.linuxtools.tmf.ui.viewers.events.TmfEventsTable.Key;
-import org.eclipse.linuxtools.tmf.ui.viewers.events.columns.TmfEventTableColumn;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.SWTException;
 import org.eclipse.swt.custom.TableEditor;
@@ -618,6 +614,35 @@ public class TmfVirtualTable extends Composite {
     // Simulated Table API
     // ------------------------------------------------------------------------
 
+    /**
+     * Constructs a new TableColumn instance given a style value describing its
+     * alignment behavior. The column is added to the end of the columns
+     * maintained by the table.
+     *
+     * @param style
+     *            the alignment style
+     * @return the new TableColumn
+     *
+     * @see SWT#LEFT
+     * @see SWT#RIGHT
+     * @see SWT#CENTER
+     *
+     * @since 3.1
+     */
+    public TableColumn newTableColumn(int style) {
+        TableColumn column = new TableColumn(fTable, style);
+
+        /*
+         * In Linux the table does not receive a control resized event when
+         * a table column resize causes the horizontal scroll bar to become
+         * visible or invisible, so a resize listener must be added to every
+         * table column to properly update the number of fully visible rows.
+         */
+        column.addControlListener(fResizeListener);
+
+        return column;
+    }
+
     /**
      * Method setHeaderVisible.
      * @param b boolean
@@ -906,41 +931,6 @@ public class TmfVirtualTable extends Composite {
         /* No-op */
     }
 
-    /**
-     * Method setColumnHeaders.
-     *
-     * @param columns
-     *            The configuration elements of every column, in the order they
-     *            should be initially in the table.
-     * @since 3.1
-     */
-    public void createColumns(List<TmfEventTableColumn> columns) {
-        for (TmfEventTableColumn column : columns) {
-
-            /* Set the column's header and properties */
-            TableColumn tableCol = new TableColumn(fTable, SWT.LEFT);
-            tableCol.setText(column.getHeaderName());
-
-            /* Set the column's tooltip, if any */
-            String tooltip = column.getHeaderTooltip();
-            if (tooltip != null) {
-                tableCol.setToolTipText(tooltip);
-            }
-
-            /* Set the column's Field ID (for filtering) */
-            tableCol.setData(Key.FIELD_ID, column.getFilterFieldId());
-
-            /*
-             * In Linux the table does not receive a control resized event when
-             * a table column resize causes the horizontal scroll bar to become
-             * visible or invisible, so a resize listener must be added to every
-             * table column to properly update the number of fully visible rows.
-             */
-            tableCol.addControlListener(fResizeListener);
-            tableCol.pack();
-        }
-    }
-
     /**
      * Method removeAll.
      * @return int 0 the number of elements in the table
This page took 0.026703 seconds and 5 git commands to generate.