/** * Creates a new {@code Grid} using the given {@code DataProvider}. * * @param dataProvider * the data provider, not {@code null} */ public Grid(DataProvider<T, ?> dataProvider) { this(); setDataProvider(dataProvider); }
/** * Creates a new {@code Grid} using the given caption and * {@code DataProvider}. * * @param caption * the caption of the grid * @param dataProvider * the data provider, not {@code null} */ public Grid(String caption, DataProvider<T, ?> dataProvider) { this(caption); setDataProvider(dataProvider); }
@Override public void setDataProvider(DataProvider<T, ?> dataProvider) { if (!(dataProvider instanceof HierarchicalDataProvider)) { throw new IllegalArgumentException( "TreeGrid only accepts hierarchical data providers"); } getRpcProxy(TreeGridClientRpc.class).clearPendingExpands(); super.setDataProvider(dataProvider); }
public void setItems(FetchItemsCallback<T> fetchItems) { SerializableSupplier<Integer> sizeCallback = () -> { // This should never be called by the framework System.err.println("Size requested although should not be needed"); return 0; }; super.setDataProvider(fetchItems, sizeCallback); //To change body of generated methods, choose Tools | Templates. }
/** * Setup the Grid {@link DataProvider} according to buffered mode and current data source. */ protected void setupDataProvider() { if (this.dataSource != null) { if (isBuffered()) { getGrid().setDataProvider(new ItemDataSourceAdapter<>(this.dataSource)); } else { getGrid().setDataProvider(new ItemDataProviderAdapter<>(this.dataSource.getConfiguration())); } } }
this.dataBinding = null; this.component.setDataProvider(createEmptyDataProvider()); this.component.setDataProvider(this.dataBinding);
private Grid summaryGrid() { cardSummaryDataProvider = new CardSummaryDataProvider(queryGateway); Grid<CardSummary> grid = new Grid<>(); grid.addColumn(CardSummary::getId).setCaption("Card ID"); grid.addColumn(CardSummary::getInitialValue).setCaption("Initial value"); grid.addColumn(CardSummary::getRemainingValue).setCaption("Remaining value"); grid.setSizeFull(); grid.setDataProvider(cardSummaryDataProvider); return grid; }
.ifNotPresent(grid::deselectAll)); grid.setDataProvider(listPresenter.getDataProvider());
tasksGrid.setDataProvider(dataProvider); tasksGrid.setSizeFull(); tasksGrid.getEditor().setEnabled(true);