Class GTableCellRenderingData

java.lang.Object
docking.widgets.table.GTableCellRenderingData

public class GTableCellRenderingData extends Object
A state object to provide a table cell renderer with data beyond the standard Java TableCellRenderer 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 Details

    • GTableCellRenderingData

      public GTableCellRenderingData(JTable jTable, int column, Settings columnSettings)
      Create a data object for a specific column in a table
      Parameters:
      jTable - Reference to the associated JTable
      column - View index of this column
      columnSettings - Settings state provided and used by this column
  • Method Details

    • copyWithNewValue

      public GTableCellRenderingData copyWithNewValue(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, Object rowObject)
      Set data specific to a row, as used during the rendering phase
      Parameters:
      row - View row index
      rowObject - Object for which this table row is generated
    • setCellData

      public void setCellData(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-column
      column - the view column index
      isSelected - True if the cell is to be rendered with the selection highlighted; otherwise false
      hasFocus - This cell has the users' focus
    • getTable

      public JTable getTable()
    • getColumnViewIndex

      public int getColumnViewIndex()
    • getColumnModelIndex

      public int getColumnModelIndex()
    • getColumnSettings

      public Settings getColumnSettings()
    • getRowViewIndex

      public int getRowViewIndex()
    • getRowModelIndex

      public int getRowModelIndex()
    • getValue

      public Object getValue()
    • getRowObject

      public Object getRowObject()
    • isSelected

      public boolean isSelected()
    • hasFocus

      public boolean hasFocus()
    • toString

      public String toString()
      Overrides:
      toString in class Object