Class TableFactory


public final class TableFactory extends AbstractControlFactory<TableFactory, Table>
This class provides a convenient shorthand for creating and initializing Table. This offers several benefits over creating Table normal way:
  • The same factory can be used many times to create several Table instances
  • The setters on TableFactory all return "this", allowing them to be chained
  • TableFactory accepts a Lambda for SelectionEvent (see onSelect(Consumer))
Example usage:
Table table = TableFactory.newTable(SWT.CHECK) //
                .headerVisible(true) //
                .linesVisible(true) //
                .onSelect(e -> tableClicked(e)) //
                .create(parent);

The above example creates a table, sets some properties, registers a SelectionListener and finally creates the table in "parent".

Note that this class does not extend AbstractCompositeFactory even though Table extends Composite. This is because Table is not supposed to be used like a Composite.

Since:
3.18