Interface TableListDataSource<E>

Type Parameters:
E - The type of the table entry Objects.
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface TableListDataSource<E>
A simple functional interface whose implementations are used to form simple TableModel implementations based on lists of lists.

Note that TableData is the recommended way of modelling a table in SwingTree. It is a single immutable value describing the whole table (cells, column names, column classes, cell order and editability), which you hold in a Var property and bind through UIFactoryMethods.table(sprouts.Var). A table bound like that updates itself, is thread safe by construction, and syncs row changes to the JTable incrementally rather than rebuilding it. A pull based data source like this one, by contrast, has to be told when to refresh (see updateTableOn(..)), and can only ever refresh everything.

  • Method Details

    • get

      List<List<E>> get()
      When passed to UIForTable.withModel(UI.CellOrder, UI.Editability, TableListDataSource), this method is called continuously by your table to fetch the current List based table data. It is not cached or stored inside the table, so if you do not want to rebuild the list based model over and over again, make sure this list data source always returns the same object instead of rebuilding it eagerly...
      Returns:
      A list matrix which will be used to populate the table.