GWT 2.1.0

com.google.gwt.user.cellview.client
Class Column<T,C>

java.lang.Object
  extended by com.google.gwt.user.cellview.client.Column<T,C>
Type Parameters:
T - the row type
C - the column type
All Implemented Interfaces:
HasCell<T,C>
Direct Known Subclasses:
IdentityColumn, TextColumn

public abstract class Column<T,C>
extends java.lang.Object
implements HasCell<T,C>

A representation of a column in a table. The column may maintain view data for each cell on demand. New view data, if needed, is created by the cell's onBrowserEvent method, stored in the Column, and passed to future calls to Cell's Cell.onBrowserEvent(com.google.gwt.dom.client.Element, C, java.lang.Object, com.google.gwt.dom.client.NativeEvent, com.google.gwt.cell.client.ValueUpdater) and Cell.render(C, java.lang.Object, com.google.gwt.safehtml.shared.SafeHtmlBuilder) methods.


Field Summary
protected  Cell<C> cell
          The Cell responsible for rendering items in the column.
protected  FieldUpdater<T,C> fieldUpdater
          The FieldUpdater used for updating values in the column.
 
Constructor Summary
Column(Cell<C> cell)
          Construct a new Column with a given Cell.
 
Method Summary
 Cell<C> getCell()
          Returns the Cell responsible for rendering items in the column.
 FieldUpdater<T,C> getFieldUpdater()
          Returns the FieldUpdater used for updating values in the column.
abstract  C getValue(T object)
          Returns the column value from within the underlying data object.
 void onBrowserEvent(Element elem, int index, T object, NativeEvent event, ProvidesKey<T> keyProvider)
          Handle a browser event that took place within the column.
 void render(T object, ProvidesKey<T> keyProvider, SafeHtmlBuilder sb)
          Render the object into the cell.
 void setFieldUpdater(FieldUpdater<T,C> fieldUpdater)
          Set the FieldUpdater used for updating values in the column.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cell

protected final Cell<C> cell
The Cell responsible for rendering items in the column.


fieldUpdater

protected FieldUpdater<T,C> fieldUpdater
The FieldUpdater used for updating values in the column.

Constructor Detail

Column

public Column(Cell<C> cell)
Construct a new Column with a given Cell.

Parameters:
cell - the Cell used by this Column
Method Detail

getCell

public Cell<C> getCell()
Returns the Cell responsible for rendering items in the column.

Specified by:
getCell in interface HasCell<T,C>
Returns:
a Cell

getFieldUpdater

public FieldUpdater<T,C> getFieldUpdater()
Returns the FieldUpdater used for updating values in the column.

Specified by:
getFieldUpdater in interface HasCell<T,C>
Returns:
an instance of FieldUpdater
See Also:
setFieldUpdater(FieldUpdater)

getValue

public abstract C getValue(T object)
Returns the column value from within the underlying data object.

Specified by:
getValue in interface HasCell<T,C>
Parameters:
object - a record of type T
Returns:
a value of type C suitable for passing to the cell

onBrowserEvent

public void onBrowserEvent(Element elem,
                           int index,
                           T object,
                           NativeEvent event,
                           ProvidesKey<T> keyProvider)
Handle a browser event that took place within the column.

Parameters:
elem - the parent Element
index - the current row index of the object
object - the base object to be updated
event - the native browser event
keyProvider - an instance of ProvidesKey, or null if the record object should act as its own key.

render

public void render(T object,
                   ProvidesKey<T> keyProvider,
                   SafeHtmlBuilder sb)
Render the object into the cell.

Parameters:
object - the object to render
keyProvider - the ProvidesKey for the object
sb - the buffer to render into

setFieldUpdater

public void setFieldUpdater(FieldUpdater<T,C> fieldUpdater)
Set the FieldUpdater used for updating values in the column.

Parameters:
fieldUpdater - the field updater
See Also:
getFieldUpdater()

GWT 2.1.0