com.vaadin.data.HasDataProvider Maven / Gradle / Ivy
/*
* Copyright (C) 2000-2024 Vaadin Ltd
*
* This program is available under Vaadin Commercial License and Service Terms.
*
* See for the full
* license.
*/
package com.vaadin.data;
import java.util.Collection;
import com.vaadin.data.provider.DataProvider;
/**
* A generic interface for listing components that use a data provider for
* showing data.
*
* A listing component should implement either this interface or
* {@link HasFilterableDataProvider}, but not both.
*
* @author Vaadin Ltd.
*
* @param
* the item data type
* @since 8.0
*
* @see HasFilterableDataProvider
*/
public interface HasDataProvider extends HasItems {
/**
* Sets the data provider for this listing. The data provider is queried for
* displayed items as needed.
*
* @param dataProvider
* the data provider, not null
*/
public void setDataProvider(DataProvider dataProvider);
@Override
public default void setItems(Collection items) {
setDataProvider(DataProvider.ofCollection(items));
}
}