Search in sources :

Example 1 with FilterRowExampleGridLayer

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

the class FilterRowGridExample method createExampleControl.

@Override
public Control createExampleControl(Composite parent) {
    IConfigRegistry configRegistry = new ConfigRegistry();
    ILayer underlyingLayer = new FilterRowExampleGridLayer(configRegistry);
    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() {

        @Override
        public void configureRegistry(IConfigRegistry configRegistry) {
            super.configureRegistry(configRegistry);
            // Shade the row to be slightly darker than the blue background.
            final Style rowStyle = new Style();
            rowStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, GUIHelper.getColor(197, 212, 231));
            configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, rowStyle, DisplayMode.NORMAL, GridRegion.FILTER_ROW);
        }
    });
    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) ILayer(org.eclipse.nebula.widgets.nattable.layer.ILayer) 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) Style(org.eclipse.nebula.widgets.nattable.style.Style) NatTable(org.eclipse.nebula.widgets.nattable.NatTable) FilterRowExampleGridLayer(org.eclipse.nebula.widgets.nattable.examples.fixtures.FilterRowExampleGridLayer)

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 FilterRowExampleGridLayer (org.eclipse.nebula.widgets.nattable.examples.fixtures.FilterRowExampleGridLayer)1 ILayer (org.eclipse.nebula.widgets.nattable.layer.ILayer)1 Style (org.eclipse.nebula.widgets.nattable.style.Style)1 HeaderMenuConfiguration (org.eclipse.nebula.widgets.nattable.ui.menu.HeaderMenuConfiguration)1