Search in sources :

Example 86 with ConfigRegistry

use of org.eclipse.nebula.widgets.nattable.config.ConfigRegistry 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)

Example 87 with ConfigRegistry

use of org.eclipse.nebula.widgets.nattable.config.ConfigRegistry in project nebula.widgets.nattable by eclipse.

the class _010_Column_categories method createExampleControl.

@Override
public Control createExampleControl(Composite parent) {
    ConfigRegistry configRegistry = new ConfigRegistry();
    String[] propertyNames = new String[20];
    for (int i = 0; i < 20; i++) {
        propertyNames[i] = RowDataListFixture.getPropertyNames()[i];
    }
    this.gridLayer = new GlazedListsGridLayer<>(GlazedLists.eventList(RowDataListFixture.getList()), propertyNames, RowDataListFixture.getPropertyToLabelMap(), configRegistry);
    NatTable natTable = new NatTable(parent, this.gridLayer, false);
    natTable.addConfiguration(new DefaultNatTableStyleConfiguration());
    natTable.addConfiguration(new HeaderMenuConfiguration(natTable) {

        @Override
        protected PopupMenuBuilder createColumnHeaderMenu(NatTable natTable) {
            return super.createColumnHeaderMenu(natTable).withCategoriesBasedColumnChooser("Choose columns");
        }
    });
    configureColumnCategoriesInChooser();
    natTable.configure();
    return natTable;
}
Also used : ConfigRegistry(org.eclipse.nebula.widgets.nattable.config.ConfigRegistry) DefaultNatTableStyleConfiguration(org.eclipse.nebula.widgets.nattable.config.DefaultNatTableStyleConfiguration) HeaderMenuConfiguration(org.eclipse.nebula.widgets.nattable.ui.menu.HeaderMenuConfiguration) NatTable(org.eclipse.nebula.widgets.nattable.NatTable) PopupMenuBuilder(org.eclipse.nebula.widgets.nattable.ui.menu.PopupMenuBuilder)

Example 88 with ConfigRegistry

use of org.eclipse.nebula.widgets.nattable.config.ConfigRegistry in project nebula.widgets.nattable by eclipse.

the class _200_Group_by method createExampleControl.

@Override
public Control createExampleControl(Composite parent) {
    Composite comp = new Composite(parent, SWT.NONE);
    comp.setLayout(new GridLayout(1, false));
    // Underlying data source
    EventList<RowDataFixture> eventList = GlazedLists.eventList(RowDataListFixture.getList(200));
    String[] propertyNames = RowDataListFixture.getPropertyNames();
    Map<String, String> propertyToLabelMap = RowDataListFixture.getPropertyToLabelMap();
    IColumnPropertyAccessor<RowDataFixture> reflectiveColumnPropertyAccessor = new ReflectiveColumnPropertyAccessor<>(propertyNames);
    GroupByModel groupByModel = new GroupByModel();
    // Summary
    ConfigRegistry configRegistry = new ConfigRegistry();
    configRegistry.registerConfigAttribute(GroupByConfigAttributes.GROUP_BY_SUMMARY_PROVIDER, new SummationGroupBySummaryProvider<>(reflectiveColumnPropertyAccessor), DisplayMode.NORMAL, GroupByDataLayer.GROUP_BY_COLUMN_PREFIX + RowDataListFixture.getColumnIndexOfProperty(RowDataListFixture.LOT_SIZE_PROP_NAME));
    GroupByDataLayer<RowDataFixture> bodyDataLayer = new GroupByDataLayer<>(groupByModel, eventList, reflectiveColumnPropertyAccessor, configRegistry);
    // Body layer
    ColumnReorderLayer columnReorderLayer = new ColumnReorderLayer(bodyDataLayer);
    ColumnHideShowLayer columnHideShowLayer = new ColumnHideShowLayer(columnReorderLayer);
    SelectionLayer selectionLayer = new SelectionLayer(columnHideShowLayer);
    TreeLayer treeLayer = new TreeLayer(selectionLayer, bodyDataLayer.getTreeRowModel());
    FreezeLayer freeze = new FreezeLayer(treeLayer);
    ViewportLayer viewportLayer = new ViewportLayer(treeLayer);
    CompositeFreezeLayer compFreeze = new CompositeFreezeLayer(freeze, viewportLayer, selectionLayer);
    // Column header layer
    final IDataProvider columnHeaderDataProvider = new DefaultColumnHeaderDataProvider(propertyNames, propertyToLabelMap);
    final DataLayer columnHeaderDataLayer = new DefaultColumnHeaderDataLayer(columnHeaderDataProvider);
    ColumnHeaderLayer columnHeaderLayer = new ColumnHeaderLayer(columnHeaderDataLayer, compFreeze, selectionLayer);
    // Note: The column header layer is wrapped in a filter row composite.
    // This plugs in the filter row functionality
    ColumnOverrideLabelAccumulator labelAccumulator = new ColumnOverrideLabelAccumulator(columnHeaderDataLayer);
    columnHeaderDataLayer.setConfigLabelAccumulator(labelAccumulator);
    bodyDataLayer.setConfigLabelAccumulator(labelAccumulator);
    // Register labels
    labelAccumulator.registerColumnOverrides(RowDataListFixture.getColumnIndexOfProperty(RowDataListFixture.RATING_PROP_NAME), "CUSTOM_COMPARATOR_LABEL");
    // Row header layer
    DefaultRowHeaderDataProvider rowHeaderDataProvider = new DefaultRowHeaderDataProvider(bodyDataLayer.getDataProvider());
    DefaultRowHeaderDataLayer rowHeaderDataLayer = new DefaultRowHeaderDataLayer(rowHeaderDataProvider);
    RowHeaderLayer rowHeaderLayer = new RowHeaderLayer(rowHeaderDataLayer, compFreeze, selectionLayer);
    // Corner layer
    DefaultCornerDataProvider cornerDataProvider = new DefaultCornerDataProvider(columnHeaderDataProvider, rowHeaderDataProvider);
    DataLayer cornerDataLayer = new DataLayer(cornerDataProvider);
    CornerLayer cornerLayer = new CornerLayer(cornerDataLayer, rowHeaderLayer, columnHeaderLayer);
    // Grid
    GridLayer gridLayer = new GridLayer(compFreeze, columnHeaderLayer, rowHeaderLayer, cornerLayer, false);
    CompositeLayer compositeGridLayer = new CompositeLayer(1, 2);
    final GroupByHeaderLayer groupByHeaderLayer = new GroupByHeaderLayer(groupByModel, gridLayer, columnHeaderDataProvider);
    compositeGridLayer.setChildLayer(GroupByHeaderLayer.GROUP_BY_REGION, groupByHeaderLayer, 0, 0);
    compositeGridLayer.setChildLayer("Grid", gridLayer, 0, 1);
    NatTable natTable = new NatTable(comp, compositeGridLayer, false);
    natTable.addConfiguration(new DefaultNatTableStyleConfiguration());
    natTable.addConfiguration(new GroupByHeaderMenuConfiguration(natTable, groupByHeaderLayer));
    natTable.addConfiguration(new HeaderMenuConfiguration(natTable));
    natTable.addConfiguration(new DebugMenuConfiguration(natTable));
    natTable.setConfigRegistry(configRegistry);
    natTable.configure();
    natTable.setLayoutData(new GridData(GridData.FILL_BOTH));
    Button button = new Button(comp, SWT.NONE);
    button.setText("Toggle Group By Header");
    button.addMouseListener(new MouseAdapter() {

        @Override
        public void mouseUp(MouseEvent e) {
            groupByHeaderLayer.setVisible(!groupByHeaderLayer.isVisible());
        }
    });
    return comp;
}
Also used : GroupByDataLayer(org.eclipse.nebula.widgets.nattable.extension.glazedlists.groupBy.GroupByDataLayer) ColumnHeaderLayer(org.eclipse.nebula.widgets.nattable.grid.layer.ColumnHeaderLayer) HeaderMenuConfiguration(org.eclipse.nebula.widgets.nattable.ui.menu.HeaderMenuConfiguration) GroupByHeaderMenuConfiguration(org.eclipse.nebula.widgets.nattable.extension.glazedlists.groupBy.GroupByHeaderMenuConfiguration) ColumnHideShowLayer(org.eclipse.nebula.widgets.nattable.hideshow.ColumnHideShowLayer) DefaultCornerDataProvider(org.eclipse.nebula.widgets.nattable.grid.data.DefaultCornerDataProvider) ViewportLayer(org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer) IDataProvider(org.eclipse.nebula.widgets.nattable.data.IDataProvider) GroupByHeaderMenuConfiguration(org.eclipse.nebula.widgets.nattable.extension.glazedlists.groupBy.GroupByHeaderMenuConfiguration) ConfigRegistry(org.eclipse.nebula.widgets.nattable.config.ConfigRegistry) GridLayout(org.eclipse.swt.layout.GridLayout) GroupByDataLayer(org.eclipse.nebula.widgets.nattable.extension.glazedlists.groupBy.GroupByDataLayer) DataLayer(org.eclipse.nebula.widgets.nattable.layer.DataLayer) DefaultRowHeaderDataLayer(org.eclipse.nebula.widgets.nattable.grid.layer.DefaultRowHeaderDataLayer) DefaultColumnHeaderDataLayer(org.eclipse.nebula.widgets.nattable.grid.layer.DefaultColumnHeaderDataLayer) Button(org.eclipse.swt.widgets.Button) DefaultNatTableStyleConfiguration(org.eclipse.nebula.widgets.nattable.config.DefaultNatTableStyleConfiguration) CompositeFreezeLayer(org.eclipse.nebula.widgets.nattable.freeze.CompositeFreezeLayer) FreezeLayer(org.eclipse.nebula.widgets.nattable.freeze.FreezeLayer) DefaultRowHeaderDataLayer(org.eclipse.nebula.widgets.nattable.grid.layer.DefaultRowHeaderDataLayer) NatTable(org.eclipse.nebula.widgets.nattable.NatTable) DebugMenuConfiguration(org.eclipse.nebula.widgets.nattable.ui.menu.DebugMenuConfiguration) ColumnOverrideLabelAccumulator(org.eclipse.nebula.widgets.nattable.layer.cell.ColumnOverrideLabelAccumulator) GroupByHeaderLayer(org.eclipse.nebula.widgets.nattable.extension.glazedlists.groupBy.GroupByHeaderLayer) MouseEvent(org.eclipse.swt.events.MouseEvent) Composite(org.eclipse.swt.widgets.Composite) MouseAdapter(org.eclipse.swt.events.MouseAdapter) ColumnReorderLayer(org.eclipse.nebula.widgets.nattable.reorder.ColumnReorderLayer) DefaultColumnHeaderDataLayer(org.eclipse.nebula.widgets.nattable.grid.layer.DefaultColumnHeaderDataLayer) DefaultRowHeaderDataProvider(org.eclipse.nebula.widgets.nattable.grid.data.DefaultRowHeaderDataProvider) RowDataFixture(org.eclipse.nebula.widgets.nattable.dataset.fixture.data.RowDataFixture) CompositeLayer(org.eclipse.nebula.widgets.nattable.layer.CompositeLayer) ReflectiveColumnPropertyAccessor(org.eclipse.nebula.widgets.nattable.data.ReflectiveColumnPropertyAccessor) 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) TreeLayer(org.eclipse.nebula.widgets.nattable.tree.TreeLayer) GroupByModel(org.eclipse.nebula.widgets.nattable.extension.glazedlists.groupBy.GroupByModel) GridData(org.eclipse.swt.layout.GridData) CompositeFreezeLayer(org.eclipse.nebula.widgets.nattable.freeze.CompositeFreezeLayer) GridLayer(org.eclipse.nebula.widgets.nattable.grid.layer.GridLayer) DefaultColumnHeaderDataProvider(org.eclipse.nebula.widgets.nattable.grid.data.DefaultColumnHeaderDataProvider)

Example 89 with ConfigRegistry

use of org.eclipse.nebula.widgets.nattable.config.ConfigRegistry in project nebula.widgets.nattable by eclipse.

the class _900_Everything_but_the_kitchen_sink method createExampleControl.

@Override
public Control createExampleControl(Composite parent) {
    final String[] propertyNames = RowDataListFixture.getPropertyNames();
    final Map<String, String> propertyToLabelMap = RowDataListFixture.getPropertyToLabelMap();
    ConfigRegistry configRegistry = new ConfigRegistry();
    ColumnGroupModel columnGroupModel = new ColumnGroupModel();
    // Body
    LinkedList<BlinkingRowDataFixture> rowData = new LinkedList<>();
    this.baseEventList = GlazedLists.threadSafeList(GlazedLists.eventList(rowData));
    ObservableElementList<BlinkingRowDataFixture> observableElementList = new ObservableElementList<>(this.baseEventList, GlazedLists.beanConnector(BlinkingRowDataFixture.class));
    FilterList<BlinkingRowDataFixture> filterList = new FilterList<>(observableElementList);
    SortedList<BlinkingRowDataFixture> sortedList = new SortedList<>(filterList, null);
    FullFeaturedBodyLayerStack<BlinkingRowDataFixture> bodyLayer = new FullFeaturedBodyLayerStack<>(sortedList, new IRowIdAccessor<BlinkingRowDataFixture>() {

        @Override
        public Serializable getRowId(BlinkingRowDataFixture rowObject) {
            return rowObject.getSecurity_description();
        }
    }, propertyNames, configRegistry, columnGroupModel);
    this.bodyDataProvider = bodyLayer.getBodyDataProvider();
    this.propertyChangeListener = bodyLayer.getGlazedListEventsLayer();
    // blinking
    registerBlinkingConfigCells(configRegistry);
    // Column header
    FullFeaturedColumnHeaderLayerStack<BlinkingRowDataFixture> columnHeaderLayer = new FullFeaturedColumnHeaderLayerStack<>(sortedList, filterList, propertyNames, propertyToLabelMap, bodyLayer, bodyLayer.getSelectionLayer(), columnGroupModel, configRegistry);
    // column groups
    setUpColumnGroups(columnHeaderLayer);
    // Row header
    final DefaultRowHeaderDataProvider rowHeaderDataProvider = new DefaultSummaryRowHeaderDataProvider(this.bodyDataProvider);
    DefaultRowHeaderDataLayer rowHeaderDataLayer = new DefaultRowHeaderDataLayer(rowHeaderDataProvider);
    rowHeaderDataLayer.setDefaultColumnWidth(50);
    ILayer rowHeaderLayer = new RowHeaderLayer(rowHeaderDataLayer, bodyLayer, bodyLayer.getSelectionLayer());
    // Corner
    final DefaultCornerDataProvider cornerDataProvider = new DefaultCornerDataProvider(columnHeaderLayer.getColumnHeaderDataProvider(), rowHeaderDataProvider);
    DataLayer cornerDataLayer = new DataLayer(cornerDataProvider);
    ILayer cornerLayer = new CornerLayer(cornerDataLayer, rowHeaderLayer, columnHeaderLayer);
    // Grid
    GridLayer gridLayer = new GridLayer(bodyLayer, columnHeaderLayer, rowHeaderLayer, cornerLayer);
    this.natTable = new NatTable(parent, gridLayer, false);
    this.natTable.setConfigRegistry(configRegistry);
    this.natTable.addConfiguration(new DefaultNatTableStyleConfiguration());
    // Popup menu
    this.natTable.addConfiguration(new HeaderMenuConfiguration(this.natTable) {

        @Override
        protected PopupMenuBuilder createColumnHeaderMenu(NatTable natTable) {
            return super.createColumnHeaderMenu(natTable).withColumnChooserMenuItem();
        }
    });
    this.natTable.addConfiguration(new SingleClickSortConfiguration());
    // Editing
    ColumnOverrideLabelAccumulator columnLabelAccumulator = new ColumnOverrideLabelAccumulator(bodyLayer.getBodyDataLayer());
    bodyLayer.getBodyDataLayer().setConfigLabelAccumulator(columnLabelAccumulator);
    this.natTable.addConfiguration(EditableGridExample.editableGridConfiguration(columnLabelAccumulator, this.bodyDataProvider));
    this.natTable.addConfiguration(new FilterRowGridExample.FilterRowCustomConfiguration());
    // Column chooser
    DisplayColumnChooserCommandHandler columnChooserCommandHandler = new DisplayColumnChooserCommandHandler(bodyLayer.getSelectionLayer(), bodyLayer.getColumnHideShowLayer(), columnHeaderLayer.getColumnHeaderLayer(), columnHeaderLayer.getColumnHeaderDataLayer(), columnHeaderLayer.getColumnGroupHeaderLayer(), columnGroupModel);
    bodyLayer.registerCommandHandler(columnChooserCommandHandler);
    // Summary row configuration
    this.natTable.addConfiguration(new MySummaryRow<>(this.bodyDataProvider));
    this.natTable.configure();
    return this.natTable;
}
Also used : Serializable(java.io.Serializable) DefaultSummaryRowHeaderDataProvider(org.eclipse.nebula.widgets.nattable.grid.data.DefaultSummaryRowHeaderDataProvider) FullFeaturedColumnHeaderLayerStack(org.eclipse.nebula.widgets.nattable.examples.fixtures.FullFeaturedColumnHeaderLayerStack) HeaderMenuConfiguration(org.eclipse.nebula.widgets.nattable.ui.menu.HeaderMenuConfiguration) SortedList(ca.odell.glazedlists.SortedList) DefaultCornerDataProvider(org.eclipse.nebula.widgets.nattable.grid.data.DefaultCornerDataProvider) ObservableElementList(ca.odell.glazedlists.ObservableElementList) ConfigRegistry(org.eclipse.nebula.widgets.nattable.config.ConfigRegistry) IConfigRegistry(org.eclipse.nebula.widgets.nattable.config.IConfigRegistry) DataLayer(org.eclipse.nebula.widgets.nattable.layer.DataLayer) DefaultRowHeaderDataLayer(org.eclipse.nebula.widgets.nattable.grid.layer.DefaultRowHeaderDataLayer) DefaultNatTableStyleConfiguration(org.eclipse.nebula.widgets.nattable.config.DefaultNatTableStyleConfiguration) DefaultRowHeaderDataLayer(org.eclipse.nebula.widgets.nattable.grid.layer.DefaultRowHeaderDataLayer) NatTable(org.eclipse.nebula.widgets.nattable.NatTable) ColumnOverrideLabelAccumulator(org.eclipse.nebula.widgets.nattable.layer.cell.ColumnOverrideLabelAccumulator) FilterRowGridExample(org.eclipse.nebula.widgets.nattable.examples.examples._131_Filtering.FilterRowGridExample) DisplayColumnChooserCommandHandler(org.eclipse.nebula.widgets.nattable.columnChooser.command.DisplayColumnChooserCommandHandler) ILayer(org.eclipse.nebula.widgets.nattable.layer.ILayer) FilterList(ca.odell.glazedlists.FilterList) DefaultRowHeaderDataProvider(org.eclipse.nebula.widgets.nattable.grid.data.DefaultRowHeaderDataProvider) ColumnGroupModel(org.eclipse.nebula.widgets.nattable.group.ColumnGroupModel) LinkedList(java.util.LinkedList) BlinkingRowDataFixture(org.eclipse.nebula.widgets.nattable.dataset.fixture.data.BlinkingRowDataFixture) RowHeaderLayer(org.eclipse.nebula.widgets.nattable.grid.layer.RowHeaderLayer) FullFeaturedBodyLayerStack(org.eclipse.nebula.widgets.nattable.examples.fixtures.FullFeaturedBodyLayerStack) CornerLayer(org.eclipse.nebula.widgets.nattable.grid.layer.CornerLayer) SingleClickSortConfiguration(org.eclipse.nebula.widgets.nattable.sort.config.SingleClickSortConfiguration) GridLayer(org.eclipse.nebula.widgets.nattable.grid.layer.GridLayer) PopupMenuBuilder(org.eclipse.nebula.widgets.nattable.ui.menu.PopupMenuBuilder)

Example 90 with ConfigRegistry

use of org.eclipse.nebula.widgets.nattable.config.ConfigRegistry in project nebula.widgets.nattable by eclipse.

the class BlinkingGlazedListExample method createExampleControl.

@Override
public Control createExampleControl(Composite parent) {
    // Data backing the table
    this.baseTupleList.add(new Tuple(this.headers, new Object[] { "Name 1", "Value 1", 1.5d, -1000 }, 0));
    this.baseTupleList.add(new Tuple(this.headers, new Object[] { "Name 2", "Value 2", -2.5d, 2000 }, 1));
    this.baseTupleList.add(new Tuple(this.headers, new Object[] { "Name 3", "Value 3", 3.5d, -3000 }, 2));
    this.baseTupleList.add(new Tuple(this.headers, new Object[] { "Name 4", "Value 4", -4.5d, 4000 }, 3));
    this.baseTupleList.add(new Tuple(this.headers, new Object[] { "Name 5", "Value 5", 5.5d, -5000 }, 4));
    ConfigRegistry configRegistry = new ConfigRegistry();
    ObservableElementList<Tuple> observableTupleList = new ObservableElementList<>(this.baseTupleList, GlazedLists.beanConnector(Tuple.class));
    TupleColumnPropertyAccessor columnPropertyAccessor = new TupleColumnPropertyAccessor();
    ListDataProvider<Tuple> bodyDataProvider = new ListDataProvider<>(observableTupleList, columnPropertyAccessor);
    DataLayer bodyDataLayer = new DataLayer(bodyDataProvider);
    // Enable capturing glazed list update events
    GlazedListsEventLayer<Tuple> glazedListEventsLayer = new GlazedListsEventLayer<>(bodyDataLayer, this.baseTupleList);
    // Enable blinking
    final BlinkLayer<Tuple> blinkingLayer = new BlinkLayer<>(glazedListEventsLayer, bodyDataProvider, getRowIdAccessor(), columnPropertyAccessor, configRegistry);
    registerBlinkingConfigCells(configRegistry);
    // Add Listener to existing elements
    try {
        this.baseTupleList.getReadWriteLock().readLock().lock();
        for (Tuple tuple : this.baseTupleList) {
            tuple.addPropertyChangeListener(glazedListEventsLayer);
        }
    } finally {
        this.baseTupleList.getReadWriteLock().readLock().unlock();
    }
    // Setup row/column and corner layers
    ColumnHeaderDataProvider defaultColumnHeaderDataProvider = new ColumnHeaderDataProvider();
    DefaultRowHeaderDataProvider rowHeaderDataProvider = new DefaultRowHeaderDataProvider(bodyDataProvider);
    DefaultCornerDataProvider defaultCornerDataProvider = new DefaultCornerDataProvider(defaultColumnHeaderDataProvider, rowHeaderDataProvider);
    // Build composite for all regions
    DefaultGridLayer gridLayer = new DefaultGridLayer(blinkingLayer, new DefaultColumnHeaderDataLayer(defaultColumnHeaderDataProvider), new DefaultRowHeaderDataLayer(rowHeaderDataProvider), new DataLayer(defaultCornerDataProvider));
    NatTable natTable = new NatTable(parent, gridLayer, false);
    natTable.setConfigRegistry(configRegistry);
    natTable.addConfiguration(new DefaultNatTableStyleConfiguration());
    natTable.configure();
    return natTable;
}
Also used : ListDataProvider(org.eclipse.nebula.widgets.nattable.data.ListDataProvider) DefaultRowHeaderDataProvider(org.eclipse.nebula.widgets.nattable.grid.data.DefaultRowHeaderDataProvider) DefaultCornerDataProvider(org.eclipse.nebula.widgets.nattable.grid.data.DefaultCornerDataProvider) DefaultColumnHeaderDataLayer(org.eclipse.nebula.widgets.nattable.grid.layer.DefaultColumnHeaderDataLayer) GlazedListsEventLayer(org.eclipse.nebula.widgets.nattable.extension.glazedlists.GlazedListsEventLayer) ObservableElementList(ca.odell.glazedlists.ObservableElementList) ConfigRegistry(org.eclipse.nebula.widgets.nattable.config.ConfigRegistry) DataLayer(org.eclipse.nebula.widgets.nattable.layer.DataLayer) DefaultRowHeaderDataLayer(org.eclipse.nebula.widgets.nattable.grid.layer.DefaultRowHeaderDataLayer) DefaultColumnHeaderDataLayer(org.eclipse.nebula.widgets.nattable.grid.layer.DefaultColumnHeaderDataLayer) DefaultNatTableStyleConfiguration(org.eclipse.nebula.widgets.nattable.config.DefaultNatTableStyleConfiguration) DefaultRowHeaderDataLayer(org.eclipse.nebula.widgets.nattable.grid.layer.DefaultRowHeaderDataLayer) NatTable(org.eclipse.nebula.widgets.nattable.NatTable) DefaultGridLayer(org.eclipse.nebula.widgets.nattable.grid.layer.DefaultGridLayer) BlinkLayer(org.eclipse.nebula.widgets.nattable.blink.BlinkLayer)

Aggregations

ConfigRegistry (org.eclipse.nebula.widgets.nattable.config.ConfigRegistry)92 DefaultNatTableStyleConfiguration (org.eclipse.nebula.widgets.nattable.config.DefaultNatTableStyleConfiguration)72 NatTable (org.eclipse.nebula.widgets.nattable.NatTable)61 IConfigRegistry (org.eclipse.nebula.widgets.nattable.config.IConfigRegistry)54 DataLayer (org.eclipse.nebula.widgets.nattable.layer.DataLayer)54 HashMap (java.util.HashMap)40 IDataProvider (org.eclipse.nebula.widgets.nattable.data.IDataProvider)38 DefaultRowHeaderDataLayer (org.eclipse.nebula.widgets.nattable.grid.layer.DefaultRowHeaderDataLayer)38 DefaultColumnHeaderDataLayer (org.eclipse.nebula.widgets.nattable.grid.layer.DefaultColumnHeaderDataLayer)34 GridLayer (org.eclipse.nebula.widgets.nattable.grid.layer.GridLayer)34 DefaultColumnHeaderDataProvider (org.eclipse.nebula.widgets.nattable.grid.data.DefaultColumnHeaderDataProvider)33 DefaultCornerDataProvider (org.eclipse.nebula.widgets.nattable.grid.data.DefaultCornerDataProvider)33 ColumnHeaderLayer (org.eclipse.nebula.widgets.nattable.grid.layer.ColumnHeaderLayer)33 GridLayout (org.eclipse.swt.layout.GridLayout)33 ILayer (org.eclipse.nebula.widgets.nattable.layer.ILayer)32 CornerLayer (org.eclipse.nebula.widgets.nattable.grid.layer.CornerLayer)31 RowHeaderLayer (org.eclipse.nebula.widgets.nattable.grid.layer.RowHeaderLayer)31 Composite (org.eclipse.swt.widgets.Composite)31 DefaultRowHeaderDataProvider (org.eclipse.nebula.widgets.nattable.grid.data.DefaultRowHeaderDataProvider)28 SelectionEvent (org.eclipse.swt.events.SelectionEvent)28