public abstract class

Column

extends Object
implements HasCell<T, C> HasAlignment
java.lang.Object
   ↳ com.google.gwt.user.cellview.client.Column<T, C>
Known Direct Subclasses

Class Overview

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 onBrowserEvent(Cell.Context, Element, C, NativeEvent, ValueUpdater) and render(Cell.Context, C, SafeHtmlBuilder) methods.

Summary

[Expand]
Inherited Fields
From interface com.google.gwt.user.client.ui.HasHorizontalAlignment
From interface com.google.gwt.user.client.ui.HasVerticalAlignment
Public Constructors
Column(Cell<C> cell)
Construct a new Column with a given Cell.
Public Methods
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.
HasHorizontalAlignment.HorizontalAlignmentConstant getHorizontalAlignment()
Gets the horizontal alignment.
abstract C getValue(T object)
Returns the column value from within the underlying data object.
HasVerticalAlignment.VerticalAlignmentConstant getVerticalAlignment()
Gets the vertical alignment.
boolean isSortable()
Check if the column is sortable.
void onBrowserEvent(Cell.Context context, Element elem, T object, NativeEvent event)
Handle a browser event that took place within the column.
void render(Cell.Context context, T object, SafeHtmlBuilder sb)
Render the object into the cell.
void setFieldUpdater(FieldUpdater<T, C> fieldUpdater)
Set the FieldUpdater used for updating values in the column.
void setHorizontalAlignment(HasHorizontalAlignment.HorizontalAlignmentConstant align)
Sets the horizontal alignment.

The new horizontal alignment will apply the next time the table is rendered.

void setSortable(boolean sortable)
Set whether or not the column can be sorted.
void setVerticalAlignment(HasVerticalAlignment.VerticalAlignmentConstant align)
Sets the vertical alignment.

The new vertical alignment will apply the next time the table is rendered.

[Expand]
Inherited Methods
From class java.lang.Object
From interface com.google.gwt.cell.client.HasCell
From interface com.google.gwt.user.client.ui.HasHorizontalAlignment
From interface com.google.gwt.user.client.ui.HasVerticalAlignment

Public Constructors

public Column (Cell<C> cell)

Construct a new Column with a given Cell.

Parameters
cell the Cell used by this Column

Public Methods

public Cell<C> getCell ()

Returns the Cell responsible for rendering items in the column.

Returns
  • a Cell

public FieldUpdater<T, C> getFieldUpdater ()

Returns the FieldUpdater used for updating values in the column.

Returns
  • an instance of FieldUpdater

public HasHorizontalAlignment.HorizontalAlignmentConstant getHorizontalAlignment ()

Gets the horizontal alignment.

Returns

public abstract C getValue (T object)

Returns the column value from within the underlying data object.

Parameters
object a record of type T
Returns
  • a value of type C suitable for passing to the cell

public HasVerticalAlignment.VerticalAlignmentConstant getVerticalAlignment ()

Gets the vertical alignment.

Returns
  • the current vertical alignment.

public boolean isSortable ()

Check if the column is sortable.

Returns
  • true if sortable, false if not

public void onBrowserEvent (Cell.Context context, Element elem, T object, NativeEvent event)

Handle a browser event that took place within the column.

Parameters
context the cell context
elem the parent Element
object the base object to be updated
event the native browser event

public void render (Cell.Context context, T object, SafeHtmlBuilder sb)

Render the object into the cell.

Parameters
context the cell context
object the object to render
sb the buffer to render into

public void setFieldUpdater (FieldUpdater<T, C> fieldUpdater)

Set the FieldUpdater used for updating values in the column.

Parameters
fieldUpdater the field updater

public void setHorizontalAlignment (HasHorizontalAlignment.HorizontalAlignmentConstant align)

Sets the horizontal alignment.

Use null to clear horizontal alignment, allowing it to be determined by the standard HTML mechanisms such as inheritance and CSS rules.

The new horizontal alignment will apply the next time the table is rendered.

Parameters
align the horizontal alignment ( HasHorizontalAlignment#ALIGN_LEFT, HasHorizontalAlignment#ALIGN_CENTER, HasHorizontalAlignment#ALIGN_RIGHT, HasHorizontalAlignment#ALIGN_JUSTIFY, HasHorizontalAlignment#ALIGN_LOCALE_START, or HasHorizontalAlignment#ALIGN_LOCALE_END).

public void setSortable (boolean sortable)

Set whether or not the column can be sorted. The change will take effect the next time the table is redrawn.

Parameters
sortable true to make sortable, false to make unsortable

public void setVerticalAlignment (HasVerticalAlignment.VerticalAlignmentConstant align)

Sets the vertical alignment.

The new vertical alignment will apply the next time the table is rendered.

Parameters
align the vertical alignment ( HasVerticalAlignment#ALIGN_TOP, HasVerticalAlignment#ALIGN_MIDDLE, or HasVerticalAlignment#ALIGN_BOTTOM).