use of org.eclipse.nebula.widgets.nattable.data.AutomaticSpanningDataProvider in project nebula.widgets.nattable by eclipse.
the class _5015_AutomaticDataSpanningExample method createExampleControl.
@Override
public Control createExampleControl(Composite parent) {
// property names of the NumberValues class
String[] propertyNames = { "columnOneNumber", "columnTwoNumber", "columnThreeNumber", "columnFourNumber", "columnFiveNumber" };
IColumnPropertyAccessor<NumberValues> cpa = new ReflectiveColumnPropertyAccessor<>(propertyNames);
IDataProvider dataProvider = new ListDataProvider<>(createNumberValueList(), cpa);
AutomaticSpanningDataProvider spanningDataProvider = new AutomaticSpanningDataProvider(dataProvider, true, false);
// spanningDataProvider.addAutoSpanningColumnPositions(0, 1, 2);
// spanningDataProvider.addAutoSpanningColumnPositions(2, 3, 4);
// spanningDataProvider.addAutoSpanningColumnPositions(0, 1, 3, 4);
// spanningDataProvider.addAutoSpanningRowPositions(0, 1, 2);
// spanningDataProvider.addAutoSpanningRowPositions(2, 3, 4);
// spanningDataProvider.addAutoSpanningRowPositions(0, 1, 3, 4);
NatTable natTable = new NatTable(parent, new ViewportLayer(new SelectionLayer(new SpanningDataLayer(spanningDataProvider))), false);
natTable.addConfiguration(new DefaultNatTableStyleConfiguration());
natTable.addConfiguration(new BodyMenuConfiguration(natTable, spanningDataProvider));
natTable.configure();
natTable.registerCommandHandler(new DisplayPersistenceDialogCommandHandler());
return natTable;
}
Aggregations