use of org.eclipse.nebula.widgets.nattable.selection.SelectionLayer in project nebula.widgets.nattable by eclipse.
the class ColumnHeaderSelectionDataLayerExample method createExampleControl.
@Override
public Control createExampleControl(Composite parent) {
DummyBodyDataProvider bodyDataProvider = new DummyBodyDataProvider(1000000, 1000000);
SelectionLayer selectionLayer = new SelectionLayer(new DataLayer(bodyDataProvider));
ILayer columnHeaderLayer = new ColumnHeaderLayer(new DataLayer(new DummyColumnHeaderDataProvider(bodyDataProvider)), selectionLayer, selectionLayer);
CompositeLayer compositeLayer = new CompositeLayer(1, 2);
compositeLayer.setChildLayer(GridRegion.COLUMN_HEADER, columnHeaderLayer, 0, 0);
compositeLayer.setChildLayer(GridRegion.BODY, selectionLayer, 0, 1);
return new NatTable(parent, compositeLayer);
}
use of org.eclipse.nebula.widgets.nattable.selection.SelectionLayer in project nebula.widgets.nattable by eclipse.
the class ColumnHeaderViewportSelectionReorderDataLayerExample method createExampleControl.
@Override
public Control createExampleControl(Composite parent) {
DummyBodyDataProvider bodyDataProvider = new DummyBodyDataProvider(200, 1000000);
SelectionLayer selectionLayer = new SelectionLayer(new ColumnReorderLayer(new DataLayer(bodyDataProvider)));
ViewportLayer viewportLayer = new ViewportLayer(selectionLayer);
ILayer columnHeaderLayer = new ColumnHeaderLayer(new DataLayer(new DummyColumnHeaderDataProvider(bodyDataProvider)), viewportLayer, selectionLayer);
CompositeLayer compositeLayer = new CompositeLayer(1, 2);
compositeLayer.setChildLayer(GridRegion.COLUMN_HEADER, columnHeaderLayer, 0, 0);
compositeLayer.setChildLayer(GridRegion.BODY, viewportLayer, 0, 1);
return new NatTable(parent, compositeLayer);
}
use of org.eclipse.nebula.widgets.nattable.selection.SelectionLayer in project nebula.widgets.nattable by eclipse.
the class RowHeaderViewportSelectionDataLayerExample method createExampleControl.
@Override
public Control createExampleControl(Composite parent) {
DummyBodyDataProvider bodyDataProvider = new DummyBodyDataProvider(1000000, 1000000);
SelectionLayer selectionLayer = new SelectionLayer(new DataLayer(bodyDataProvider));
ViewportLayer viewportLayer = new ViewportLayer(selectionLayer);
DataLayer rowHeaderDataLayer = new DataLayer(new DefaultRowHeaderDataProvider(bodyDataProvider));
rowHeaderDataLayer.setDefaultColumnWidth(41);
ILayer rowHeaderLayer = new RowHeaderLayer(rowHeaderDataLayer, viewportLayer, selectionLayer);
CompositeLayer compositeLayer = new CompositeLayer(2, 1);
compositeLayer.setChildLayer(GridRegion.ROW_HEADER, rowHeaderLayer, 0, 0);
compositeLayer.setChildLayer(GridRegion.BODY, viewportLayer, 1, 0);
return new NatTable(parent, compositeLayer);
}
use of org.eclipse.nebula.widgets.nattable.selection.SelectionLayer in project nebula.widgets.nattable by eclipse.
the class NatTableBuilder method configureSelectionStyle.
/**
* Set up selection behavior. Select cells vs select rows.
*/
protected void configureSelectionStyle() {
SelectionLayer selectionLayer = bodyLayer.getSelectionLayer();
if (tableModel.enableFullRowSelection) {
selectionLayer.addConfiguration(new RowOnlySelectionConfiguration<T>());
natTable.addConfiguration(new RowSelectionUIBindings());
selectionLayer.setSelectionModel(new RowSelectionModel<T>(selectionLayer, bodyLayer.getDataProvider(), rowIdAccessor));
} else {
selectionLayer.addConfiguration(new DefaultSelectionLayerConfiguration());
}
natTable.addConfiguration(new SelectionStyleConfiguration(tableStyle));
}
use of org.eclipse.nebula.widgets.nattable.selection.SelectionLayer in project nebula.widgets.nattable by eclipse.
the class SpanningDataLayerExample method createExampleControl.
@Override
public Control createExampleControl(Composite parent) {
CompositeLayer layer = new CompositeLayer(1, 1);
layer.setChildLayer(GridRegion.BODY, new ViewportLayer(new SelectionLayer(new SpanningDataLayer(new DummySpanningBodyDataProvider(1000000, 1000000)))), 0, 0);
return new NatTable(parent, layer);
}
Aggregations