com.vaadin.ui.Grid.addColumnVisibilityChangeListener()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(139)

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

Grid.addColumnVisibilityChangeListener介绍

[英]Registers a new column visibility change listener.
[中]注册新的列可见性更改侦听器。

代码示例

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

@Override
public Subscription addColumnCollapsingChangeListener(Consumer<ColumnCollapsingChangeEvent> listener) {
  if (columnCollapsingChangeListenerRegistration == null) {
    columnCollapsingChangeListenerRegistration =
        component.addColumnVisibilityChangeListener(this::onColumnVisibilityChanged);
  }
  getEventHub().subscribe(ColumnCollapsingChangeEvent.class, listener);
  return () -> removeColumnCollapsingChangeListener(listener);
}

代码示例来源:origin: com.holon-platform.vaadin/holon-vaadin

/**
 * Adds a {@link PropertyVisibilityListener} that gets notified when a property column is hidden or shown.
 * @param listener Listener to add (not null)
 * @return the listener registration
 */
public Registration addPropertyVisibilityListener(final PropertyVisibilityListener<P> listener) {
  ObjectUtils.argumentNotNull(listener, "Listener must be not null");
  return getGrid().addColumnVisibilityChangeListener(e -> listener.onPropertyVisibilityChanged(
      getColumnProperty(e.getColumn().getId()), e.isHidden(), e.isUserOriginated()));
}

代码示例来源:origin: com.holon-platform.vaadin7/holon-vaadin

/**
 * Adds a {@link PropertyVisibilityListener} that gets notified when a property column is hidden or shown.
 * @param listener Listener to add (not null)
 */
@SuppressWarnings("unchecked")
public void addPropertyVisibilityListener(final PropertyVisibilityListener<P> listener) {
  ObjectUtils.argumentNotNull(listener, "Listener must be not null");
  switch (getRenderingMode()) {
  case GRID:
    getGrid().addColumnVisibilityChangeListener(e -> listener.onPropertyVisibilityChanged(
        (P) e.getColumn().getPropertyId(), e.isHidden(), e.isUserOriginated()));
    break;
  case TABLE:
    getTable().addColumnCollapseListener(e -> listener.onPropertyVisibilityChanged((P) e.getPropertyId(),
        getTable().isColumnCollapsed(e.getPropertyId()), true));
    break;
  default:
    break;
  }
}

相关文章

Grid类方法