public class

CellList

extends AbstractHasData<T>
java.lang.Object
   ↳ com.google.gwt.user.client.ui.UIObject
     ↳ com.google.gwt.user.client.ui.Widget
       ↳ com.google.gwt.user.cellview.client.AbstractHasData<T>
         ↳ com.google.gwt.user.cellview.client.CellList<T>

Class Overview

A single column list of cells.

Examples

Trivial example
{@example com.google.gwt.examples.cellview.CellListExample}
ValueUpdater example
{@example com.google.gwt.examples.cellview.CellListValueUpdaterExample}
Key provider example
{@example com.google.gwt.examples.view.KeyProviderExample}

Summary

Nested Classes
interface CellList.Resources A ClientBundle that provides images for this widget. 
interface CellList.Style Styles used by this widget. 
[Expand]
Inherited Constants
From class com.google.gwt.user.client.ui.UIObject
Public Constructors
CellList(Cell<T> cell)
Construct a new CellList.
CellList(Cell<T> cell, CellList.Resources resources)
Construct a new CellList with the specified CellList.Resources.
CellList(Cell<T> cell, ProvidesKey<T> keyProvider)
Construct a new CellList with the specified key provider.
CellList(Cell<T> cell, CellList.Resources resources, ProvidesKey<T> keyProvider)
Construct a new CellList with the specified CellList.Resources and key provider.
Public Methods
SafeHtml getEmptyListMessage()
Get the message that is displayed when there is no data.
Element getRowElement(int indexOnPage)
Get the Element for the specified index.
void setEmptyListMessage(SafeHtml html)
Set the message to display when there is no data.
void setValueUpdater(ValueUpdater<T> valueUpdater)
Set the value updater to use when cells modify items.
Protected Methods
boolean dependsOnSelection()
Check whether or not the cells in the view depend on the selection state.
void doSelection(Event event, T value, int indexOnPage)
void fireEventToCell(Cell.Context context, Event event, Element parent, T value)
Fire an event to the cell.
Cell<T> getCell()
Return the cell used to render each item.
Element getCellParent(Element item)
Get the parent element that wraps the cell from the list item.
Element getChildContainer()
Return the element that holds the rendered cells.
Element getKeyboardSelectedElement()
Get the element that has keyboard selection.
boolean isKeyboardNavigationSuppressed()
Check if keyboard navigation is being suppressed, such as when the user is editing a cell.
void onBlur()
Called when the widget is blurred.
void onBrowserEvent2(Event event)
Called after onBrowserEvent(Event) completes.
void onFocus()
Called when the widget is focused.
void renderRowValues(SafeHtmlBuilder sb, List<T> values, int start, SelectionModel<? super T> selectionModel)
Render all row values into the specified SafeHtmlBuilder.
boolean resetFocusOnCell()
Reset focus on the currently focused cell.
void setKeyboardSelected(int index, boolean selected, boolean stealFocus)
Update an element to reflect its keyboard selected state.
void setSelected(Element elem, boolean selected)
This method is deprecated. this method is never called by AbstractHasData, render the selected styles in renderRowValues(SafeHtmlBuilder, List, int, SelectionModel)
[Expand]
Inherited Methods
From class com.google.gwt.user.cellview.client.AbstractHasData
From class com.google.gwt.user.client.ui.Widget
From class com.google.gwt.user.client.ui.UIObject
From class java.lang.Object
From interface com.google.gwt.event.logical.shared.HasAttachHandlers
From interface com.google.gwt.event.shared.HasHandlers
From interface com.google.gwt.user.cellview.client.HasKeyboardPagingPolicy
From interface com.google.gwt.user.cellview.client.HasKeyboardSelectionPolicy
From interface com.google.gwt.user.client.EventListener
From interface com.google.gwt.user.client.ui.Focusable
From interface com.google.gwt.user.client.ui.IsWidget
From interface com.google.gwt.view.client.HasCellPreviewHandlers
From interface com.google.gwt.view.client.HasData
From interface com.google.gwt.view.client.HasKeyProvider
From interface com.google.gwt.view.client.HasRows

Public Constructors

public CellList (Cell<T> cell)

Construct a new CellList.

Parameters
cell the cell used to render each item

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

public CellList (Cell<T> cell, ProvidesKey<T> keyProvider)

Construct a new CellList with the specified key provider.

Parameters
cell the cell used to render each item
keyProvider an instance of ProvidesKey, or null if the record object should act as its own key

public CellList (Cell<T> cell, CellList.Resources resources, ProvidesKey<T> keyProvider)

Construct a new CellList with the specified CellList.Resources and key provider.

Parameters
cell the cell used to render each item
resources the resources used for this widget
keyProvider an instance of ProvidesKey, or null if the record object should act as its own key

Public Methods

public SafeHtml getEmptyListMessage ()

Get the message that is displayed when there is no data.

Returns
  • the empty message

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
IndexOutOfBoundsException if the index is outside of the current page

public void setEmptyListMessage (SafeHtml html)

Set the message to display when there is no data.

Parameters
html the message to display when there are no results

public void setValueUpdater (ValueUpdater<T> valueUpdater)

Set the value updater to use when cells modify items.

Parameters
valueUpdater the ValueUpdater

Protected Methods

protected boolean dependsOnSelection ()

Check whether or not the cells in the view depend on the selection state.

Returns
  • true if cells depend on selection, false if not

protected void doSelection (Event event, T value, int indexOnPage)

This method is deprecated.
use addCellPreviewHandler(com.google.gwt.view.client.CellPreviewEvent.Handler) instead

Called when a user action triggers selection.

Parameters
event the event that triggered selection
value the value that was selected
indexOnPage the index of the value on the page

protected void fireEventToCell (Cell.Context context, Event event, Element parent, T value)

Fire an event to the cell.

Parameters
context the Cell.Context of the cell
event the event that was fired
parent the parent of the cell
value the value of the cell

protected Cell<T> getCell ()

Return the cell used to render each item.

protected Element getCellParent (Element item)

Get the parent element that wraps the cell from the list item. Override this method if you add structure to the element.

Parameters
item the row element that wraps the list item
Returns
  • the parent element of the cell

protected Element getChildContainer ()

Return the element that holds the rendered cells.

Returns

protected Element getKeyboardSelectedElement ()

Get the element that has keyboard selection.

Returns
  • the keyboard selected element

protected boolean isKeyboardNavigationSuppressed ()

Check if keyboard navigation is being suppressed, such as when the user is editing a cell.

Returns
  • true if suppressed, false if not

protected void onBlur ()

Called when the widget is blurred.

protected void onBrowserEvent2 (Event event)

Called after onBrowserEvent(Event) completes.

Parameters
event the event that was fired

protected void onFocus ()

Called when the widget is focused.

protected void renderRowValues (SafeHtmlBuilder sb, List<T> values, int start, SelectionModel<? super T> selectionModel)

Render all row values into the specified SafeHtmlBuilder.

Parameters
sb the SafeHtmlBuilder to render into
values the row values
start the absolute start index of the values
selectionModel the SelectionModel

protected boolean resetFocusOnCell ()

Reset focus on the currently focused cell.

Returns
  • true if focus is taken, false if not

protected void setKeyboardSelected (int index, boolean selected, boolean stealFocus)

Update an element to reflect its keyboard selected state.

Parameters
index the index of the element
selected true if selected, false if not
stealFocus true if the row should steal focus, false if not

protected void setSelected (Element elem, boolean selected)

This method is deprecated.
this method is never called by AbstractHasData, render the selected styles in renderRowValues(SafeHtmlBuilder, List, int, SelectionModel)

Update an element to reflect its selected state.

Parameters
elem the element to update
selected true if selected, false if not