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

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

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

Grid.setHeightMode介绍

[英]Defines the mode in which the Grid widget's height is calculated.

If HeightMode#CSS is given, Grid will respect the values given via a setHeight-method, and behave as a traditional Component.

If HeightMode#ROW is given, Grid will make sure that the body will display as many rows as #getHeightByRows() defines. Note: If headers/footers are inserted or removed, the widget will resize itself to still display the required amount of rows in its body. It also takes the horizontal scrollbar into account.
[中]定义计算网格小部件高度的模式。
如果给定了HeightMode#CSS,网格将尊重通过setHeight方法给出的值,并表现为传统组件。
如果给定了HeightMode#行,Grid将确保主体显示的行数与#getHeightByRows()定义的行数相同*注意:*如果插入或删除页眉/页脚,小部件将调整自身大小,以在其正文中仍显示所需的行数。它还考虑了水平滚动条。

代码示例

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

/**
 * Set the height mode of the internal grid.
 * @param heightMode the height mode to set
 */
public void setHeightMode(HeightMode heightMode) {
  getGrid().setHeightMode(heightMode);
}

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

@Override
public void setHeight(float height, Unit unit) {
  super.setHeight(height, unit);
  if (getHeight() < 0) {
    grid.setHeightUndefined();
    grid.setHeightMode(HeightMode.UNDEFINED);
  } else {
    grid.setHeight(100, Unit.PERCENTAGE);
    grid.setHeightMode(HeightMode.CSS);
  }
}

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

@Override
public B heightByContents() {
  getInstance().getGrid().setHeightMode(HeightMode.UNDEFINED);
  return builder();
}

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

@Override
public B heightByRows(double rows) {
  getInstance().getGrid().setHeightMode(HeightMode.ROW);
  getInstance().getGrid().setHeightByRows(rows);
  return builder();
}

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

protected void initComponent(Grid<E> component) {
  setSelectionMode(SelectionMode.SINGLE);
  component.setColumnReorderingAllowed(true);
  component.addItemClickListener(this::onItemClick);
  component.addColumnReorderListener(this::onColumnReorder);
  component.addSortListener(this::onSort);
  component.setSizeUndefined();
  component.setHeightMode(HeightMode.UNDEFINED);
  component.setStyleGenerator(this::getGeneratedRowStyle);
  //noinspection unchecked
  ((CubaEnhancedGrid<E>) component).setCubaEditorFieldFactory(createEditorFieldFactory());
}

相关文章

Grid类方法