Search in sources :

Example 61 with SelectionLayer

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);
}
Also used : DummyBodyDataProvider(org.eclipse.nebula.widgets.nattable.grid.data.DummyBodyDataProvider) DataLayer(org.eclipse.nebula.widgets.nattable.layer.DataLayer) SelectionLayer(org.eclipse.nebula.widgets.nattable.selection.SelectionLayer) ColumnHeaderLayer(org.eclipse.nebula.widgets.nattable.grid.layer.ColumnHeaderLayer) ILayer(org.eclipse.nebula.widgets.nattable.layer.ILayer) NatTable(org.eclipse.nebula.widgets.nattable.NatTable) CompositeLayer(org.eclipse.nebula.widgets.nattable.layer.CompositeLayer) DummyColumnHeaderDataProvider(org.eclipse.nebula.widgets.nattable.grid.data.DummyColumnHeaderDataProvider)

Example 62 with SelectionLayer

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);
}
Also used : DummyBodyDataProvider(org.eclipse.nebula.widgets.nattable.grid.data.DummyBodyDataProvider) DataLayer(org.eclipse.nebula.widgets.nattable.layer.DataLayer) SelectionLayer(org.eclipse.nebula.widgets.nattable.selection.SelectionLayer) ColumnHeaderLayer(org.eclipse.nebula.widgets.nattable.grid.layer.ColumnHeaderLayer) ILayer(org.eclipse.nebula.widgets.nattable.layer.ILayer) ColumnReorderLayer(org.eclipse.nebula.widgets.nattable.reorder.ColumnReorderLayer) NatTable(org.eclipse.nebula.widgets.nattable.NatTable) ViewportLayer(org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer) CompositeLayer(org.eclipse.nebula.widgets.nattable.layer.CompositeLayer) DummyColumnHeaderDataProvider(org.eclipse.nebula.widgets.nattable.grid.data.DummyColumnHeaderDataProvider)

Example 63 with SelectionLayer

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);
}
Also used : DummyBodyDataProvider(org.eclipse.nebula.widgets.nattable.grid.data.DummyBodyDataProvider) DataLayer(org.eclipse.nebula.widgets.nattable.layer.DataLayer) RowHeaderLayer(org.eclipse.nebula.widgets.nattable.grid.layer.RowHeaderLayer) SelectionLayer(org.eclipse.nebula.widgets.nattable.selection.SelectionLayer) ILayer(org.eclipse.nebula.widgets.nattable.layer.ILayer) NatTable(org.eclipse.nebula.widgets.nattable.NatTable) DefaultRowHeaderDataProvider(org.eclipse.nebula.widgets.nattable.grid.data.DefaultRowHeaderDataProvider) ViewportLayer(org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer) CompositeLayer(org.eclipse.nebula.widgets.nattable.layer.CompositeLayer)

Example 64 with SelectionLayer

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));
}
Also used : SelectionLayer(org.eclipse.nebula.widgets.nattable.selection.SelectionLayer) RowSelectionUIBindings(org.eclipse.nebula.widgets.nattable.extension.builder.configuration.RowSelectionUIBindings) SelectionStyleConfiguration(org.eclipse.nebula.widgets.nattable.extension.builder.configuration.SelectionStyleConfiguration) DefaultSelectionLayerConfiguration(org.eclipse.nebula.widgets.nattable.selection.config.DefaultSelectionLayerConfiguration)

Example 65 with SelectionLayer

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);
}
Also used : SelectionLayer(org.eclipse.nebula.widgets.nattable.selection.SelectionLayer) DummySpanningBodyDataProvider(org.eclipse.nebula.widgets.nattable.grid.data.DummySpanningBodyDataProvider) NatTable(org.eclipse.nebula.widgets.nattable.NatTable) ViewportLayer(org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer) CompositeLayer(org.eclipse.nebula.widgets.nattable.layer.CompositeLayer) SpanningDataLayer(org.eclipse.nebula.widgets.nattable.layer.SpanningDataLayer)

Aggregations

SelectionLayer (org.eclipse.nebula.widgets.nattable.selection.SelectionLayer)107 DataLayer (org.eclipse.nebula.widgets.nattable.layer.DataLayer)75 NatTable (org.eclipse.nebula.widgets.nattable.NatTable)73 ViewportLayer (org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer)71 ColumnHeaderLayer (org.eclipse.nebula.widgets.nattable.grid.layer.ColumnHeaderLayer)63 ILayer (org.eclipse.nebula.widgets.nattable.layer.ILayer)58 IDataProvider (org.eclipse.nebula.widgets.nattable.data.IDataProvider)54 RowHeaderLayer (org.eclipse.nebula.widgets.nattable.grid.layer.RowHeaderLayer)47 GridLayer (org.eclipse.nebula.widgets.nattable.grid.layer.GridLayer)46 DefaultRowHeaderDataProvider (org.eclipse.nebula.widgets.nattable.grid.data.DefaultRowHeaderDataProvider)44 DefaultCornerDataProvider (org.eclipse.nebula.widgets.nattable.grid.data.DefaultCornerDataProvider)43 CornerLayer (org.eclipse.nebula.widgets.nattable.grid.layer.CornerLayer)43 DefaultColumnHeaderDataProvider (org.eclipse.nebula.widgets.nattable.grid.data.DefaultColumnHeaderDataProvider)42 DefaultNatTableStyleConfiguration (org.eclipse.nebula.widgets.nattable.config.DefaultNatTableStyleConfiguration)41 HashMap (java.util.HashMap)38 DefaultRowHeaderDataLayer (org.eclipse.nebula.widgets.nattable.grid.layer.DefaultRowHeaderDataLayer)37 DefaultColumnHeaderDataLayer (org.eclipse.nebula.widgets.nattable.grid.layer.DefaultColumnHeaderDataLayer)34 ListDataProvider (org.eclipse.nebula.widgets.nattable.data.ListDataProvider)27 CompositeLayer (org.eclipse.nebula.widgets.nattable.layer.CompositeLayer)25 ColumnReorderLayer (org.eclipse.nebula.widgets.nattable.reorder.ColumnReorderLayer)25