com.vaadin.ui.Grid.setDataProvider()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(3.1k)|赞(0)|评价(0)|浏览(214)

本文整理了Java中com.vaadin.ui.Grid.setDataProvider()方法的一些代码示例,展示了Grid.setDataProvider()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Grid.setDataProvider()方法的具体详情如下:
包路径:com.vaadin.ui.Grid
类名称:Grid
方法名:setDataProvider

Grid.setDataProvider介绍

[英]Sets a CallbackDataProvider using the given fetch items callback and a size callback.

This method is a shorthand for making a CallbackDataProvider that handles a partial Query object.
[中]使用给定的fetch items回调和size回调设置CallbackDataProvider。
此方法是生成处理部分查询对象的CallbackDataProvider的简写。

代码示例

代码示例来源:origin: com.vaadin/vaadin-server

/**
 * 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);
}

代码示例来源:origin: com.vaadin/vaadin-server

/**
 * 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);
}

代码示例来源:origin: com.vaadin/vaadin-server

@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);
}

代码示例来源:origin: viritin/viritin

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.
}

代码示例来源:origin: com.holon-platform.vaadin/holon-vaadin

/**
 * 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()));
    }
  }
}

代码示例来源:origin: com.haulmont.cuba/cuba-web

this.dataBinding = null;
this.component.setDataProvider(createEmptyDataProvider());
this.component.setDataProvider(this.dataBinding);

代码示例来源:origin: AxonIQ/giftcard-demo

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;
}

代码示例来源:origin: info.magnolia.ui/magnolia-ui-framework

.ifNotPresent(grid::deselectAll));
grid.setDataProvider(listPresenter.getDataProvider());

代码示例来源:origin: jreznot/electron-java-app

tasksGrid.setDataProvider(dataProvider);
tasksGrid.setSizeFull();
tasksGrid.getEditor().setEnabled(true);

相关文章

Grid类方法