com.google.gwt.user.cellview.client
Class CellList<T>

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.google.gwt.user.cellview.client.CellList<T>
Type Parameters:
T - the data type of list items
All Implemented Interfaces:
HasHandlers, EventListener, ListView<T>, PagingListView<T>

public class CellList<T>
extends Widget
implements PagingListView<T>

A single column list of cells.


Nested Class Summary
static interface CellList.Resources
          A ClientBundle that provides images for this widget.
static interface CellList.Style
          Styles used by this widget.
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
 
Nested classes/interfaces inherited from interface com.google.gwt.view.client.PagingListView
PagingListView.Pager<T>
 
Nested classes/interfaces inherited from interface com.google.gwt.view.client.ListView
ListView.Delegate<T>
 
Field Summary
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
CellList(Cell<T> cell)
          Construct a new CellList.
CellList(Cell<T> cell, CellList.Resources resources)
          Construct a new CellList with the specified CellList.Resources.
 
Method Summary
 int getDataSize()
          Get the total data size.
 T getDisplayedItem(int indexOnPage)
          Get the value of a displayed item.
 java.util.List<T> getDisplayedItems()
           
 java.lang.String getEmptyListMessage()
          Get the message that is displayed when there is no data.
 int getPageSize()
           
 int getPageStart()
           
 Range getRange()
          Get the range that this view is displaying.
 Element getRowElement(int indexOnPage)
          Get the Element for the specified index.
 boolean isDataSizeExact()
          Returns the value of the 'isExact' parameter of the most recent call to ListView.setDataSize(int, boolean).
 void onBrowserEvent(Event event)
          Fired whenever a browser event is received.
 void redraw()
          Redraw the list using the existing data.
 void setData(int start, int length, java.util.List<T> values)
          Set a range of data in the view.
 void setDataSize(int size, boolean isExact)
          Set the total data size of the underlying data.
 void setDelegate(ListView.Delegate<T> delegate)
          Set the ListView.Delegate that responds to changes in the range.
 void setEmptyListMessage(java.lang.String html)
          Set the message to display when there is no data.
 void setPager(PagingListView.Pager<T> pager)
          Set the PagingListView.Pager that allows the user to change the range.
 void setPageSize(int pageSize)
          Set the page size.
 void setPageStart(int pageStart)
          Set the page start index.
 void setRange(int start, int length)
          Set a new range.
 void setSelectionModel(SelectionModel<? super T> selectionModel)
          Set the SelectionModel used by this ListView.
 void setValueUpdater(ValueUpdater<T> valueUpdater)
          Set the value updater to use when cells modify items.
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
fireEvent, getLayoutData, getParent, isAttached, removeFromParent, setLayoutData, sinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, isVisible, removeStyleDependentName, removeStyleName, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CellList

public CellList(Cell<T> cell)
Construct a new CellList.

Parameters:
cell - the cell used to render each item

CellList

public CellList(Cell<T> cell,
                CellList.Resources resources)
Construct a new CellList with the specified CellList.Resources.

Parameters:
cell - the cell used to render each item
resources - the resources used for this widget
Method Detail

getDataSize

public int getDataSize()
Description copied from interface: PagingListView
Get the total data size.

Specified by:
getDataSize in interface PagingListView<T>

getDisplayedItem

public T getDisplayedItem(int indexOnPage)
Get the value of a displayed item.

Parameters:
indexOnPage - the index on the page
Returns:
the value

getDisplayedItems

public java.util.List<T> getDisplayedItems()

getEmptyListMessage

public java.lang.String getEmptyListMessage()
Get the message that is displayed when there is no data.

Returns:
the empty message

getPageSize

public final int getPageSize()

getPageStart

public final int getPageStart()

getRange

public Range getRange()
Description copied from interface: ListView
Get the range that this view is displaying.

Specified by:
getRange in interface ListView<T>
Returns:
the range

getRowElement

public Element getRowElement(int indexOnPage)
Get the Element for the specified index. If the element has not been created, null is returned.

Parameters:
indexOnPage - the index on the page
Returns:
the element, or null if it doesn't exists
Throws:
java.lang.IndexOutOfBoundsException - if the index is outside of the current page

isDataSizeExact

public boolean isDataSizeExact()
Description copied from interface: ListView
Returns the value of the 'isExact' parameter of the most recent call to ListView.setDataSize(int, boolean).

Specified by:
isDataSizeExact in interface ListView<T>

onBrowserEvent

public void onBrowserEvent(Event event)
Description copied from interface: EventListener
Fired whenever a browser event is received.

Specified by:
onBrowserEvent in interface EventListener
Overrides:
onBrowserEvent in class Widget
Parameters:
event - the event received

redraw

public void redraw()
Redraw the list using the existing data.


setData

public void setData(int start,
                    int length,
                    java.util.List<T> values)
Description copied from interface: ListView
Set a range of data in the view.

Specified by:
setData in interface ListView<T>
Parameters:
start - the start index of the data
length - the length of the data
values - the values within the range

setDataSize

public void setDataSize(int size,
                        boolean isExact)
Description copied from interface: ListView
Set the total data size of the underlying data.

Specified by:
setDataSize in interface ListView<T>
Parameters:
size - the total data size
isExact - true if the size is exact, false if it is an estimate

setDelegate

public void setDelegate(ListView.Delegate<T> delegate)
Description copied from interface: ListView
Set the ListView.Delegate that responds to changes in the range.

Specified by:
setDelegate in interface ListView<T>
Parameters:
delegate - the ListView.Delegate

setEmptyListMessage

public void setEmptyListMessage(java.lang.String html)
Set the message to display when there is no data.

Parameters:
html - the message to display when there are no results

setPager

public void setPager(PagingListView.Pager<T> pager)
Description copied from interface: PagingListView
Set the PagingListView.Pager that allows the user to change the range.

Specified by:
setPager in interface PagingListView<T>
Parameters:
pager - the PagingListView.Pager

setPageSize

public final void setPageSize(int pageSize)
Set the page size.

Parameters:
pageSize - the new page size

setPageStart

public final void setPageStart(int pageStart)
Set the page start index.

Parameters:
pageStart - the new page start

setRange

public void setRange(int start,
                     int length)
Description copied from interface: PagingListView
Set a new range.

Specified by:
setRange in interface PagingListView<T>
Parameters:
start - the new start index
length - the new page size

setSelectionModel

public void setSelectionModel(SelectionModel<? super T> selectionModel)
Description copied from interface: ListView
Set the SelectionModel used by this ListView.

Specified by:
setSelectionModel in interface ListView<T>
Parameters:
selectionModel - the SelectionModel

setValueUpdater

public void setValueUpdater(ValueUpdater<T> valueUpdater)
Set the value updater to use when cells modify items.

Parameters:
valueUpdater - the ValueUpdater