public interface

Cell

com.google.gwt.cell.client.Cell<C>
Known Indirect Subclasses

Class Overview

A light weight representation of a renderable object.

Example

{@example com.google.gwt.examples.cell.CellExample}

Summary

Nested Classes
class Cell.Context Contains information about the context of the Cell. 
Public Methods
abstract boolean dependsOnSelection()
Check if this cell depends on the selection state.
abstract Set<String> getConsumedEvents()
Get the set of events that this cell consumes.
abstract boolean handlesSelection()
Check if this cell handles selection.
abstract boolean isEditing(Cell.Context context, Element parent, C value)
Returns true if the cell is currently editing the data identified by the given element and key.
abstract void onBrowserEvent(Cell.Context context, Element parent, C value, NativeEvent event, ValueUpdater<C> valueUpdater)
Handle a browser event that took place within the cell.
abstract void render(Cell.Context context, C value, SafeHtmlBuilder sb)
Render a cell as HTML into a SafeHtmlBuilder, suitable for passing to setInnerHTML(String) on a container element.
abstract boolean resetFocus(Cell.Context context, Element parent, C value)
Reset focus on the Cell.
abstract void setValue(Cell.Context context, Element parent, C value)
This method may be used by cell containers to set the value on a single cell directly, rather than using setInnerHTML(String).

Public Methods

public abstract boolean dependsOnSelection ()

Check if this cell depends on the selection state.

Returns
  • true if dependent on selection, false if not

public abstract Set<String> getConsumedEvents ()

Get the set of events that this cell consumes. The container that uses this cell should only pass these events to when the event occurs.

The returned value should not be modified, and may be an unmodifiable set. Changes to the return value may not be reflected in the cell.

Returns
  • the consumed events, or null if no events are consumed

public abstract boolean handlesSelection ()

Check if this cell handles selection. If the cell handles selection, then its container should not automatically handle selection.

Returns
  • true if the cell handles selection, false if not

public abstract boolean isEditing (Cell.Context context, Element parent, C value)

Returns true if the cell is currently editing the data identified by the given element and key. While a cell is editing, widgets containing the cell may choose to pass keystrokes directly to the cell rather than using them for navigation purposes.

Parameters
context the Cell.Context of the cell
parent the parent Element
value the value associated with the cell
Returns
  • true if the cell is in edit mode

public abstract void onBrowserEvent (Cell.Context context, Element parent, C value, NativeEvent event, ValueUpdater<C> valueUpdater)

Handle a browser event that took place within the cell. The default implementation returns null.

Parameters
context the Cell.Context of the cell
parent the parent Element
value the value associated with the cell
event the native browser event
valueUpdater a ValueUpdater, or null if not specified

public abstract void render (Cell.Context context, C value, SafeHtmlBuilder sb)

Render a cell as HTML into a SafeHtmlBuilder, suitable for passing to setInnerHTML(String) on a container element.

Note: If your cell contains natively focusable elements, such as buttons or input elements, be sure to set the tabIndex to -1 so that they do not steal focus away from the containing widget.

Parameters
context the Cell.Context of the cell
value the cell value to be rendered
sb the SafeHtmlBuilder to be written to

public abstract boolean resetFocus (Cell.Context context, Element parent, C value)

Reset focus on the Cell. This method is called if the cell has focus when it is refreshed.

Parameters
context the Cell.Context of the cell
parent the parent Element
value the value associated with the cell
Returns
  • true if focus is taken, false if not

public abstract void setValue (Cell.Context context, Element parent, C value)

This method may be used by cell containers to set the value on a single cell directly, rather than using setInnerHTML(String). See AbstractCell#setValue(Context) for a default implementation that uses .

Parameters
context the Cell.Context of the cell
parent the parent Element
value the value associated with the cell