Search in sources :

Example 1 with InvertedLayer

use of org.eclipse.nebula.widgets.nattable.layer.InvertedLayer in project nebula.widgets.nattable by eclipse.

the class InvertedLayerExample method createExampleControl.

@Override
public Control createExampleControl(Composite parent) {
    DummyBodyDataProvider bodyDataProvider = new DummyBodyDataProvider(5, 10);
    DataLayer bodyDataLayer = new DataLayer(bodyDataProvider);
    bodyDataLayer.setDefaultRowHeight(100);
    SelectionLayer selectionLayer = new SelectionLayer(new ColumnHideShowLayer(new ColumnReorderLayer(bodyDataLayer)));
    InvertedLayer invertedLayer = new InvertedLayer(selectionLayer);
    ViewportLayer viewportLayer = new ViewportLayer(invertedLayer);
    DummyColumnHeaderDataProvider columnHeaderDataProvider = new DummyColumnHeaderDataProvider(bodyDataProvider);
    DataLayer columnHeaderDataLayer = new DataLayer(columnHeaderDataProvider);
    ILayer columnHeaderLayer = new ColumnHeaderLayer(columnHeaderDataLayer, viewportLayer, selectionLayer);
    DefaultRowHeaderDataProvider rowHeaderDataProvider = new DefaultRowHeaderDataProvider(bodyDataProvider);
    DataLayer rowHeaderDataLayer = new DataLayer(rowHeaderDataProvider);
    rowHeaderDataLayer.setDefaultColumnWidth(40);
    ILayer rowHeaderLayer = new RowHeaderLayer(rowHeaderDataLayer, viewportLayer, selectionLayer);
    ILayer cornerLayer = new CornerLayer(new DataLayer(new DefaultCornerDataProvider(columnHeaderDataProvider, rowHeaderDataProvider)), rowHeaderLayer, columnHeaderLayer);
    GridLayer compositeLayer = new GridLayer(viewportLayer, columnHeaderLayer, rowHeaderLayer, cornerLayer);
    return new NatTable(parent, compositeLayer);
}
Also used : DummyBodyDataProvider(org.eclipse.nebula.widgets.nattable.grid.data.DummyBodyDataProvider) 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) ColumnHideShowLayer(org.eclipse.nebula.widgets.nattable.hideshow.ColumnHideShowLayer) DefaultRowHeaderDataProvider(org.eclipse.nebula.widgets.nattable.grid.data.DefaultRowHeaderDataProvider) DefaultCornerDataProvider(org.eclipse.nebula.widgets.nattable.grid.data.DefaultCornerDataProvider) ViewportLayer(org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer) DummyColumnHeaderDataProvider(org.eclipse.nebula.widgets.nattable.grid.data.DummyColumnHeaderDataProvider) DataLayer(org.eclipse.nebula.widgets.nattable.layer.DataLayer) InvertedLayer(org.eclipse.nebula.widgets.nattable.layer.InvertedLayer) RowHeaderLayer(org.eclipse.nebula.widgets.nattable.grid.layer.RowHeaderLayer) CornerLayer(org.eclipse.nebula.widgets.nattable.grid.layer.CornerLayer) SelectionLayer(org.eclipse.nebula.widgets.nattable.selection.SelectionLayer) NatTable(org.eclipse.nebula.widgets.nattable.NatTable) GridLayer(org.eclipse.nebula.widgets.nattable.grid.layer.GridLayer)

Aggregations

NatTable (org.eclipse.nebula.widgets.nattable.NatTable)1 DefaultCornerDataProvider (org.eclipse.nebula.widgets.nattable.grid.data.DefaultCornerDataProvider)1 DefaultRowHeaderDataProvider (org.eclipse.nebula.widgets.nattable.grid.data.DefaultRowHeaderDataProvider)1 DummyBodyDataProvider (org.eclipse.nebula.widgets.nattable.grid.data.DummyBodyDataProvider)1 DummyColumnHeaderDataProvider (org.eclipse.nebula.widgets.nattable.grid.data.DummyColumnHeaderDataProvider)1 ColumnHeaderLayer (org.eclipse.nebula.widgets.nattable.grid.layer.ColumnHeaderLayer)1 CornerLayer (org.eclipse.nebula.widgets.nattable.grid.layer.CornerLayer)1 GridLayer (org.eclipse.nebula.widgets.nattable.grid.layer.GridLayer)1 RowHeaderLayer (org.eclipse.nebula.widgets.nattable.grid.layer.RowHeaderLayer)1 ColumnHideShowLayer (org.eclipse.nebula.widgets.nattable.hideshow.ColumnHideShowLayer)1 DataLayer (org.eclipse.nebula.widgets.nattable.layer.DataLayer)1 ILayer (org.eclipse.nebula.widgets.nattable.layer.ILayer)1 InvertedLayer (org.eclipse.nebula.widgets.nattable.layer.InvertedLayer)1 ColumnReorderLayer (org.eclipse.nebula.widgets.nattable.reorder.ColumnReorderLayer)1 SelectionLayer (org.eclipse.nebula.widgets.nattable.selection.SelectionLayer)1 ViewportLayer (org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer)1