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

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

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

Grid.setSortOrder介绍

[英]Sets the sort order to use, given a GridSortOrderBuilder. Shorthand for setSortOrder(builder.build()).
[中]设置要使用的排序顺序(给定GridSortOrderBuilder)。setSortOrder(builder.build())的简写。

代码示例

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

/**
 * Sets the sort order to use.
 *
 * @param order
 *            a sort order list.
 *
 * @throws IllegalArgumentException
 *             if order is null
 */
public void setSortOrder(List<GridSortOrder<T>> order) {
  setSortOrder(order, false);
}

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

/**
 * Clear the current sort order, and re-sort the grid.
 */
public void clearSortOrder() {
  setSortOrder(Collections.emptyList());
}

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

/**
 * Sets the sort order to use, given a {@link GridSortOrderBuilder}.
 * Shorthand for {@code setSortOrder(builder.build())}.
 *
 * @see GridSortOrderBuilder
 *
 * @param builder
 *            the sort builder to retrieve the sort order from
 * @throws NullPointerException
 *             if builder is null
 */
public void setSortOrder(GridSortOrderBuilder<T> builder) {
  Objects.requireNonNull(builder, "Sort builder cannot be null");
  setSortOrder(builder.build());
}

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

/**
 * Sort this Grid in user-specified direction by a column.
 *
 * @param column
 *            a column to sort against
 * @param direction
 *            a sort order value (ascending/descending)
 *
 */
public void sort(Column<T, ?> column, SortDirection direction) {
  setSortOrder(Collections
      .singletonList(new GridSortOrder<>(column, direction)));
}

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

.collect(Collectors.toList());
if (filteredSortOrder.size() < sortOrder.size()) {
  setSortOrder(filteredSortOrder);

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

com.vaadin.shared.data.sort.SortDirection.valueOf(sortDirection))
);
component.setSortOrder(sortOrders);

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

@SuppressWarnings("unchecked")
@Override
public void sort(ItemSort<P>... sorts) {
  if (sorts != null && sorts.length > 0) {
    List<GridSortOrder<T>> orders = new LinkedList<>();
    for (ItemSort<P> sort : sorts) {
      String columnId = getColumnId(sort.getProperty());
      if (columnId != null) {
        Column<T, ?> column = getGrid().getColumn(columnId);
        if (column != null) {
          orders.add(new GridSortOrder<>(column,
              sort.isAscending() ? SortDirection.ASCENDING : SortDirection.DESCENDING));
        }
      }
    }
    if (!orders.isEmpty()) {
      getGrid().setSortOrder(orders);
    }
  }
}

代码示例来源:origin: jpos/jPOS-EE

@Override
public void showGeneralView() {
  super.showGeneralView();
  editMode = false;
  shouldReverse = false;
  if (getGrid() != null) {
    getGrid().setSortOrder(GridSortOrder.asc(getGrid().getColumn("id")));
  }
}

相关文章

Grid类方法