IColumnPropertyAccessor<T> columnPropertyAccessor = new ReflectiveColumnPropertyAccessor<T>(
propertyNames);
bodyDataProvider = new ListDataProvider<T>(sortedList,
columnPropertyAccessor);
bodyDataLayer = new DataLayer(bodyDataProvider);
glazedListsEventLayer = new GlazedListsEventLayer<T>(bodyDataLayer,
eventList);
bodyLayerStack = new DefaultBodyLayerStack(glazedListsEventLayer);
// Sort Column header
IDataProvider columnHeaderDataProvider = new DefaultColumnHeaderDataProvider(
propertyNames, propertyToLabelMap);
columnHeaderDataLayer = new DefaultColumnHeaderDataLayer(
columnHeaderDataProvider);
ColumnHeaderLayer columnHeaderLayer = new ColumnHeaderLayer(
columnHeaderDataLayer, bodyLayerStack,
bodyLayerStack.getSelectionLayer());
// Auto configure off. Configurations have to applied manually.
SortHeaderLayer<T> columnHeaderSortableLayer = new SortHeaderLayer<T>(
columnHeaderLayer, new GlazedListsSortModel<T>(sortedList,
columnPropertyAccessor, configRegistry,
columnHeaderDataLayer), false);
// Row header
DefaultRowHeaderDataProvider rowHeaderDataProvider = new DefaultRowHeaderDataProvider(
bodyDataProvider);
DefaultRowHeaderDataLayer rowHeaderDataLayer = new DefaultRowHeaderDataLayer(
rowHeaderDataProvider);
RowHeaderLayer rowHeaderLayer = new RowHeaderLayer(rowHeaderDataLayer,
bodyLayerStack, bodyLayerStack.getSelectionLayer());
// Corner
DefaultCornerDataProvider cornerDataProvider = new DefaultCornerDataProvider(
columnHeaderDataProvider, rowHeaderDataProvider);
DataLayer cornerDataLayer = new DataLayer(cornerDataProvider);
CornerLayer cornerLayer = new CornerLayer(cornerDataLayer,
rowHeaderLayer, columnHeaderLayer);
// Grid
setBodyLayer(bodyLayerStack);