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 theSelectionModel
used by thisHasData
.getVisibleItem
(int indexOnPage) Get the row value at the specified visible index.int
Get the number of visible items being displayed.Get anIterable
composed of all of the visible items.void
setRowData
(int start, List<? extends T> values) Set a values associated with the rows in the visible range.void
setSelectionModel
(SelectionModel<? super T> selectionModel) Set theSelectionModel
used by thisHasData
.void
setVisibleRangeAndClearData
(Range range, boolean forceRangeChangeEvent) Set the visible range and clear the current visible data.Methods inherited from interface com.google.gwt.view.client.HasCellPreviewHandlers
addCellPreviewHandler
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
Methods 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 theSelectionModel
used 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 anIterable
composed of all of the visible items.- Returns:
- an
Iterable
instance
-
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 theSelectionModel
used by thisHasData
.- Parameters:
selectionModel
- theSelectionModel
- See Also:
-
setVisibleRangeAndClearData
Set the visible range and clear the current visible data.
If the second argument
forceRangeChangeEvent
is true, aRangeChangeEvent
will be fired even if the range does not change. If false, aRangeChangeEvent
will only be fired if the range changes.- Parameters:
range
- the newRange
forceRangeChangeEvent
- true to fire aRangeChangeEvent
even if theRange
doesn't change
-