com.vaadin.v7.ui.Table.addItem()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(3.8k)|赞(0)|评价(0)|浏览(390)

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

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

  1. @Override
  2. protected Object readItem(Element tr, Set<String> selected,
  3. DesignContext context) {
  4. Elements cells = tr.children();
  5. if (visibleColumns.size() != cells.size()) {
  6. throw new DesignException(
  7. "Wrong number of columns in a Table row. Expected "
  8. + visibleColumns.size() + ", was " + cells.size()
  9. + ".");
  10. }
  11. Object[] data = new String[cells.size()];
  12. for (int c = 0; c < cells.size(); ++c) {
  13. data[c] = DesignFormatter.decodeFromTextNode(cells.get(c).html());
  14. }
  15. Object itemId = addItem(data,
  16. tr.hasAttr("item-id") ? tr.attr("item-id") : null);
  17. if (itemId == null) {
  18. throw new DesignException("Failed to add a Table row: " + data);
  19. }
  20. return itemId;
  21. }

代码示例来源:origin: info.magnolia.activation/magnolia-module-activation

  1. private Layout createPublicInstancesSection() {
  2. VerticalLayout layout = new VerticalLayout();
  3. StaticField fieldsetTitle = createStaticField(null, i18n.translate("activationMonitor.publicInstances.fieldset.label"));
  4. fieldsetTitle.addStyleName("fieldset-title");
  5. layout.addComponent(fieldsetTitle);
  6. if (activationStorage.getSubscriberResponseTimes().size() > 0) {
  7. Table table = new Table();
  8. table.setSelectable(false);
  9. table.setMultiSelect(false);
  10. table.setImmediate(false);
  11. table.setWidth("100%");
  12. table.setPageLength(5);
  13. table.addContainerProperty(i18n.translate("activationMonitor.publicInstances.subscriber.label"), String.class, null);
  14. table.addContainerProperty(i18n.translate("activationMonitor.publicInstances.max.label"), Long.class, null);
  15. table.addContainerProperty(i18n.translate("activationMonitor.publicInstances.min.label"), Long.class, null);
  16. table.addContainerProperty(i18n.translate("activationMonitor.publicInstances.avg.label"), Long.class, null);
  17. int i = 0;
  18. for (Map.Entry<String, ResponseTimeEntry> entry : activationStorage.getSubscriberResponseTimes().entrySet()) {
  19. String subscriber = entry.getKey();
  20. long max = entry.getValue().getMax();
  21. long min = entry.getValue().getMin();
  22. long avg = entry.getValue().getAvg();
  23. table.addItem(new Object[]{subscriber, max, min, avg}, i++);
  24. }
  25. layout.addComponent(table);
  26. } else {
  27. layout.addComponent(createStaticField(null, i18n.translate("activationMonitor.publicInstances.noActivations.label")));
  28. }
  29. return layout;
  30. }

代码示例来源:origin: OpenNMS/opennms

  1. table.addItem(new Object[]{entry.getKey(), dashletSpec.getParameters().containsKey(entry.getKey()) ? dashletSpec.getParameters().get(entry.getKey()) : ""}, entry.getKey());

代码示例来源:origin: OpenNMS/opennms

  1. table.addItem(new Object[] {
  2. getLabel(eachEdge, explanation),
  3. createStatusLabel(null, eachEdge.getStatus()),

代码示例来源:origin: info.magnolia.activation/magnolia-module-activation

  1. Label label = new Label(icon);
  2. label.setContentMode(ContentMode.HTML);
  3. 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

  1. Label label = new Label(icon);
  2. label.setContentMode(ContentMode.HTML);
  3. table.addItem(new Object[]{label, entry.getDate(), entry.getUser(), entry.getWorkspace(), entry.getPath(), entry.getSubscriber()}, i++);

代码示例来源:origin: OpenNMS/opennms

  1. categoriesTable.addItem(new Object[]{onmsCategory.getName()}, onmsCategory.getId());
  2. categoriesMap.put(onmsCategory.getId(), onmsCategory);
  3. if (def.containsCategory(onmsCategory.getName())) {

相关文章

Table类方法