Class CellTreeNodeView.NodeCellList<C>
- java.lang.Object
-
- com.google.gwt.user.cellview.client.CellTreeNodeView.NodeCellList<C>
-
- Type Parameters:
C- the child item type
- All Implemented Interfaces:
HasHandlers,HasCellPreviewHandlers<C>,HasData<C>,HasRows
- Enclosing class:
- CellTreeNodeView<T>
static class CellTreeNodeView.NodeCellList<C> extends java.lang.Object implements HasData<C>
TheHasDataused to show children. This class is intentionally static because we might move it to a newCellTreeNodeView, and we don't want non-static references to the oldCellTreeNodeView.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) HasDataPresenter<C>presenter
-
Constructor Summary
Constructors Constructor Description NodeCellList(TreeViewModel.NodeInfo<C> nodeInfo, CellTreeNodeView<?> nodeView, int pageSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HandlerRegistrationaddCellPreviewHandler(CellPreviewEvent.Handler<C> handler)Adds aCellPreviewEventhandler.HandlerRegistrationaddRangeChangeHandler(RangeChangeEvent.Handler handler)Add aRangeChangeEvent.Handler.HandlerRegistrationaddRowCountChangeHandler(RowCountChangeEvent.Handler handler)Add aRowCountChangeEvent.Handler.voidcleanup()Cleanup this node view.voidfireEvent(GwtEvent<?> event)Fires the given event to the handlers listening to the event's type.intgetDefaultPageSize()intgetRowCount()Get the total count of all rows.SelectionModel<? super C>getSelectionModel()Get theSelectionModelused by thisHasData.CgetVisibleItem(int indexOnPage)Get the row value at the specified visible index.intgetVisibleItemCount()Get the number of visible items being displayed.java.util.List<C>getVisibleItems()Get anIterablecomposed of all of the visible items.RangegetVisibleRange()Get the range of visible rows.booleanisRowCountExact()Check if the total row count is exact, or an estimate.voidsetRowCount(int count)Set the exact total count of all rows.voidsetRowCount(int size, boolean isExact)Set the total count of all rows, specifying whether the count is exact or an estimate.voidsetRowData(int start, java.util.List<? extends C> values)Set a values associated with the rows in the visible range.voidsetSelectionModel(SelectionModel<? super C> selectionModel)Set theSelectionModelused by thisHasData.voidsetVisibleRange(int start, int length)Set the visible range or rows.voidsetVisibleRange(Range range)Set the visible range or rows.voidsetVisibleRangeAndClearData(Range range, boolean forceRangeChangeEvent)Set the visible range and clear the current visible data.
-
-
-
Field Detail
-
presenter
final HasDataPresenter<C> presenter
-
-
Constructor Detail
-
NodeCellList
public NodeCellList(TreeViewModel.NodeInfo<C> nodeInfo, CellTreeNodeView<?> nodeView, int pageSize)
-
-
Method Detail
-
addCellPreviewHandler
public HandlerRegistration addCellPreviewHandler(CellPreviewEvent.Handler<C> handler)
Description copied from interface:HasCellPreviewHandlersAdds aCellPreviewEventhandler.- Specified by:
addCellPreviewHandlerin interfaceHasCellPreviewHandlers<C>- Parameters:
handler- the handler- Returns:
- the registration for the event
-
addRangeChangeHandler
public HandlerRegistration addRangeChangeHandler(RangeChangeEvent.Handler handler)
Description copied from interface:HasRowsAdd aRangeChangeEvent.Handler.- Specified by:
addRangeChangeHandlerin interfaceHasRows- Parameters:
handler- the handler- Returns:
- a
HandlerRegistrationto remove the handler
-
addRowCountChangeHandler
public HandlerRegistration addRowCountChangeHandler(RowCountChangeEvent.Handler handler)
Description copied from interface:HasRowsAdd aRowCountChangeEvent.Handler.- Specified by:
addRowCountChangeHandlerin interfaceHasRows- Parameters:
handler- the handler- Returns:
- a
HandlerRegistrationto remove the handler
-
cleanup
public void cleanup()
Cleanup this node view.
-
fireEvent
public void fireEvent(GwtEvent<?> event)
Description copied from interface:HasHandlersFires the given event to the handlers listening to the event's type.Any exceptions thrown by handlers will be bundled into a
UmbrellaExceptionand then re-thrown after all handlers have completed. An exception thrown by a handler will not prevent other handlers from executing.- Specified by:
fireEventin interfaceHasHandlers- Parameters:
event- the event
-
getDefaultPageSize
public int getDefaultPageSize()
-
getRowCount
public int getRowCount()
Description copied from interface:HasRowsGet the total count of all rows.- Specified by:
getRowCountin interfaceHasRows- Returns:
- the total row count
- See Also:
HasRows.setRowCount(int)
-
getSelectionModel
public SelectionModel<? super C> getSelectionModel()
Description copied from interface:HasDataGet theSelectionModelused by thisHasData.- Specified by:
getSelectionModelin interfaceHasData<C>- Returns:
- the
SelectionModel - See Also:
HasData.setSelectionModel(SelectionModel)
-
getVisibleItem
public C getVisibleItem(int indexOnPage)
Description copied from interface:HasDataGet the row value at the specified visible index. Index 0 corresponds to the first item on the page.- Specified by:
getVisibleItemin interfaceHasData<C>- Parameters:
indexOnPage- the index on the page- Returns:
- the row value
-
getVisibleItemCount
public int getVisibleItemCount()
Description copied from interface:HasDataGet 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.- Specified by:
getVisibleItemCountin interfaceHasData<C>- Returns:
- the number of visible items on the page
-
getVisibleItems
public java.util.List<C> getVisibleItems()
Description copied from interface:HasDataGet anIterablecomposed of all of the visible items.- Specified by:
getVisibleItemsin interfaceHasData<C>- Returns:
- an
Iterableinstance
-
getVisibleRange
public Range getVisibleRange()
Description copied from interface:HasRowsGet the range of visible rows.- Specified by:
getVisibleRangein interfaceHasRows- Returns:
- the visible range
- See Also:
HasRows.setVisibleRange(Range),HasRows.setVisibleRange(int, int)
-
isRowCountExact
public boolean isRowCountExact()
Description copied from interface:HasRowsCheck if the total row count is exact, or an estimate.- Specified by:
isRowCountExactin interfaceHasRows- Returns:
- true if exact, false if an estimate
-
setRowCount
public final void setRowCount(int count)
Description copied from interface:HasRowsSet the exact total count of all rows. This method defers toHasRows.setRowCount(int, boolean).- Specified by:
setRowCountin interfaceHasRows- Parameters:
count- the exact total count- See Also:
HasRows.getRowCount()
-
setRowCount
public void setRowCount(int size, boolean isExact)Description copied from interface:HasRowsSet the total count of all rows, specifying whether the count is exact or an estimate.- Specified by:
setRowCountin interfaceHasRows- Parameters:
size- the total countisExact- true if the count is exact, false if an estimate- See Also:
HasRows.getRowCount()
-
setRowData
public void setRowData(int start, java.util.List<? extends C> values)Description copied from interface:HasDataSet 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.- Specified by:
setRowDatain interfaceHasData<C>- Parameters:
start- the start index of the datavalues- the values within the range
-
setSelectionModel
public void setSelectionModel(SelectionModel<? super C> selectionModel)
Description copied from interface:HasDataSet theSelectionModelused by thisHasData.- Specified by:
setSelectionModelin interfaceHasData<C>- Parameters:
selectionModel- theSelectionModel- See Also:
HasData.getSelectionModel()
-
setVisibleRange
public final void setVisibleRange(int start, int length)Description copied from interface:HasRowsSet the visible range or rows. This method defers toHasRows.setVisibleRange(Range).- Specified by:
setVisibleRangein interfaceHasRows- Parameters:
start- the start indexlength- the length- See Also:
HasRows.getVisibleRange()
-
setVisibleRange
public void setVisibleRange(Range range)
Description copied from interface:HasRowsSet the visible range or rows.- Specified by:
setVisibleRangein interfaceHasRows- Parameters:
range- the visible range- See Also:
HasRows.getVisibleRange()
-
setVisibleRangeAndClearData
public void setVisibleRangeAndClearData(Range range, boolean forceRangeChangeEvent)
Description copied from interface:HasDataSet 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.- Specified by:
setVisibleRangeAndClearDatain interfaceHasData<C>- Parameters:
range- the newRangeforceRangeChangeEvent- true to fire aRangeChangeEventeven if theRangedoesn't change
-
-