bodyDataLayer = new DataLayer(bodyDataProvider);
GlazedListsEventLayer<RowDataFixture> glazedListsEventLayer = new GlazedListsEventLayer<RowDataFixture>(
bodyDataLayer, eventList);
DefaultBodyLayerStack bodyLayer = new DefaultBodyLayerStack(
glazedListsEventLayer);
ColumnOverrideLabelAccumulator bodyLabelAccumulator = new ColumnOverrideLabelAccumulator(
bodyDataLayer);
bodyDataLayer.setConfigLabelAccumulator(bodyLabelAccumulator);
bodyLabelAccumulator
.registerColumnOverrides(
RowDataListFixture
.getColumnIndexOfProperty(RowDataListFixture.PRICING_TYPE_PROP_NAME),
"PRICING_TYPE_PROP_NAME");
// Column header layer
IDataProvider columnHeaderDataProvider = new DefaultColumnHeaderDataProvider(
propertyNames, propertyToLabelMap);
DataLayer columnHeaderDataLayer = new DefaultColumnHeaderDataLayer(
columnHeaderDataProvider);
ColumnHeaderLayer columnHeaderLayer = new ColumnHeaderLayer(
columnHeaderDataLayer, bodyLayer, bodyLayer.getSelectionLayer());
SortHeaderLayer<RowDataFixture> sortHeaderLayer = new SortHeaderLayer<RowDataFixture>(
columnHeaderLayer, new GlazedListsSortModel<RowDataFixture>(
sortedList, columnPropertyAccessor, configRegistry,
columnHeaderDataLayer), false);
sortHeaderLayer.addConfiguration(new SingleClickSortConfiguration());
// Note: The column header layer is wrapped in a filter row composite.
// This plugs in the filter row functionality
// DefaultGlazedListsFilterStrategy<RowDataFixture> filterStrategy =
// new
// DefaultGlazedListsFilterStrategy<RowDataFixture>(autoFilterMatcherEditor,
// columnPropertyAccessor, configRegistry);
DefaultGlazedListsStaticFilterStrategy<RowDataFixture> filterStrategy = new DefaultGlazedListsStaticFilterStrategy<RowDataFixture>(
filterList, columnPropertyAccessor, configRegistry);
filterStrategy.addStaticFilter(new Matcher<RowDataFixture>() {
@Override
public boolean matches(RowDataFixture item) {
return !(item.rating.equals("AAA"));
}
});
FilterRowHeaderComposite<RowDataFixture> filterRowHeaderLayer = new FilterRowHeaderComposite<RowDataFixture>(
filterStrategy, sortHeaderLayer, columnHeaderDataProvider,
configRegistry);
ColumnOverrideLabelAccumulator labelAccumulator = new ColumnOverrideLabelAccumulator(
columnHeaderDataLayer);
columnHeaderDataLayer.setConfigLabelAccumulator(labelAccumulator);
// Register labels
labelAccumulator.registerColumnOverrides(RowDataListFixture
.getColumnIndexOfProperty(RowDataListFixture.RATING_PROP_NAME),
"CUSTOM_COMPARATOR_LABEL");
// Row header layer
DefaultRowHeaderDataProvider rowHeaderDataProvider = new DefaultRowHeaderDataProvider(