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

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

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

Grid.getState介绍

暂无

代码示例

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

/**
 * Returns the current footer row height. -1 if row height is in automatic
 * calculation mode.
 *
 * @return footer row height
 * @since 8.2
 */
public double getFooterRowHeight() {
  return getState(false).footerRowHeight;
}

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

/**
 * Returns whether column reordering is allowed. Default value is
 * <code>false</code>.
 *
 * @return true if reordering is allowed
 */
public boolean isColumnReorderingAllowed() {
  return getState(false).columnReorderingAllowed;
}

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

/**
 * Returns the current column resize mode. The default mode is
 * {@link ColumnResizeMode#ANIMATED}.
 *
 * @return a ColumnResizeMode value
 * @since 7.7.5
 */
public ColumnResizeMode getColumnResizeMode() {
  return getState(false).columnResizeMode;
}

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

/**
 * Sets the height of a body row. If -1 (default), the row height is
 * calculated based on the theme for an empty row before the Grid is
 * displayed.
 *
 * @param rowHeight
 *            The height of a row in pixels or -1 for automatic calculation
 * @since 8.2
 */
public void setBodyRowHeight(double rowHeight) {
  getState().bodyRowHeight = rowHeight;
}

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

/**
 * Returns the current body row height. -1 if row height is in automatic
 * calculation mode.
 *
 * @return body row height
 * @since 8.2
 */
public double getBodyRowHeight() {
  return getState(false).bodyRowHeight;
}

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

/**
 * Returns the current header row height. -1 if row height is in automatic
 * calculation mode.
 *
 * @return header row height
 * @since 8.2
 */
public double getHeaderRowHeight() {
  return getState(false).headerRowHeight;
}

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

/**
 * Sets the column resize mode to use. The default mode is
 * {@link ColumnResizeMode#ANIMATED}.
 *
 * @param mode
 *            a ColumnResizeMode value
 * @since 7.7.5
 */
public void setColumnResizeMode(ColumnResizeMode mode) {
  getState().columnResizeMode = mode;
}

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

@Override
protected GridState getState() {
  return getState(true);
}

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

/**
 * Gets the amount of rows in Grid's body that are shown, while
 * {@link #getHeightMode()} is {@link HeightMode#ROW}.
 *
 * @return the amount of rows that are being shown in Grid's body
 * @see #setHeightByRows(double)
 */
public double getHeightByRows() {
  return getState(false).heightByRows;
}

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

/**
 * Returns the current {@link HeightMode} the Grid is in.
 * <p>
 * Defaults to {@link HeightMode#CSS}.
 *
 * @return the current HeightMode
 */
public HeightMode getHeightMode() {
  return getState(false).heightMode;
}

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

/**
 * Sets the height of a header row. If -1 (default), the row height is
 * calculated based on the theme for an empty row before the Grid is
 * displayed.
 *
 * @param rowHeight
 *            The height of a row in pixels or -1 for automatic calculation
 * @since 8.2
 */
public void setHeaderRowHeight(double rowHeight) {
  getState().headerRowHeight = rowHeight;
}

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

/**
 * Sets the height of a footer row. If -1 (default), the row height is
 * calculated based on the theme for an empty row before the Grid is
 * displayed.
 *
 * @param rowHeight
 *            The height of a row in pixels or -1 for automatic calculation
 * @since 8.2
 */
public void setFooterRowHeight(double rowHeight) {
  getState().footerRowHeight = rowHeight;
}

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

@Override
protected TreeGridState getState() {
  return (TreeGridState) super.getState();
}

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

@Override
protected TreeGridState getState(boolean markAsDirty) {
  return (TreeGridState) super.getState(markAsDirty);
}

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

/**
 * Gets the number of frozen columns in this grid. 0 means that no data
 * columns will be frozen, but the built-in selection checkbox column will
 * still be frozen if it's in use. -1 means that not even the selection
 * column is frozen.
 * <p>
 * <em>NOTE:</em> this count includes {@link Column#isHidden() hidden
 * columns} in the count.
 *
 * @see #setFrozenColumnCount(int)
 *
 * @return the number of frozen columns
 */
public int getFrozenColumnCount() {
  return getState(false).frozenColumnCount;
}

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

/**
 * Gets an unmodifiable collection of all columns currently in this
 * {@link Grid}.
 *
 * @return unmodifiable collection of columns
 */
public List<Column<T, ?>> getColumns() {
  return Collections.unmodifiableList(getState(false).columnOrder.stream()
      .map(columnKeys::get).collect(Collectors.toList()));
}

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

/**
 * {@inheritDoc}
 * <p>
 * <em>Note:</em> This method will set the height mode to be
 * {@link HeightMode#CSS}.
 *
 * @see #setHeightMode(HeightMode)
 */
@Override
public void setHeight(float height, Unit unit) {
  getState().heightMode = HeightMode.CSS;
  super.setHeight(height, unit);
}

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

/**
 * Sets whether or not column reordering is allowed. Default value is
 * <code>false</code>.
 *
 * @param columnReorderingAllowed
 *            specifies whether column reordering is allowed
 */
public void setColumnReorderingAllowed(boolean columnReorderingAllowed) {
  if (isColumnReorderingAllowed() != columnReorderingAllowed) {
    getState().columnReorderingAllowed = columnReorderingAllowed;
  }
}

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

private void setSortOrder(List<GridSortOrder<T>> order,
    boolean userOriginated) {
  Objects.requireNonNull(order, "Sort order list cannot be null");
  // Update client state to display sort order.
  List<String> sortColumns = new ArrayList<>();
  List<SortDirection> directions = new ArrayList<>();
  order.stream().forEach(sortOrder -> {
    sortColumns.add(sortOrder.getSorted().getInternalId());
    directions.add(sortOrder.getDirection());
  });
  getState().sortColumns = sortColumns.toArray(new String[0]);
  getState().sortDirs = directions.toArray(new SortDirection[0]);
  sortOrder.clear();
  sortOrder.addAll(order);
  sort(userOriginated);
}

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

private void addColumn(String identifier, Column<T, ?> column) {
  if (getColumns().contains(column)) {
    return;
  }
  column.extend(this);
  columnSet.add(column);
  columnKeys.put(identifier, column);
  column.setInternalId(identifier);
  addDataGenerator(column.getDataGenerator());
  getState().columnOrder.add(identifier);
  getHeader().addColumn(identifier);
  getFooter().addColumn(identifier);
  if (getDefaultHeaderRow() != null) {
    getDefaultHeaderRow().getCell(column).setText(column.getCaption());
  }
  column.updateSortable();
}

相关文章

Grid类方法