Search in sources :

Example 1 with DatasourceTableItems

use of com.haulmont.cuba.gui.components.data.table.DatasourceTableItems in project cuba by cuba-platform.

the class Table method setDatasource.

/**
 * @param datasource datasource
 * @deprecated Use {@link #setItems(TableItems)} instead
 */
@Deprecated
default void setDatasource(CollectionDatasource datasource) {
    if (datasource == null) {
        setItems(null);
    } else {
        TableItems<E> tableItems;
        if (datasource instanceof CollectionDatasource.Sortable) {
            tableItems = new SortableDatasourceTableItems((CollectionDatasource.Sortable) datasource);
        } else {
            tableItems = new DatasourceTableItems(datasource);
        }
        setItems(tableItems);
    }
}
Also used : SortableDatasourceTableItems(com.haulmont.cuba.gui.components.data.table.SortableDatasourceTableItems) DatasourceTableItems(com.haulmont.cuba.gui.components.data.table.DatasourceTableItems) SortableDatasourceTableItems(com.haulmont.cuba.gui.components.data.table.SortableDatasourceTableItems)

Aggregations

DatasourceTableItems (com.haulmont.cuba.gui.components.data.table.DatasourceTableItems)1 SortableDatasourceTableItems (com.haulmont.cuba.gui.components.data.table.SortableDatasourceTableItems)1