Package com.google.gwt.view.client
Interface HasData<T>
- Type Parameters:
T- the data type of each row
- All Superinterfaces:
HasCellPreviewHandlers<T>,HasHandlers,HasRows
- All Known Implementing Classes:
AbstractCellTable,AbstractHasData,CellBrowser.BrowserCellList,CellList,CellTable,CellTreeNodeView.NodeCellList,DataGrid,HasDataPresenter
A view that can display a range of data.
-
Method Summary
Modifier and TypeMethodDescriptionSelectionModel<? super T>Get theSelectionModelused by thisHasData.getVisibleItem(int indexOnPage) Get the row value at the specified visible index.intGet the number of visible items being displayed.Get anIterablecomposed of all of the visible items.voidsetRowData(int start, List<? extends T> values) Set a values associated with the rows in the visible range.voidsetSelectionModel(SelectionModel<? super T> selectionModel) Set theSelectionModelused by thisHasData.voidsetVisibleRangeAndClearData(Range range, boolean forceRangeChangeEvent) Set the visible range and clear the current visible data.Methods inherited from interface com.google.gwt.view.client.HasCellPreviewHandlers
addCellPreviewHandlerMethods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEventMethods inherited from interface com.google.gwt.view.client.HasRows
addRangeChangeHandler, addRowCountChangeHandler, getRowCount, getVisibleRange, isRowCountExact, setRowCount, setRowCount, setVisibleRange, setVisibleRange
-
Method Details
-
getSelectionModel
SelectionModel<? super T> getSelectionModel()Get theSelectionModelused by thisHasData.- Returns:
- the
SelectionModel - See Also:
-
getVisibleItem
Get the row value at the specified visible index. Index 0 corresponds to the first item on the page.- Parameters:
indexOnPage- the index on the page- Returns:
- the row value
-
getVisibleItemCount
int getVisibleItemCount()Get the number of visible items being displayed. Note that this value might be less than the page size if there is not enough data to fill the page.- Returns:
- the number of visible items on the page
-
getVisibleItems
Get anIterablecomposed of all of the visible items.- Returns:
- an
Iterableinstance
-
setRowData
Set a values associated with the rows in the visible range.
This method does not replace all rows in the display; it replaces the row values starting at the specified start index through the length of the specified values. You must call
HasRows.setRowCount(int)to set the total number of rows in the display. You should also useHasRows.setRowCount(int)to remove rows when the total number of rows decreases.- Parameters:
start- the start index of the datavalues- the values within the range
-
setSelectionModel
Set theSelectionModelused by thisHasData.- Parameters:
selectionModel- theSelectionModel- See Also:
-
setVisibleRangeAndClearData
Set the visible range and clear the current visible data.
If the second argument
forceRangeChangeEventis true, aRangeChangeEventwill be fired even if the range does not change. If false, aRangeChangeEventwill only be fired if the range changes.- Parameters:
range- the newRangeforceRangeChangeEvent- true to fire aRangeChangeEventeven if theRangedoesn't change
-