Examples of IDataProvider


Examples of org.eclipse.nebula.widgets.nattable.data.IDataProvider

        };
    }

    private IDataProvider getColumnHeaderDataProvider(
            final IDataProvider dependent) {
        return new IDataProvider() {

            public int getColumnCount() {
                return dependent.getColumnCount();
            }
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.data.IDataProvider

        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(
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.data.IDataProvider

                + "This example shows a basic data layer that is backed by a custom data provider that names cells by column letter and "
                + "row number.";
    }

    public Control createExampleControl(Composite parent) {
        IDataProvider myDataProvider = new IDataProvider() {

            public int getColumnCount() {
                return 26;
            }
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.data.IDataProvider

        columnHeaderDataLayer
        .setConfigLabelAccumulator(new ColumnLabelAccumulator());

        final DataLayer bodyDataLayer = (DataLayer) gridLayer
                .getBodyDataLayer();
        IDataProvider dataProvider = bodyDataLayer.getDataProvider();

        // 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(
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.data.IDataProvider

                    return columnPropertyAccessor.getColumnIndex(propertyName);
                }
            }
        };

        final IDataProvider listDataProvider = new ListDataProvider<Person>(
                myList, derivedColumnPropertyAccessor);

        // Column header data provider includes derived properties
        IDataProvider columnHeaderDataProvider = new IDataProvider() {

            public Object getDataValue(int columnIndex, int rowIndex) {
                return derivedColumnPropertyAccessor
                        .getColumnProperty(columnIndex);
            }
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.data.IDataProvider

        String[] propertyNames = { "firstName", "lastName", "rank",
                "serialNumber" };

        IColumnPropertyAccessor<Person> columnPropertyAccessor = new ReflectiveColumnPropertyAccessor<Person>(
                propertyNames);
        IDataProvider listDataProvider = new ListDataProvider<Person>(myList,
                columnPropertyAccessor);
        ILayer layer = new DataLayer(listDataProvider);

        return new NatTable(parent, layer);
    }
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.data.IDataProvider

        GridDataFactory.fillDefaults().grab(true, true).applyTo(buttonPanel);

        ConfigRegistry configRegistry = new ConfigRegistry();

        // create the body layer stack
        IDataProvider bodyDataProvider = new ListDataProvider<Map<String, String>>(
                values, new MyColumnPropertyAccessor());
        final DataLayer bodyDataLayer = new DataLayer(bodyDataProvider);
        DefaultBodyLayerStack bodyLayerStack = new DefaultBodyLayerStack(
                bodyDataLayer);

        // create the column header layer stack
        IDataProvider columnHeaderDataProvider = new SimpleColumnHeaderDataProvider();
        ILayer columnHeaderLayer = new ColumnHeaderLayer(new DataLayer(
                columnHeaderDataProvider), bodyLayerStack.getViewportLayer(),
                bodyLayerStack.getSelectionLayer());

        // create the row header layer stack
        IDataProvider rowHeaderDataProvider = new DefaultRowHeaderDataProvider(
                bodyDataProvider);
        ILayer rowHeaderLayer = new RowHeaderLayer(
                new DefaultRowHeaderDataLayer(new DefaultRowHeaderDataProvider(
                        bodyDataProvider)), bodyLayerStack.getViewportLayer(),
                bodyLayerStack.getSelectionLayer());
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.data.IDataProvider

        // Usually you would create a new layer stack by extending
        // AbstractIndexLayerTransform and
        // setting the ViewportLayer as underlying layer. But in this case using
        // the ViewportLayer
        // directly as body layer is also working.
        IDataProvider bodyDataProvider = new DefaultBodyDataProvider<Person>(
                PersonService.getPersons(100), propertyNames);
        DataLayer bodyDataLayer = new DataLayer(bodyDataProvider);
        SelectionLayer selectionLayer = new SelectionLayer(bodyDataLayer);
        ViewportLayer viewportLayer = new ViewportLayer(selectionLayer);

        // build the column header layer
        IDataProvider columnHeaderDataProvider = new DefaultColumnHeaderDataProvider(
                propertyNames, propertyToLabelMap);
        DataLayer columnHeaderDataLayer = new DefaultColumnHeaderDataLayer(
                columnHeaderDataProvider);
        ILayer columnHeaderLayer = new ColumnHeaderLayer(columnHeaderDataLayer,
                viewportLayer, selectionLayer);

        // build the row header layer
        IDataProvider rowHeaderDataProvider = new DefaultRowHeaderDataProvider(
                bodyDataProvider);
        DataLayer rowHeaderDataLayer = new DefaultRowHeaderDataLayer(
                rowHeaderDataProvider);
        ILayer rowHeaderLayer = new RowHeaderLayer(rowHeaderDataLayer,
                viewportLayer, selectionLayer);

        // build the corner layer
        IDataProvider cornerDataProvider = new DefaultCornerDataProvider(
                columnHeaderDataProvider, rowHeaderDataProvider);
        DataLayer cornerDataLayer = new DataLayer(cornerDataProvider);
        ILayer cornerLayer = new CornerLayer(cornerDataLayer, rowHeaderLayer,
                columnHeaderLayer);
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.data.IDataProvider

                }
            }
        });

        // build the column header layer
        IDataProvider columnHeaderDataProvider = new DefaultColumnHeaderDataProvider(
                propertyNames, propertyToLabelMap);
        final DataLayer columnHeaderDataLayer = new DefaultColumnHeaderDataLayer(
                columnHeaderDataProvider);
        HoverLayer columnHoverLayer = new HoverLayer(columnHeaderDataLayer,
                false);
        final ColumnHeaderLayer columnHeaderLayer = new ColumnHeaderLayer(
                columnHoverLayer, viewportLayer, selectionLayer, false);

        // add ColumnHeaderHoverLayerConfiguration to ensure that hover styling
        // and resizing is working together
        columnHeaderLayer
                .addConfiguration(new ColumnHeaderHoverLayerConfiguration(
                        columnHoverLayer));

        // build the row header layer
        IDataProvider rowHeaderDataProvider = new DefaultRowHeaderDataProvider(
                bodyDataProvider);
        DataLayer rowHeaderDataLayer = new DefaultRowHeaderDataLayer(
                rowHeaderDataProvider);
        HoverLayer rowHoverLayer = new HoverLayer(rowHeaderDataLayer, false);
        RowHeaderLayer rowHeaderLayer = new RowHeaderLayer(rowHoverLayer,
                viewportLayer, selectionLayer, false);

        // add RowHeaderHoverLayerConfiguration to ensure that hover styling and
        // resizing is working together
        rowHeaderLayer.addConfiguration(new RowHeaderHoverLayerConfiguration(
                rowHoverLayer));

        // build the corner layer
        IDataProvider cornerDataProvider = new DefaultCornerDataProvider(
                columnHeaderDataProvider, rowHeaderDataProvider);
        DataLayer cornerDataLayer = new DataLayer(cornerDataProvider);
        final CornerLayer cornerLayer = new CornerLayer(cornerDataLayer,
                rowHeaderLayer, columnHeaderLayer);
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.data.IDataProvider

                .getPropertyToLabelMap();
        List<RowDataFixture> largeList = RowDataListFixture.getList(26000);

        Assert.assertTrue(largeList.size() > 25000);

        IDataProvider glazedListsDataProvider = new GlazedListsDataProvider<RowDataFixture>(
                GlazedLists.eventList(largeList),
                new ReflectiveColumnPropertyAccessor<RowDataFixture>(
                        propertyNames));

        IDataProvider columnHeaderDataProvider = new DefaultColumnHeaderDataProvider(
                propertyNames, propertyToLabelMap);

        layer = new DefaultGridLayer(glazedListsDataProvider,
                columnHeaderDataProvider);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.