本文整理了Java中com.vaadin.ui.Grid.setContainerDataSource()
方法的一些代码示例,展示了Grid.setContainerDataSource()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Grid.setContainerDataSource()
方法的具体详情如下:
包路径:com.vaadin.ui.Grid
类名称:Grid
方法名:setContainerDataSource
暂无
代码示例来源:origin: com.holon-platform.vaadin7/holon-vaadin
/**
* Set the listing data source.
* @param <D> Data source type
* @param container The data source to set (not null)
*/
public <D extends ItemDataSource<T, P> & Indexed> void setDataSource(D container) {
ObjectUtils.argumentNotNull(container, "Container datasource must be not null");
this.dataSource = container;
switch (getRenderingMode()) {
case GRID:
getGrid().setContainerDataSource(container);
break;
case TABLE:
getTable().setContainerDataSource(container);
break;
default:
break;
}
}
代码示例来源:origin: eclipse/hawkbit
protected Grid createMetadataGrid() {
final Grid metadataGrid = new Grid();
metadataGrid.addStyleName(SPUIStyleDefinitions.METADATA_GRID);
metadataGrid.setImmediate(true);
metadataGrid.setHeight("100%");
metadataGrid.setWidth("100%");
metadataGrid.setId(UIComponentIdProvider.METDATA_TABLE_ID);
metadataGrid.setSelectionMode(SelectionMode.SINGLE);
metadataGrid.setColumnReorderingAllowed(true);
metadataGrid.setContainerDataSource(getMetadataContainer());
metadataGrid.getColumn(KEY).setHeaderCaption(i18n.getMessage("header.key"));
metadataGrid.getColumn(VALUE).setHeaderCaption(i18n.getMessage("header.value"));
metadataGrid.getColumn(VALUE).setHidden(true);
metadataGrid.addSelectionListener(this::onRowClick);
metadataGrid.getColumn(DELETE_BUTTON).setHeaderCaption("");
metadataGrid.getColumn(DELETE_BUTTON).setRenderer(new HtmlButtonRenderer(this::onDelete));
metadataGrid.getColumn(DELETE_BUTTON).setWidth(50);
metadataGrid.getColumn(KEY).setExpandRatio(1);
return metadataGrid;
}
代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui
protected Grid createMetadataGrid() {
final Grid metadataGrid = new Grid();
metadataGrid.addStyleName(SPUIStyleDefinitions.METADATA_GRID);
metadataGrid.setImmediate(true);
metadataGrid.setHeight("100%");
metadataGrid.setWidth("100%");
metadataGrid.setId(UIComponentIdProvider.METDATA_TABLE_ID);
metadataGrid.setSelectionMode(SelectionMode.SINGLE);
metadataGrid.setColumnReorderingAllowed(true);
metadataGrid.setContainerDataSource(getMetadataContainer());
metadataGrid.getColumn(KEY).setHeaderCaption(i18n.getMessage("header.key"));
metadataGrid.getColumn(VALUE).setHeaderCaption(i18n.getMessage("header.value"));
metadataGrid.getColumn(VALUE).setHidden(true);
metadataGrid.addSelectionListener(this::onRowClick);
metadataGrid.getColumn(DELETE_BUTTON).setHeaderCaption("");
metadataGrid.getColumn(DELETE_BUTTON).setRenderer(new HtmlButtonRenderer(this::onDelete));
metadataGrid.getColumn(DELETE_BUTTON).setWidth(50);
metadataGrid.getColumn(KEY).setExpandRatio(1);
return metadataGrid;
}
内容来源于网络,如有侵权,请联系作者删除!