/** * Update data. */ public void updateData() { List<T> filteredData = dataGrid.filter(data); if (dataFilter != null) { List<T> newFilteredData = new ArrayList<>(); for (T value : filteredData) { if (dataFilter.accept(value)) { newFilteredData.add(value); } } filteredData = newFilteredData; } updateRowCount(filteredData.size(), true); ColumnSortList sortList = dataGrid.getDataGrid().getColumnSortList(); Column<?, ?> column = (sortList == null || sortList.size() == 0) ? null : sortList.get(0).getColumn(); boolean isSortAscending = !(sortList == null || sortList.size() == 0) && sortList.get(0).isAscending(); if (column != null) { dataGrid.sort(filteredData, column, isSortAscending); } updateRowData(0, filteredData); }
/** * Push a {@link Column} onto the list at index zero, setting ascending to * true. If the column already exists, it will be removed from its current * position and placed at the start of the list. If the Column is already at * the start of the list, its ascending bit will be flipped (ascending to * descending and vice versa). * * @param column the {@link Column} to push * @return the {@link ColumnSortInfo} that was pushed */ public ColumnSortInfo push(Column<?, ?> column) { // If the column matches the primary column, toggle the order. boolean ascending = (column == null) ? true : column.isDefaultSortAscending(); if (size() > 0 && get(0).getColumn() == column) { ascending = !get(0).isAscending(); } // Push the new column. ColumnSortInfo toRet = new ColumnSortInfo(column, ascending); push(toRet); return toRet; }
/** * Remove a {@link ColumnSortInfo} from the list. * * @param sortInfo the {@link ColumnSortInfo} to remove */ public boolean remove(ColumnSortInfo sortInfo) { boolean toRet = infos.remove(sortInfo); fireDelegate(); return toRet; }
/** * Mark a {@linkplain ColumnSortInfo#getColumn column} as sorted. * * @see #getColumnSortList */ protected void pushColumnSort(ColumnSortInfo columnSortInfo) { getColumnSortList().push(columnSortInfo); }
ColumnSortList sortList = dataTable.getColumnSortList(); Column<?, ?> column = sortList.get(0).getColumn();
/** * Mark all columns as un-sorted. * * @see #getColumnSortList */ protected void clearColumnSort() { getColumnSortList().clear(); }
/** * Push a {@link ColumnSortInfo} onto the list at index zero. If the column * already exists, it will be removed from its current position and placed at * the start of the list. * * @param sortInfo the {@link ColumnSortInfo} to push */ public void push(ColumnSortInfo sortInfo) { insert(0, sortInfo); }
sortList.push(column); updatingSortList = false; ColumnSortEvent.fire(this, sortList);
ColumnSortInfo columnSortInfo = event.getColumnSortList().get(0); if (sortApplied) { pushColumnSort(columnSortInfo);
/** * Push a {@link ColumnSortInfo} onto the list at index zero. If the column * already exists, it will be removed from its current position and placed at * the start of the list. * * @param sortInfo the {@link ColumnSortInfo} to push */ public void push(ColumnSortInfo sortInfo) { insert(0, sortInfo); }
@Override public void initColumns(ExtendedPagedTable extendedPagedTable) { Column processNameColumn = initProcessNameColumn(); Column versionColumn = initVersionColumn(); Column deploymentColumn = initDeploymentColumn(); ColumnMeta<ProcessSummary> actionsColumnMeta = initActionsColumn(); List<ColumnMeta<ProcessSummary>> columnMetas = new ArrayList<ColumnMeta<ProcessSummary>>(); columnMetas.add(new ColumnMeta<>(processNameColumn, constants.Name())); columnMetas.add(new ColumnMeta<>(versionColumn, constants.Version())); columnMetas.add(new ColumnMeta<>(deploymentColumn, constants.Deployment_Name())); columnMetas.add(actionsColumnMeta); extendedPagedTable.addSelectionIgnoreColumn(actionsColumnMeta.getColumn()); extendedPagedTable.addColumns(columnMetas); extendedPagedTable.setColumnWidth(actionsColumnMeta.getColumn(), AbstractMultiGridView.ACTIONS_COLUMN_WIDTH, Style.Unit.PX); extendedPagedTable.getColumnSortList().push(processNameColumn); }
/** * Push a {@link Column} onto the list at index zero, setting ascending to * true. If the column already exists, it will be removed from its current * position and placed at the start of the list. If the Column is already at * the start of the list, its ascending bit will be flipped (ascending to * descending and vice versa). * * @param column the {@link Column} to push * @return the {@link ColumnSortInfo} that was pushed */ public ColumnSortInfo push(Column<?, ?> column) { // If the column matches the primary column, toggle the order. boolean ascending = (column == null) ? true : column.isDefaultSortAscending(); if (size() > 0 && get(0).getColumn() == column) { ascending = !get(0).isAscending(); } // Push the new column. ColumnSortInfo toRet = new ColumnSortInfo(column, ascending); push(toRet); return toRet; }
public void setItems(List<T> persons) { List<T> list = dataProvider.getList(); list.clear(); if (persons != null) { list.addAll(persons); } SetSelectionModel<T> selectionModel = getSelectionModel(); if (selectionModel != null) { selectionModel.clear(); } dataProvider.flush(); ColumnSortList sortList = dataTable.getColumnSortList(); sortList.clear(); if (defaultSortColumnIndex != null) { sortList.push(dataTable.getColumn(defaultSortColumnIndex)); } getPager().setDisplay(dataTable); getPager().setPage(0); }
/** * Removes all of the elements from this list. */ public void clear() { infos.clear(); fireDelegate(); }
/** * Push a {@link ColumnSortInfo} onto the list at index zero. If the column * already exists, it will be removed from its current position and placed at * the start of the list. * * @param sortInfo the {@link ColumnSortInfo} to push */ public void push(ColumnSortInfo sortInfo) { insert(0, sortInfo); }
/** * Click on a specific header of a cell table. * * @param table The targeted cell table * @param index The targeted cell header index in the table */ public static void clickHeader(AbstractCellTable<?> table, int index) { BrowserSimulatorImpl.get().fireLoopEnd(); table.getColumnSortList().push(table.getColumn(index)); ColumnSortEvent.fire(table, table.getColumnSortList()); BrowserSimulatorImpl.get().fireLoopEnd(); }