本文整理了Java中com.vaadin.v7.ui.Table.addItem()
方法的一些代码示例,展示了Table.addItem()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.addItem()
方法的具体详情如下:
包路径:com.vaadin.v7.ui.Table
类名称:Table
方法名:addItem
[英]Adds the new row to table and fill the visible cells (except generated columns) with given values.
[中]将新行添加到表中,并用给定值填充可见单元格(生成的列除外)。
代码示例来源:origin: com.vaadin/vaadin-compatibility-server
@Override
protected Object readItem(Element tr, Set<String> selected,
DesignContext context) {
Elements cells = tr.children();
if (visibleColumns.size() != cells.size()) {
throw new DesignException(
"Wrong number of columns in a Table row. Expected "
+ visibleColumns.size() + ", was " + cells.size()
+ ".");
}
Object[] data = new String[cells.size()];
for (int c = 0; c < cells.size(); ++c) {
data[c] = DesignFormatter.decodeFromTextNode(cells.get(c).html());
}
Object itemId = addItem(data,
tr.hasAttr("item-id") ? tr.attr("item-id") : null);
if (itemId == null) {
throw new DesignException("Failed to add a Table row: " + data);
}
return itemId;
}
代码示例来源:origin: info.magnolia.activation/magnolia-module-activation
private Layout createPublicInstancesSection() {
VerticalLayout layout = new VerticalLayout();
StaticField fieldsetTitle = createStaticField(null, i18n.translate("activationMonitor.publicInstances.fieldset.label"));
fieldsetTitle.addStyleName("fieldset-title");
layout.addComponent(fieldsetTitle);
if (activationStorage.getSubscriberResponseTimes().size() > 0) {
Table table = new Table();
table.setSelectable(false);
table.setMultiSelect(false);
table.setImmediate(false);
table.setWidth("100%");
table.setPageLength(5);
table.addContainerProperty(i18n.translate("activationMonitor.publicInstances.subscriber.label"), String.class, null);
table.addContainerProperty(i18n.translate("activationMonitor.publicInstances.max.label"), Long.class, null);
table.addContainerProperty(i18n.translate("activationMonitor.publicInstances.min.label"), Long.class, null);
table.addContainerProperty(i18n.translate("activationMonitor.publicInstances.avg.label"), Long.class, null);
int i = 0;
for (Map.Entry<String, ResponseTimeEntry> entry : activationStorage.getSubscriberResponseTimes().entrySet()) {
String subscriber = entry.getKey();
long max = entry.getValue().getMax();
long min = entry.getValue().getMin();
long avg = entry.getValue().getAvg();
table.addItem(new Object[]{subscriber, max, min, avg}, i++);
}
layout.addComponent(table);
} else {
layout.addComponent(createStaticField(null, i18n.translate("activationMonitor.publicInstances.noActivations.label")));
}
return layout;
}
代码示例来源:origin: OpenNMS/opennms
table.addItem(new Object[]{entry.getKey(), dashletSpec.getParameters().containsKey(entry.getKey()) ? dashletSpec.getParameters().get(entry.getKey()) : ""}, entry.getKey());
代码示例来源:origin: OpenNMS/opennms
table.addItem(new Object[] {
getLabel(eachEdge, explanation),
createStatusLabel(null, eachEdge.getStatus()),
代码示例来源:origin: info.magnolia.activation/magnolia-module-activation
Label label = new Label(icon);
label.setContentMode(ContentMode.HTML);
table.addItem(new Object[]{label, entry.getDate(), entry.getUser(), entry.getWorkspace(), entry.getPath(), entry.getSubscriber(), entry.getError().toString(), entry.getError().getCause() != null ? entry.getError().getCause().toString() : StringUtils.EMPTY}, i++);
代码示例来源:origin: info.magnolia.activation/magnolia-module-activation
Label label = new Label(icon);
label.setContentMode(ContentMode.HTML);
table.addItem(new Object[]{label, entry.getDate(), entry.getUser(), entry.getWorkspace(), entry.getPath(), entry.getSubscriber()}, i++);
代码示例来源:origin: OpenNMS/opennms
categoriesTable.addItem(new Object[]{onmsCategory.getName()}, onmsCategory.getId());
categoriesMap.put(onmsCategory.getId(), onmsCategory);
if (def.containsCategory(onmsCategory.getName())) {
内容来源于网络,如有侵权,请联系作者删除!