package org.eclipse.linuxtools.tmf.ui.parsers.custom;\r
\r
import java.text.SimpleDateFormat;\r
+import java.util.LinkedList;\r
+import java.util.List;\r
import java.util.TimeZone;\r
\r
import org.eclipse.linuxtools.tmf.event.TmfEvent;\r
import org.eclipse.linuxtools.tmf.ui.parsers.custom.CustomTraceDefinition.OutputColumn;\r
import org.eclipse.linuxtools.tmf.ui.viewers.events.TmfEventsTable;\r
+import org.eclipse.linuxtools.tmf.ui.widgets.ColumnData;\r
import org.eclipse.swt.SWT;\r
import org.eclipse.swt.widgets.Composite;\r
-import org.eclipse.swt.widgets.Table;\r
-import org.eclipse.swt.widgets.TableColumn;\r
\r
public class CustomEventsTable extends TmfEventsTable {\r
\r
public CustomEventsTable(CustomTraceDefinition definition, Composite parent, int cacheSize) {\r
super(parent, cacheSize);\r
fDefinition = definition;\r
- createColumnHeaders(fTable);\r
+ createColumnHeaders();\r
}\r
\r
public static final String TIMESTAMP_FORMAT = "yyyy-MM-dd HH:mm:ss.SSS";\r
TIMESTAMP_SIMPLE_DATE_FORMAT.setTimeZone(TimeZone.getTimeZone("GMT"));\r
}\r
\r
- @Override\r
- public void createColumnHeaders(final Table table) {\r
- if (fDefinition == null) return; // ignore when called by the super constructor\r
- for (OutputColumn outputColumn : fDefinition.outputs) {\r
- TableColumn column = new TableColumn(table, SWT.LEFT);\r
- column.setText(outputColumn.name);\r
- column.pack();\r
- }\r
+ protected void createColumnHeaders() {\r
+ if (fDefinition == null)\r
+ return;\r
+ List<ColumnData> columnData = new LinkedList<ColumnData>();\r
+ for (OutputColumn outputColumn : fDefinition.outputs) {\r
+ ColumnData column = new ColumnData(outputColumn.name, 0, SWT.LEFT);\r
+ columnData.add(column);\r
+ }\r
+ setColumnHeaders((ColumnData[]) columnData.toArray());\r
}\r
\r
+// @Override\r
+// public void createColumnHeaders(final Table table) {\r
+// if (fDefinition == null) return; // ignore when called by the super constructor\r
+// for (OutputColumn outputColumn : fDefinition.outputs) {\r
+// TableColumn column = new TableColumn(table, SWT.LEFT);\r
+// column.setText(outputColumn.name);\r
+// column.pack();\r
+// }\r
+// }\r
+\r
@Override\r
public String[] extractItemFields(TmfEvent event) {\r
if (event instanceof CustomEvent) {\r