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

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

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

Table.sort介绍

[英]Sorts the table by currently selected sorting column.
[中]按当前选定的排序列对表进行排序。

代码示例

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

  1. /**
  2. * Sorts the table by currently selected sorting column.
  3. *
  4. * @throws UnsupportedOperationException
  5. * if the container data source does not implement
  6. * Container.Sortable
  7. */
  8. public void sort() {
  9. if (getSortContainerPropertyId() == null) {
  10. return;
  11. }
  12. sort(new Object[] { sortContainerPropertyId },
  13. new boolean[] { sortAscending });
  14. }

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

  1. /**
  2. * Internal method to set sort ascending. With doSort flag actual sort can
  3. * be bypassed.
  4. *
  5. * @param ascending
  6. * @param doSort
  7. */
  8. private void setSortAscending(boolean ascending, boolean doSort) {
  9. if (sortAscending != ascending) {
  10. sortAscending = ascending;
  11. if (doSort) {
  12. sort();
  13. // Assures the visual refresh. This should not be necessary as
  14. // sort() calls refreshRowCache
  15. refreshRenderedCells();
  16. }
  17. }
  18. }

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

  1. /**
  2. * Internal method to set currently sorted column property id. With doSort
  3. * flag actual sorting may be bypassed.
  4. *
  5. * @param propertyId
  6. * @param doSort
  7. */
  8. private void setSortContainerPropertyId(Object propertyId, boolean doSort) {
  9. if ((sortContainerPropertyId != null
  10. && !sortContainerPropertyId.equals(propertyId))
  11. || (sortContainerPropertyId == null && propertyId != null)) {
  12. sortContainerPropertyId = propertyId;
  13. if (doSort) {
  14. sort();
  15. // Assures the visual refresh. This should not be necessary as
  16. // sort() calls refreshRowCache
  17. refreshRenderedCells();
  18. }
  19. }
  20. }

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

  1. @Override
  2. public void sortBy(Object propertyId, boolean ascending) {
  3. if (isSortable()) {
  4. component.setSortAscending(ascending);
  5. component.setSortContainerPropertyId(propertyId);
  6. component.sort();
  7. }
  8. }

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

  1. @Override
  2. public void sort(String columnId, SortDirection direction) {
  3. Column column = getColumn(columnId);
  4. if (column == null) {
  5. throw new IllegalArgumentException("Unable to find column " + columnId);
  6. }
  7. if (isSortable()) {
  8. component.setSortAscending(direction == SortDirection.ASCENDING);
  9. component.setSortContainerPropertyId(column.getId());
  10. component.sort();
  11. }
  12. }

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

  1. void refreshTable() {
  2. if (m_table != null) {
  3. m_beanItemContainer = WallboardProvider.getInstance().getBeanContainer();
  4. m_table.setContainerDataSource(m_beanItemContainer);
  5. m_table.setVisibleColumns(new Object[]{"title", "Edit", "Remove", "Preview", "Default"});
  6. m_table.setColumnHeader("title", "Title");
  7. m_table.sort();
  8. m_table.refreshRowCache();
  9. }
  10. }
  11. }

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

  1. this.sort();
  2. resetPageBuffer();

代码示例来源:origin: viritin/viritin

  1. super.sort(propertyId, ascending);
  2. defaultTableSortingMethod = true;

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

  1. m_table.sort(new Object[]{"name"}, new boolean[]{true});

相关文章

Table类方法