本文整理了Java中com.vaadin.ui.Grid.setWidth()
方法的一些代码示例,展示了Grid.setWidth()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Grid.setWidth()
方法的具体详情如下:
包路径:com.vaadin.ui.Grid
类名称:Grid
方法名:setWidth
暂无
代码示例来源:origin: com.haulmont.cuba/cuba-web
@Override
public void setWidth(float width, Unit unit) {
super.setWidth(width, unit);
if (getWidth() < 0) {
grid.setWidthUndefined();
} else {
grid.setWidth(100, Unit.PERCENTAGE);
}
}
}
代码示例来源:origin: com.holon-platform.vaadin/holon-vaadin
this.grid = grid;
grid.setWidth(100, Unit.PERCENTAGE);
代码示例来源:origin: kingbbode/spring-boot-ehcache-monitor
private Grid<Cache> createCacheInfoGrid() {
Grid<Cache> grid = new Grid<>();
grid.addColumn(Cache::getName).setCaption("Name");
grid.addColumn(cache -> ((Double) (((double) cache.getStatistics().cacheHitCount()) / ((double) (cache.getStatistics().cacheMissCount() + cache.getStatistics().cacheHitCount())) * 100)).intValue() + "%").setCaption("Hit Ratio");
grid.addColumn(cache -> cache.getCacheConfiguration().getMaxEntriesLocalHeap()).setCaption("Max Size");
grid.addColumn(Cache::getSize).setCaption("Size");
grid.addColumn(Cache::getStatus).setCaption("Status");
grid.addColumn(cache -> cache.getCacheConfiguration().getTimeToIdleSeconds()).setCaption("TTldle(s)");
grid.addColumn(cache -> cache.getCacheConfiguration().getTimeToLiveSeconds()).setCaption("TTLive(s)");
grid.addColumn(cache -> cache.getStatistics().cacheHitCount()).setCaption("hit");
grid.addColumn(cache -> cache.getStatistics().cacheMissExpiredCount()).setCaption("miss : Expire");
grid.addColumn(cache -> cache.getStatistics().cacheMissNotFoundCount()).setCaption("miss : Not Found");
grid.setItems(Collections.singletonList(this.ehcache));
grid.setWidth("100%");
grid.setSelectionMode(Grid.SelectionMode.NONE);
grid.setHeightByRows(1);
return grid;
}
代码示例来源:origin: kingbbode/spring-boot-ehcache-monitor
}, new ComponentRenderer()).setCaption("");
grid.setItems(this.ehcache.getAll(getKeys(this.ehcache, SEARCH_DEFAULT)).values());
grid.setWidth("100%");
grid.setSelectionMode(Grid.SelectionMode.NONE);
int ehcacheSize = this.ehcache.getKeys().size();
代码示例来源: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;
}
代码示例来源: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;
}
内容来源于网络,如有侵权,请联系作者删除!