}
private void createColumns() {
final Tree tree = viewer.getTree();
final TableLayout layout = new TableLayout();
TreeViewerColumn column;
final String[] names = {
"Kind", "Function", org.erlide.debug.ui.views.ActionMessages.getString("DebuggerTraceView.5") }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
for (final String name : names) {
column = new TreeViewerColumn(viewer, SWT.NONE);
final TreeColumn treeColumn = column.getColumn();
treeColumn.setResizable(true);
treeColumn.setMoveable(true);
treeColumn.addSelectionListener(new SelectionListener() {
@Override
public void widgetDefaultSelected(final SelectionEvent e) {
}
@Override
public void widgetSelected(final SelectionEvent e) {
}
});
// column.getColumn().setData(MARKER_FIELD, markerField);
// Show the help in the first column
column.setLabelProvider(new ColumnLabelProvider());
treeColumn.setText(name);
treeColumn.setToolTipText(name);
}
// column = new TreeViewerColumn(viewer, SWT.NONE);
// treeColumn = column.getColumn();
// treeColumn.setResizable(true);
// treeColumn.setMoveable(true);
// column.setLabelProvider(new ColumnLabelProvider());
// column.getColumn().setImage(markerField.getColumnHeaderImage());
// final EditingSupport support = markerField
// .getEditingSupport(viewer);
// if (support != null) {
// column.setEditingSupport(support);
// }
// if (builder.getPrimarySortField().equals(markerField)) {
// updateDirectionIndicator(column.getColumn(), markerField);
// }
int columnWidth = -1;
for (int i = 0; i < names.length; ++i) {
if (i == 0) {
// Compute and store a font metric
final GC gc = new GC(tree);
gc.setFont(tree.getFont());
final FontMetrics fontMetrics = gc.getFontMetrics();
gc.dispose();
columnWidth = Math.max(100, fontMetrics.getAverageCharWidth() * 20);
}
// if (columnWidths != null) {
// final Integer value = columnWidths.getInteger(getFieldId(column
// .getColumn()));
//
// // Make sure we get a useful value
// if (value != null && value.intValue() > 0) {
// columnWidth = value.intValue();
// }
// }
// // Take trim into account if we are using the default value, but
// not
// // if it is restored.
// if (columnWidth < 0) {
// layout.addColumnData(new ColumnPixelData(markerField
// .getDefaultColumnWidth(tree), true, true));
// } else {
layout.addColumnData(new ColumnPixelData(columnWidth, true));
// }
}
// }
// Remove extra columns