waba.ui
Class Grid.CellController

java.lang.Object
  |
  +--waba.ui.Grid.CellController
Enclosing class:
Grid

public abstract static class Grid.CellController
extends java.lang.Object

Abstract class that must be implemented if you want to get a fine control of each cell in the grid. Note that you must keep track of the state of each cell in your code. How to proceed:

Note that using a CellControler makes the grid drawings a bit slower. Also, if the user sorts the columns, you may get scrambled. You can disable sort using grid.disableSort = true.


Constructor Summary
Grid.CellController()
           
 
Method Summary
abstract  Color getBackColor(int row, int col)
          Must return the background color for the given cell.
abstract  java.lang.String[] getChoices(int row, int col)
          Must return the choices for a given line and column, if setColumnChoices was set to this column.
abstract  Color getForeColor(int row, int col)
          Must return the foreground color for the given cell.
abstract  boolean isEnabled(int row, int col)
          Must return if the given cell is enabled, ie, can have input and can be selected.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Grid.CellController

public Grid.CellController()
Method Detail

getForeColor

public abstract Color getForeColor(int row,
                                   int col)
Must return the foreground color for the given cell.

getBackColor

public abstract Color getBackColor(int row,
                                   int col)
Must return the background color for the given cell. Note that if the grid has a check, the back color of the check cell will be requested passing col value as -1.

getChoices

public abstract java.lang.String[] getChoices(int row,
                                              int col)
Must return the choices for a given line and column, if setColumnChoices was set to this column.

isEnabled

public abstract boolean isEnabled(int row,
                                  int col)
Must return if the given cell is enabled, ie, can have input and can be selected. If the grid has a check column, returning false will disable the check state change.