Package com.vaadin.client.widget.grid
Class CellReference<T>
- java.lang.Object
-
- 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 Object
A data class which contains information which identifies a cell in aGrid
.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
Constructors Constructor Description CellReference(RowReference<T> rowReference)
Constructs a new cell reference for the given row.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.com.google.gwt.dom.client.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.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.
-
-
-
Constructor Detail
-
CellReference
public CellReference(RowReference<T> rowReference)
Constructs a new cell reference for the given row.- Parameters:
rowReference
- the row that requires a new cell
-
-
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
andcolumnIndex
comes from hidden columns.- Parameters:
columnIndexDOM
- the index of the column in the DOMcolumnIndex
- the index of the columncolumn
- 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 togetColumnIndex()
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 Object getValue()
Gets the value of the cell.- Returns:
- the value of the cell
-
getElement
public com.google.gwt.dom.client.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
-
-