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

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

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

Table.addGeneratedColumn介绍

[英]Adds a generated column to the Table.

A generated column is a column that exists only in the Table, not as a property in the underlying Container. It shows up just as a regular column.

A generated column will override a property with the same id, so that the generated column is shown instead of the column representing the property. Note that getContainerProperty() will still get the real property.

Table will not listen to value change events from properties overridden by generated columns. If the content of your generated column depends on properties that are not directly visible in the table, attach value change listener to update the content on all depended properties. Otherwise your UI might not get updated as expected.

Also note that getVisibleColumns() will return the generated columns, while getContainerPropertyIds() will not.
[中]

代码示例

代码示例来源:origin: com.haulmont.cuba/cuba-web

protected void addGeneratedColumnInternal(Object id, com.vaadin.v7.ui.Table.ColumnGenerator generator) {
  component.addGeneratedColumn(id, generator);
}

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

/**
 * Call this method before any of the {@link SelectionNotifier} methods to ensure
 * that the {@link SelectionListener} instances are registered with all of the
 * {@link ColumnGenerator} classes that also implement {@link SelectionNotifier}.
 */
public void setColumnGenerators(@SuppressWarnings("rawtypes") Map generators) {
  for (Object key : generators.keySet()) {
    super.addGeneratedColumn(key, (ColumnGenerator)generators.get(key));
    // If any of the column generators are {@link SelectionNotifier} instances,
    // then register this component as a listener for events that they generate.
    try {
      m_selectionNotifiers.add((SelectionNotifier)generators.get(key));
    } catch (ClassCastException e) {}
  }
}

代码示例来源:origin: com.haulmont.cuba/cuba-web

protected void createStubsForGeneratedColumns() {
  for (Column column : columnsOrder) {
    if (!(column.getId() instanceof MetaPropertyPath)
        && component.getColumnGenerator(column.getId()) == null) {
      component.addGeneratedColumn(column.getId(), VOID_COLUMN_GENERATOR);
    }
  }
}

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

m_table.setSizeFull();
m_table.addGeneratedColumn("Edit", new Table.ColumnGenerator() {
  public Object generateCell(Table source, final Object itemId, Object columnId) {
    Button button = new Button("Edit");
m_table.addGeneratedColumn("Remove", new Table.ColumnGenerator() {
  public Object generateCell(Table source, final Object itemId, Object columnId) {
    Button button = new Button("Remove");
m_table.addGeneratedColumn("Preview", new Table.ColumnGenerator() {
  public Object generateCell(Table source, final Object itemId, Object columnId) {
    Button button = new Button("Preview");
m_table.addGeneratedColumn("Default", new Table.ColumnGenerator() {
  public Object generateCell(Table source, final Object itemId, Object columnId) {
    CheckBox checkBox = new CheckBox();

代码示例来源:origin: com.haulmont.cuba/cuba-web

component.addGeneratedColumn(
    generatedColumnId,
    new CustomColumnGenerator(generator, associatedRuntimeColumn) {

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

m_table.sort(new Object[]{"name"}, new boolean[]{true});
m_table.addGeneratedColumn("Edit", new Table.ColumnGenerator() {
      public Object generateCell(Table source, final Object itemId, Object columnId) {
        Button button = new Button("Edit");
m_table.addGeneratedColumn("Remove", new Table.ColumnGenerator() {
  public Object generateCell(Table source, final Object itemId, Object columnId) {
    Button button = new Button("Remove");
m_table.addGeneratedColumn("Preview", new Table.ColumnGenerator() {
      public Object generateCell(Table source, final Object itemId, Object columnId) {
        Button button = new Button("Preview");
m_table.addGeneratedColumn("Default", new Table.ColumnGenerator() {
      public Object generateCell(Table source, final Object itemId, Object columnId) {
        CheckBox checkBox = new CheckBox();

相关文章

微信公众号

最新文章

更多

Table类方法