A typical composition to use this layer could look like this:
+---------------+---------------+
| CompositeLayer |
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+
| +---------------------------+ |
| | GridLayer | |
| +~~~~~~~~~~~~~~~~~~~~~~~~~~~+ |
| | Corner | ColHeader | |
| +-----------+---------------+ |
| | RowHeader | Body | |
| +-----------+---------------+ |
+-------------------------------+
| FixedGridSummaryRowLayer |
+-------------------------------+
It would be created by the following code:
GridLayer gridLayer = new GridLayer(...); FixedGridSummaryRowLayer summaryRowLayer = new FixedGridSummaryRowLayer(bodyDataLayer, gridLayer, configRegistry); CompositeLayer composite = new CompositeLayer(1, 2); composite.setChildLayer("GRID", gridLayer, 0, 0); composite.setChildLayer(SUMMARY_REGION, summaryRowLayer, 0, 1); NatTable natTable = new NatTable(panel, composite);
Note that the bodyDataLayer needs to be accessible somehow and the creation of the {@link GridLayer} is not specified in detail in the aboveexample.
Using this layer in a composition as shown above will result in a fixed summary row that doesn't scroll if the viewport is scrolled. This is different to the typical approach of adding the {@link SummaryRowLayer} ontop of the body {@link DataLayer} where the summary row will scroll as partof the body region.
|
|