use of org.eclipse.jface.viewers.TableViewerColumn in project tdi-studio-se by Talend.
the class FieldSection method createContents.
@Override
protected void createContents(Composite composite) {
tableViewer = new TableViewer(composite, SWT.FULL_SELECTION | SWT.MULTI | SWT.V_SCROLL);
final Table table = tableViewer.getTable();
table.setLinesVisible(true);
table.setHeaderVisible(false);
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
gd.horizontalAlignment = SWT.FILL;
gd.verticalAlignment = SWT.FILL;
table.setLayoutData(gd);
TableViewerColumn column = new TableViewerColumn(tableViewer, SWT.NONE);
table.addListener(SWT.Resize, new Listener() {
public void handleEvent(Event event) {
TableColumn[] columns = table.getColumns();
int clientWidth = table.getBounds().width;
columns[0].setWidth(clientWidth);
}
});
if (editable) {
column.setEditingSupport(new FieldEditingSupport(tableViewer, 0));
}
tableViewer.setLabelProvider(new TableLabelProvider());
tableViewer.setContentProvider(new ContentProvider());
// sorter
// tableViewer.setSorter(new ViewerSorter());
}
Aggregations