use of org.eclipse.nebula.widgets.nattable.painter.layer.NatGridLayerPainter in project nebula.widgets.nattable by eclipse.
the class _4221_NatGridLayerPainterExample method createExampleControl.
@Override
public Control createExampleControl(Composite parent) {
parent.setLayout(new GridLayout());
// property names of the Person class
String[] propertyNames = { "firstName", "lastName", "gender", "married", "birthday" };
IColumnPropertyAccessor<Person> columnPropertyAccessor = new ReflectiveColumnPropertyAccessor<>(propertyNames);
IDataProvider bodyDataProvider = new ListDataProvider<>(PersonService.getPersons(10), columnPropertyAccessor);
final DataLayer bodyDataLayer = new DataLayer(bodyDataProvider);
// use different style bits to avoid rendering of inactive scrollbars
// for small table
// Note: The enabling/disabling and showing of the scrollbars is handled
// by the ViewportLayer.
// Without the ViewportLayer the scrollbars will always be visible with
// the default style bits of NatTable.
final NatTable natTable = new NatTable(parent, SWT.NO_REDRAW_RESIZE | SWT.DOUBLE_BUFFERED | SWT.BORDER, bodyDataLayer);
natTable.setBackground(GUIHelper.COLOR_WHITE);
GridDataFactory.fillDefaults().grab(true, true).applyTo(natTable);
natTable.setLayerPainter(new NatGridLayerPainter(natTable, DataLayer.DEFAULT_ROW_HEIGHT));
return natTable;
}
use of org.eclipse.nebula.widgets.nattable.painter.layer.NatGridLayerPainter in project nebula.widgets.nattable by eclipse.
the class _010_NatTable_with_grid_painting_of_remainder_space method createExampleControl.
@Override
public Control createExampleControl(Composite parent) {
NatTable natTable = new NatTable(parent);
NatGridLayerPainter layerPainter = new NatGridLayerPainter(natTable);
natTable.setLayerPainter(layerPainter);
return natTable;
}
Aggregations