Class TableColumnFactory


public final class TableColumnFactory extends AbstractItemFactory<TableColumnFactory,TableColumn,Table>
This class provides a convenient shorthand for creating and initializing TableColumn. This offers several benefits over creating TableColumn normal way: Example usage:
 TableColumn column = TableColumnFactory.newTableColumn(SWT.CENTER) //
                .text("Table Column") //
                .onSelect(event -> columnClicked(event)) //
                .create(table);
 

The above example creates a table column, sets text, registers a SelectionListener and finally creates the table column in "table".

 TableColumnFactory factory = TableColumnFactory.newTableColumn(SWT.CENTER).onSelect(event -> columnClicked(event));
 factory.text("Column 1").create(table);
 factory.text("Column 2").create(table);
 factory.text("Column 3").create(table);
 

The above example creates three table columns using the same instance of factory.

Since:
3.18
  • Method Details