Package docking.widgets.table
Class GTableCellRenderingData
- java.lang.Object
-
- docking.widgets.table.GTableCellRenderingData
-
public class GTableCellRenderingData extends java.lang.Object
A state object to provide a table cell renderer with data beyond the standard JavaTableCellRenderer
interface.Additional data about the context of a rendering operation -- like the columns' Settings or the row-object -- are easily passed to the renderer without refactor of each client.
-
-
Constructor Summary
Constructors Constructor Description GTableCellRenderingData(javax.swing.JTable jTable, int column, Settings columnSettings)
Create a data object for a specific column in a table
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GTableCellRenderingData
copyWithNewValue(java.lang.Object newValue)
Create a new data object from this data, changing only the cells' value object.int
getColumnModelIndex()
Settings
getColumnSettings()
int
getColumnViewIndex()
int
getRowModelIndex()
java.lang.Object
getRowObject()
int
getRowViewIndex()
javax.swing.JTable
getTable()
java.lang.Object
getValue()
boolean
hasFocus()
boolean
isSelected()
void
setCellData(java.lang.Object value, int column, boolean isSelected, boolean hasFocus)
Set data specific to a cell, as used during the rendering phasevoid
setRowData(int row, java.lang.Object rowObject)
Set data specific to a row, as used during the rendering phasejava.lang.String
toString()
-
-
-
Constructor Detail
-
GTableCellRenderingData
public GTableCellRenderingData(javax.swing.JTable jTable, int column, Settings columnSettings)
Create a data object for a specific column in a table- Parameters:
jTable
- Reference to the associated JTablecolumn
- View index of this columncolumnSettings
- Settings state provided and used by this column
-
-
Method Detail
-
copyWithNewValue
public GTableCellRenderingData copyWithNewValue(java.lang.Object newValue)
Create a new data object from this data, changing only the cells' value object.This method is a convenience for use by renderers that wish to change the value passed to them.
- Parameters:
newValue
- New cell value object- Returns:
- A new data object with the same state as this object
-
setRowData
public void setRowData(int row, java.lang.Object rowObject)
Set data specific to a row, as used during the rendering phase- Parameters:
row
- View row indexrowObject
- Object for which this table row is generated
-
setCellData
public void setCellData(java.lang.Object value, int column, boolean isSelected, boolean hasFocus)
Set data specific to a cell, as used during the rendering phase- Parameters:
value
- The models' value at row-columncolumn
- the view column indexisSelected
- True if the cell is to be rendered with the selection highlighted; otherwise falsehasFocus
- This cell has the users' focus
-
getTable
public javax.swing.JTable getTable()
-
getColumnViewIndex
public int getColumnViewIndex()
-
getColumnModelIndex
public int getColumnModelIndex()
-
getColumnSettings
public Settings getColumnSettings()
-
getRowViewIndex
public int getRowViewIndex()
-
getRowModelIndex
public int getRowModelIndex()
-
getValue
public java.lang.Object getValue()
-
getRowObject
public java.lang.Object getRowObject()
-
isSelected
public boolean isSelected()
-
hasFocus
public boolean hasFocus()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-