com.vaadin.client.widget.grid
Class CellReference<T>

java.lang.Object
  extended by com.vaadin.client.widget.grid.CellReference<T>
Type Parameters:
T - the type of the row object containing this cell
Direct Known Subclasses:
EventCellReference, RendererCellReference

public class CellReference<T>
extends java.lang.Object

A data class which contains information which identifies a cell in a Grid.

Since this class follows the Flyweight-pattern any instance of this object is subject to change without the user knowing it and so should not be stored anywhere outside of the method providing these instances.

Since:
7.4
Author:
Vaadin Ltd

Constructor Summary
CellReference(RowReference<T> rowReference)
           
 
Method Summary
 Grid.Column<?,T> getColumn()
          Gets the column objects.
 int getColumnIndex()
          Gets the index of the column.
 int getColumnIndexDOM()
          Gets the index of the cell in the DOM.
 TableCellElement getElement()
          Get the element of the cell.
 Grid<T> getGrid()
          Gets the grid that contains the referenced cell.
 T getRow()
          Gets the row data object.
 int getRowIndex()
          Gets the row index of the row.
protected  RowReference<T> getRowReference()
          Gets the RowReference for this CellReference.
 java.lang.Object getValue()
          Gets the value of the cell.
 void set(int columnIndexDOM, int columnIndex, Grid.Column<?,T> column)
          Sets the identifying information for this cell.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CellReference

public CellReference(RowReference<T> rowReference)
Method Detail

set

public void set(int columnIndexDOM,
                int columnIndex,
                Grid.Column<?,T> column)
Sets the identifying information for this cell.

The difference between columnIndexDOM and columnIndex comes from hidden columns.

Parameters:
columnIndexDOM - the index of the column in the DOM
columnIndex - the index of the column
column - the column object

getGrid

public Grid<T> getGrid()
Gets the grid that contains the referenced cell.

Returns:
the grid that contains referenced cell

getRowIndex

public int getRowIndex()
Gets the row index of the row.

Returns:
the index of the row

getRow

public T getRow()
Gets the row data object.

Returns:
the row object

getColumnIndex

public int getColumnIndex()
Gets the index of the column.

NOTE: The index includes hidden columns in the count, unlike getColumnIndexDOM().

Returns:
the index of the column

getColumnIndexDOM

public int getColumnIndexDOM()
Gets the index of the cell in the DOM. The difference to getColumnIndex() is caused by hidden columns.

Returns:
the index of the column in the DOM
Since:
7.5.0

getColumn

public Grid.Column<?,T> getColumn()
Gets the column objects.

Returns:
the column object

getValue

public java.lang.Object getValue()
Gets the value of the cell.

Returns:
the value of the cell

getElement

public TableCellElement getElement()
Get the element of the cell.

Returns:
the element of the cell

getRowReference

protected RowReference<T> getRowReference()
Gets the RowReference for this CellReference.

Returns:
the row reference


Copyright © 2000-2014 Vaadin Ltd. All Rights Reserved.