/** * Sorts the table by currently selected sorting column. * * @throws UnsupportedOperationException * if the container data source does not implement * Container.Sortable */ public void sort() { if (getSortContainerPropertyId() == null) { return; } sort(new Object[] { sortContainerPropertyId }, new boolean[] { sortAscending }); }
/** * Internal method to set sort ascending. With doSort flag actual sort can * be bypassed. * * @param ascending * @param doSort */ private void setSortAscending(boolean ascending, boolean doSort) { if (sortAscending != ascending) { sortAscending = ascending; if (doSort) { sort(); // Assures the visual refresh. This should not be necessary as // sort() calls refreshRowCache refreshRenderedCells(); } } }
/** * Internal method to set currently sorted column property id. With doSort * flag actual sorting may be bypassed. * * @param propertyId * @param doSort */ private void setSortContainerPropertyId(Object propertyId, boolean doSort) { if ((sortContainerPropertyId != null && !sortContainerPropertyId.equals(propertyId)) || (sortContainerPropertyId == null && propertyId != null)) { sortContainerPropertyId = propertyId; if (doSort) { sort(); // Assures the visual refresh. This should not be necessary as // sort() calls refreshRowCache refreshRenderedCells(); } } }
@Override public void sortBy(Object propertyId, boolean ascending) { if (isSortable()) { component.setSortAscending(ascending); component.setSortContainerPropertyId(propertyId); component.sort(); } }
@Override public void sort(String columnId, SortDirection direction) { Column column = getColumn(columnId); if (column == null) { throw new IllegalArgumentException("Unable to find column " + columnId); } if (isSortable()) { component.setSortAscending(direction == SortDirection.ASCENDING); component.setSortContainerPropertyId(column.getId()); component.sort(); } }
void refreshTable() { if (m_table != null) { m_beanItemContainer = WallboardProvider.getInstance().getBeanContainer(); m_table.setContainerDataSource(m_beanItemContainer); m_table.setVisibleColumns(new Object[]{"title", "Edit", "Remove", "Preview", "Default"}); m_table.setColumnHeader("title", "Title"); m_table.sort(); m_table.refreshRowCache(); } } }
this.sort(); resetPageBuffer();
super.sort(propertyId, ascending); defaultTableSortingMethod = true;
m_table.sort(new Object[]{"name"}, new boolean[]{true});