Package org.eclipse.nebula.widgets.nattable.data

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


        // to identify a row via unique ID
        firstSelectionLayer.setSelectionModel(new RowSelectionModel<Person>(
                firstSelectionLayer, firstBodyDataProvider, rowIdAccessor));

        // create the column header layer stack
        IDataProvider columnHeaderDataProvider = new DefaultColumnHeaderDataProvider(
                propertyNames, propertyToLabelMap);
        DataLayer firstColumnHeaderDataLayer = new DataLayer(
                columnHeaderDataProvider);
        ColumnHeaderLayer firstColumnHeaderLayer = new ColumnHeaderLayer(
                firstColumnHeaderDataLayer, firstViewportLayer,
View Full Code Here


                "address.postalCode", "address.city" };

        IColumnPropertyAccessor<PersonWithAddress> columnPropertyAccessor = new ExtendedReflectiveColumnPropertyAccessor<PersonWithAddress>(
                propertyNames);

        IDataProvider bodyDataProvider = new ListDataProvider<PersonWithAddress>(
                PersonService.getPersonsWithAddress(50), columnPropertyAccessor);
        DataLayer bodyDataLayer = new DataLayer(bodyDataProvider);

        // use a cell layer painter that is configured for left clipping
        // this ensures that the rendering works correctly for split viewports
View Full Code Here

        // 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(10), propertyNames);
        DataLayer bodyDataLayer = new DataLayer(bodyDataProvider);
        HoverLayer bodyHoverLayer = new HoverLayer(bodyDataLayer);
        SelectionLayer selectionLayer = new SelectionLayer(bodyHoverLayer);
        ViewportLayer viewportLayer = new ViewportLayer(selectionLayer);

        // build the column header layer
        IDataProvider columnHeaderDataProvider = new DefaultColumnHeaderDataProvider(
                propertyNames, propertyToLabelMap);
        DataLayer columnHeaderDataLayer = new DefaultColumnHeaderDataLayer(
                columnHeaderDataProvider);
        HoverLayer columnHoverLayer = new HoverLayer(columnHeaderDataLayer,
                false);
        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);
        ILayer cornerLayer = new CornerLayer(cornerDataLayer, rowHeaderLayer,
                columnHeaderLayer);
View Full Code Here

            ColumnHideShowLayer columnHideShowLayer = new ColumnHideShowLayer(columnReorderLayer);
            this.selectionLayer = new SelectionLayer(columnHideShowLayer);
            setBodyLayer(this.selectionLayer);

            // create and set the column header layer stack
            IDataProvider columnHeaderDataProvider = new DummyColumnHeaderDataProvider(bodyDataProvider);
            DataLayer columnHeaderDataLayer = new DefaultColumnHeaderDataLayer(columnHeaderDataProvider);
            ILayer columnHeaderLayer = new ColumnHeaderLayer(columnHeaderDataLayer, this.selectionLayer, this.selectionLayer);
            setColumnHeaderLayer(columnHeaderLayer);

            // create and set the row header layer stack
            IDataProvider rowHeaderDataProvider = new DefaultRowHeaderDataProvider(bodyDataProvider);
            DataLayer rowHeaderDataLayer = new DefaultRowHeaderDataLayer(rowHeaderDataProvider);
            ILayer rowHeaderLayer = new RowHeaderLayer(rowHeaderDataLayer, this.selectionLayer, this.selectionLayer);
            setRowHeaderLayer(rowHeaderLayer);

            // create and set the corner layer stack
            IDataProvider cornerDataProvider = new DefaultCornerDataProvider(columnHeaderDataProvider, rowHeaderDataProvider);
            DataLayer cornerDataLayer = new DataLayer(cornerDataProvider);
            ILayer cornerLayer = new CornerLayer(cornerDataLayer, rowHeaderLayer, columnHeaderLayer);
            setCornerLayer(cornerLayer);
        }
View Full Code Here

        // add a label accumulator to be able to register converter
        bodyLayerStack.getBodyDataLayer().setConfigLabelAccumulator(
                new ColumnLabelAccumulator());

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

        // build the row header layer
        IDataProvider rowHeaderDataProvider = new DefaultRowHeaderDataProvider(
                bodyLayerStack.getBodyDataProvider());
        DataLayer rowHeaderDataLayer = new DefaultRowHeaderDataLayer(
                rowHeaderDataProvider);
        ILayer rowHeaderLayer = new RowHeaderLayer(rowHeaderDataLayer,
                bodyLayerStack, bodyLayerStack.getSelectionLayer());

        // 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

        // will consume the
        // commands before they are handled by the SelectionLayer
        viewportLayer.addConfiguration(new RowOnlySelectionBindings());

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

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

                "address.postalCode", "address.city" };

        IColumnPropertyAccessor<PersonWithAddress> columnPropertyAccessor = new ExtendedReflectiveColumnPropertyAccessor<PersonWithAddress>(
                propertyNames);

        IDataProvider bodyDataProvider = new ListDataProvider<PersonWithAddress>(
                PersonService.getPersonsWithAddress(50), columnPropertyAccessor);
        DataLayer bodyDataLayer = new DataLayer(bodyDataProvider);
        ViewportLayer viewportLayer = new ViewportLayer(bodyDataLayer);

        NatTable natTable = new NatTable(parent, viewportLayer);
View Full Code Here

        // add a label accumulator to be able to register converter
        bodyLayerStack.getBodyDataLayer().setConfigLabelAccumulator(
                new ColumnLabelAccumulator());

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

        // Note: The column header layer is wrapped in a filter row composite.
        // This plugs in the filter row functionality
        FilterRowHeaderComposite<MyRowObject> filterRowHeaderLayer = new FilterRowHeaderComposite<MyRowObject>(
                new DefaultGlazedListsFilterStrategy<MyRowObject>(
                        bodyLayerStack.getFilterList(), columnPropertyAccessor,
                        configRegistry), columnHeaderLayer,
                columnHeaderDataLayer.getDataProvider(), configRegistry);

        // build the row header layer
        IDataProvider rowHeaderDataProvider = new DefaultRowHeaderDataProvider(
                bodyLayerStack.getBodyDataProvider());
        DataLayer rowHeaderDataLayer = new DefaultRowHeaderDataLayer(
                rowHeaderDataProvider);
        ILayer rowHeaderLayer = new RowHeaderLayer(rowHeaderDataLayer,
                bodyLayerStack, bodyLayerStack.getSelectionLayer());

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

        // 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(10), propertyNames);
        DataLayer bodyDataLayer = new DataLayer(bodyDataProvider);
        HoverLayer hoverLayer = new HoverLayer(bodyDataLayer);
        SelectionLayer selectionLayer = new SelectionLayer(hoverLayer);
        ViewportLayer viewportLayer = new ViewportLayer(selectionLayer);

        // build the column header layer
        IDataProvider columnHeaderDataProvider = new DefaultColumnHeaderDataProvider(
                propertyNames, propertyToLabelMap);
        DataLayer columnHeaderDataLayer = new DefaultColumnHeaderDataLayer(
                columnHeaderDataProvider);
        HoverLayer columnHoverLayer = new HoverLayer(columnHeaderDataLayer,
                false);
View Full Code Here

        // AbstractIndexLayerTransform and
        // setting the ViewportLayer as underlying layer. But in this case using
        // the ViewportLayer
        // directly as body layer is also working.
        final List<Person> contents = PersonService.getPersons(10);
        IDataProvider bodyDataProvider = new DefaultBodyDataProvider<Person>(
                contents, propertyNames);
        final DataLayer bodyDataLayer = new DataLayer(bodyDataProvider);
        final RowReorderLayer rowReorderLayer = new RowReorderLayer(
                bodyDataLayer);
        final SelectionLayer selectionLayer = new SelectionLayer(
                rowReorderLayer);
        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

TOP

Related Classes of org.eclipse.nebula.widgets.nattable.data.IDataProvider

Copyright © 2018 www.massapicom. 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.