A quick overview of some of the concepts involved..
This is a global object holding the following kinds of configuration
This is a global object holding the following kinds of configuration
Display mode is a tag applied to a cell to identify the state the cell is in. Currently the following display modes are supported:
For example, a cell might be colored white in normal mode but a gray color might be applied to it when it is in select mode
Cell labels are a mechanism to tie configuration to specific cells. A cell label is a string/label which is attached to a cell.
For example,
- we might attach a label 'error' to cells which meet certain criteria. While painting all cells with the label 'error' will be painted red.
- We can attach a label 'checkbox' to all cell holding a boolean value. While painting all cells with the label 'checkbox' will be painted as a 'checkbox'
Following the overall design convention, Layers can add labels to cells. In order to attach a label to a cell(s) you need to:
IConfigLabelAccumulator interface. This IConfigLabelAccumulator.accumulateConfigLabels() is called on each layer. Every layer can add its labels to the LabelStack. The most common use cases are available out of the box, including but not limited to.
CellOverrideLabelAccumulator - applies labels to cell(s) containing a specified data value
ColumnOverrideLabelAccumulator - applies labels to all cells in a column
The name of the region the cell is in is added as a default label. For example, all cells in the body have the label BODY by default.
Configuration information is contributed by individual layers. When a layer is added to the stack it contributes relevant configuration via the AbstractLayer.addConfiguartion() method. For example, when the SelectionLayer is added it contributes selection styling via the DefaultSelectionLayerConfiguration.
In order to contribute configuration information you need to:
IConfiguration interface. It is usually easier to override one of the default configuration objects.
AbstractLayer.addConfiguartion() method
When the grid initializes it invokes your configuration object. At this point you can make entries in the IConfigRegistry and the UiBindingRegistry.
These are global objects held by NatTable.