Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| GWT 2.4.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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

    java.lang.Object
      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>, HasAlignment, HasHorizontalAlignment, HasVerticalAlignment

Direct Known Subclasses:
  IdentityColumn, TextColumn

    public abstract class Column<T,C>

extends java.lang.Object
implements HasCell<T,C>, HasAlignment

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.cell.client.Cell.Context, com.google.gwt.dom.client.Element, C, com.google.gwt.dom.client.NativeEvent, com.google.gwt.cell.client.ValueUpdater)` and `Cell.render(com.google.gwt.cell.client.Cell.Context, C, com.google.gwt.safehtml.shared.SafeHtmlBuilder)` methods.

Nested Class Summary

Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasHorizontalAlignment
`HasHorizontalAlignment.AutoHorizontalAlignmentConstant, HasHorizontalAlignment.HorizontalAlignmentConstant`

Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasVerticalAlignment
`HasVerticalAlignment.VerticalAlignmentConstant`

Field Summary

Fields inherited from interface com.google.gwt.user.client.ui.HasHorizontalAlignment
`ALIGN_CENTER, ALIGN_DEFAULT, ALIGN_JUSTIFY, ALIGN_LEFT, ALIGN_LOCALE_END, ALIGN_LOCALE_START, ALIGN_RIGHT`

Fields inherited from interface com.google.gwt.user.client.ui.HasVerticalAlignment
`ALIGN_BOTTOM, ALIGN_MIDDLE, ALIGN_TOP`

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.
`java.lang.String` | `getCellStyleNames(Cell.Context context, T object)` Get extra style names that should be applied to a cell in this 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` | `setCellStyleNames(java.lang.String styleNames)` Set extra style names that should be applied to every 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.
`void` | `setSortable(boolean sortable)` Set whether or not the column can be sorted.
`void` | `setVerticalAlignment(HasVerticalAlignment.VerticalAlignmentConstant align)` Sets the vertical alignment.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

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

### getCellStyleNames

    public java.lang.String getCellStyleNames(Cell.Context context,
                                              T object)

  Get extra style names that should be applied to a cell in this column.

  Parameters:
    `context` - the cell context
    `object` - the base object to be updated, or null if the row is empty
  Returns:
    the extra styles of the given row in a space-separated list, or `null` if there are no extra styles for the cells in this column

### 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)`

### getHorizontalAlignment

    public HasHorizontalAlignment.HorizontalAlignmentConstant getHorizontalAlignment()

  Description copied from interface: `HasHorizontalAlignment`
  Gets the horizontal alignment.

  Specified by:
    `getHorizontalAlignment` in interface `HasHorizontalAlignment`
  Returns:
    the current horizontal alignment ( `HasHorizontalAlignment.ALIGN_LEFT`, `HasHorizontalAlignment.ALIGN_CENTER`, `HasHorizontalAlignment.ALIGN_RIGHT`, `HasHorizontalAlignment.ALIGN_JUSTIFY`, or null).

### 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

### getVerticalAlignment

    public HasVerticalAlignment.VerticalAlignmentConstant getVerticalAlignment()

  Description copied from interface: `HasVerticalAlignment`
  Gets the vertical alignment.

  Specified by:
    `getVerticalAlignment` in interface `HasVerticalAlignment`
  Returns:
    the current vertical alignment.

### isSortable

    public boolean isSortable()

  Check if the column is sortable.

  Returns:
    true if sortable, false if not

### onBrowserEvent

    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

### render

    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

### setCellStyleNames

    public void setCellStyleNames(java.lang.String styleNames)

  Set extra style names that should be applied to every cell.

  If you want to apply style names based on the row or cell value, override `#getCellStyleNames(Context, Object)` directly.

  Parameters:
    `styleNames` - the extra style names to applyin a space-separated list, or `null` if there are no extra styles for this cell

### 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()`

### setHorizontalAlignment

    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.

  Specified by:
    `setHorizontalAlignment` in interface `HasHorizontalAlignment`
  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`).

### setSortable

    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

### setVerticalAlignment

    public void setVerticalAlignment(HasVerticalAlignment.VerticalAlignmentConstant align)

  Sets the vertical alignment.

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

  Specified by:
    `setVerticalAlignment` in interface `HasVerticalAlignment`
  Parameters:
    `align` - the vertical alignment ( `HasVerticalAlignment.ALIGN_TOP`, `HasVerticalAlignment.ALIGN_MIDDLE`, or `HasVerticalAlignment.ALIGN_BOTTOM`).

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| GWT 2.4.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD