Search in sources :

Example 1 with StaticFilterExampleGridLayer

use of org.eclipse.nebula.widgets.nattable.examples.fixtures.StaticFilterExampleGridLayer in project nebula.widgets.nattable by eclipse.

the class StaticFilterGridExample method createExampleControl.

@Override
public Control createExampleControl(Composite parent) {
    IConfigRegistry configRegistry = new ConfigRegistry();
    StaticFilterExampleGridLayer underlyingLayer = new StaticFilterExampleGridLayer(configRegistry);
    DataLayer bodyDataLayer = underlyingLayer.getBodyDataLayer();
    IDataProvider dataProvider = underlyingLayer.getBodyDataProvider();
    // NOTE: Register the accumulator on the body data layer.
    // This ensures that the labels are bound to the column index and are
    // unaffected by column order.
    final ColumnOverrideLabelAccumulator columnLabelAccumulator = new ColumnOverrideLabelAccumulator(bodyDataLayer);
    bodyDataLayer.setConfigLabelAccumulator(columnLabelAccumulator);
    NatTable natTable = new NatTable(parent, underlyingLayer, false);
    natTable.addConfiguration(new DefaultNatTableStyleConfiguration());
    natTable.addConfiguration(new HeaderMenuConfiguration(natTable));
    // natTable.addConfiguration(new DebugMenuConfiguration(natTable));
    natTable.addConfiguration(new FilterRowCustomConfiguration());
    natTable.addConfiguration(EditableGridExample.editableGridConfiguration(columnLabelAccumulator, dataProvider));
    natTable.setConfigRegistry(configRegistry);
    natTable.configure();
    return natTable;
}
Also used : ConfigRegistry(org.eclipse.nebula.widgets.nattable.config.ConfigRegistry) IConfigRegistry(org.eclipse.nebula.widgets.nattable.config.IConfigRegistry) StaticFilterExampleGridLayer(org.eclipse.nebula.widgets.nattable.examples.fixtures.StaticFilterExampleGridLayer) FilterRowDataLayer(org.eclipse.nebula.widgets.nattable.filterrow.FilterRowDataLayer) DataLayer(org.eclipse.nebula.widgets.nattable.layer.DataLayer) DefaultNatTableStyleConfiguration(org.eclipse.nebula.widgets.nattable.config.DefaultNatTableStyleConfiguration) IConfigRegistry(org.eclipse.nebula.widgets.nattable.config.IConfigRegistry) HeaderMenuConfiguration(org.eclipse.nebula.widgets.nattable.ui.menu.HeaderMenuConfiguration) NatTable(org.eclipse.nebula.widgets.nattable.NatTable) IDataProvider(org.eclipse.nebula.widgets.nattable.data.IDataProvider) ColumnOverrideLabelAccumulator(org.eclipse.nebula.widgets.nattable.layer.cell.ColumnOverrideLabelAccumulator)

Aggregations

NatTable (org.eclipse.nebula.widgets.nattable.NatTable)1 ConfigRegistry (org.eclipse.nebula.widgets.nattable.config.ConfigRegistry)1 DefaultNatTableStyleConfiguration (org.eclipse.nebula.widgets.nattable.config.DefaultNatTableStyleConfiguration)1 IConfigRegistry (org.eclipse.nebula.widgets.nattable.config.IConfigRegistry)1 IDataProvider (org.eclipse.nebula.widgets.nattable.data.IDataProvider)1 StaticFilterExampleGridLayer (org.eclipse.nebula.widgets.nattable.examples.fixtures.StaticFilterExampleGridLayer)1 FilterRowDataLayer (org.eclipse.nebula.widgets.nattable.filterrow.FilterRowDataLayer)1 DataLayer (org.eclipse.nebula.widgets.nattable.layer.DataLayer)1 ColumnOverrideLabelAccumulator (org.eclipse.nebula.widgets.nattable.layer.cell.ColumnOverrideLabelAccumulator)1 HeaderMenuConfiguration (org.eclipse.nebula.widgets.nattable.ui.menu.HeaderMenuConfiguration)1