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

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

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

Table.setColumnHeaders介绍

[英]Sets the headers of the columns.

The headers match the property id:s given by the set visible column headers. The table must be set in either #COLUMN_HEADER_MODE_EXPLICIT or #COLUMN_HEADER_MODE_EXPLICIT_DEFAULTS_ID mode to show the headers. In the defaults mode any nulls in the headers array are replaced with id.toString() outputs when rendering.
[中]设置列的标题。
标题与“设置可见列标题”给定的属性id相匹配。表格必须设置为#列_标题_模式_显式或#列_标题_模式_显式_默认值_ID模式以显示标题。在默认模式下,在渲染时,headers数组中的任何空值都将替换为id.toString()输出。

代码示例

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

  1. public MultiSelectTable<ET> withColumnHeaders(
  2. String... columnNamesForVisibleProperties) {
  3. if (isContainerInitialized()) {
  4. table.setColumnHeaders(columnNamesForVisibleProperties);
  5. } else {
  6. pendingHeaders = columnNamesForVisibleProperties;
  7. // Add headers to temporary indexed container, in case table is initially
  8. // empty
  9. for (String prop : columnNamesForVisibleProperties) {
  10. table.addContainerProperty(prop, String.class, "");
  11. }
  12. }
  13. return this;
  14. }

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

  1. /**
  2. * Sets the list of options available.
  3. *
  4. * @param list the list of available options
  5. * @return this for fluent configuration
  6. */
  7. public MultiSelectTable<ET> setOptions(ET... list) {
  8. if (visProps == null) {
  9. table.setContainerDataSource(new ListContainer(optionType, Arrays.
  10. asList(list)));
  11. } else {
  12. table.setContainerDataSource(new ListContainer(optionType, Arrays.
  13. asList(list)), Arrays.asList(
  14. visProps));
  15. }
  16. if (pendingHeaders != null) {
  17. table.setColumnHeaders(pendingHeaders);
  18. }
  19. return this;
  20. }

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

  1. /**
  2. * Sets the list of options available.
  3. *
  4. * @param list the list of available options
  5. * @return this for fluent configuration
  6. */
  7. public MultiSelectTable<ET> setOptions(List<ET> list) {
  8. if (visProps == null) {
  9. table.setContainerDataSource(new ListContainer(optionType, list));
  10. } else {
  11. table.setContainerDataSource(new ListContainer(optionType, list), Arrays.asList(
  12. visProps));
  13. }
  14. if (pendingHeaders != null) {
  15. table.setColumnHeaders(pendingHeaders);
  16. }
  17. return this;
  18. }

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

  1. /**
  2. * Instantiates a new MIB object field.
  3. *
  4. * @param resourceTypes the available resource types
  5. * @param mibGroupEditable true, if the MIB group can be modified
  6. */
  7. public MibObjField(final List<String> resourceTypes, boolean mibGroupEditable) {
  8. table.addStyleName("light");
  9. table.setVisibleColumns(new Object[] { "oid", "instance", "alias", "type" });
  10. table.setColumnHeaders(new String[] { "OID", "Instance", "Alias", "Type" });
  11. table.setEditable(!isReadOnly());
  12. table.setSelectable(true);
  13. table.setHeight("250px");
  14. table.setWidth("100%");
  15. table.setTableFieldFactory(new MibObjFieldFactory(resourceTypes));
  16. if (mibGroupEditable) {
  17. toolbar.addComponent(add);
  18. toolbar.addComponent(delete);
  19. }
  20. toolbar.setVisible(table.isEditable());
  21. setValidationVisible(true);
  22. }

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

  1. table.setColumnHeaders(new String[]{"Type", "Value"});
  2. table.setEditable(!isReadOnly());
  3. table.setSelectable(true);

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

  1. table.setColumnHeaders(new String[]{"Consolidation Function", "XFF", "Steps", "Rows"});
  2. table.setEditable(!isReadOnly());
  3. table.setSelectable(true);

相关文章

Table类方法