// build the column header layer
IDataProvider columnHeaderDataProvider = new DefaultColumnHeaderDataProvider(
propertyNames, propertyToLabelMap);
DataLayer columnHeaderDataLayer = new DefaultColumnHeaderDataLayer(
columnHeaderDataProvider);
ILayer columnHeaderLayer = new ColumnHeaderLayer(columnHeaderDataLayer,
bodyLayerStack, bodyLayerStack.getSelectionLayer());
// example on how to configure a different icon if a filter is applied
ComboBoxFilterRowHeaderComposite<MyRowObject> filterRowHeaderLayer = new ComboBoxFilterRowHeaderComposite<MyRowObject>(
bodyLayerStack.getFilterList(),
bodyLayerStack.getBodyDataLayer(),
bodyLayerStack.getSortedList(), columnPropertyAccessor,
columnHeaderLayer, columnHeaderDataProvider, configRegistry,
false);
final IComboBoxDataProvider comboBoxDataProvider = filterRowHeaderLayer
.getComboBoxDataProvider();
filterRowHeaderLayer
.addConfiguration(new ComboBoxFilterRowConfiguration() {
{
this.cellEditor = new FilterRowComboBoxCellEditor(
comboBoxDataProvider, 5);
this.filterIconPainter = new ComboBoxFilterIconPainter(
comboBoxDataProvider, GUIHelper
.getImage("filter"), null);
}
});
// build the row header layer
IDataProvider rowHeaderDataProvider = new DefaultRowHeaderDataProvider(
bodyLayerStack.getBodyDataProvider());
DataLayer rowHeaderDataLayer = new DefaultRowHeaderDataLayer(
rowHeaderDataProvider);
ILayer rowHeaderLayer = new RowHeaderLayer(rowHeaderDataLayer,
bodyLayerStack, bodyLayerStack.getSelectionLayer());
// build the corner layer
IDataProvider cornerDataProvider = new DefaultCornerDataProvider(
columnHeaderDataProvider, rowHeaderDataProvider);
DataLayer cornerDataLayer = new DataLayer(cornerDataProvider);
ILayer cornerLayer = new CornerLayer(cornerDataLayer, rowHeaderLayer,
filterRowHeaderLayer);
// build the grid layer
GridLayer gridLayer = new GridLayer(bodyLayerStack,
filterRowHeaderLayer, rowHeaderLayer, cornerLayer);