Package org.eclipse.nebula.widgets.nattable.viewport

Examples of org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer$MoveViewportRunnable


            // layer for event handling of GlazedLists and PropertyChanges
            this.glazedListsEventLayer = new GlazedListsEventLayer<T>(
                    bodyDataLayer, filterList);

            this.selectionLayer = new SelectionLayer(getGlazedListsEventLayer());
            ViewportLayer viewportLayer = new ViewportLayer(getSelectionLayer());

            FreezeLayer freezeLayer = new FreezeLayer(selectionLayer);
            CompositeFreezeLayer compositeFreezeLayer = new CompositeFreezeLayer(
                    freezeLayer, viewportLayer, selectionLayer);
View Full Code Here


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

            // add a tree layer to visualise the grouping
            this.treeLayer = new TreeLayer(this.selectionLayer,
                    this.bodyDataLayer.getTreeRowModel());

            ViewportLayer viewportLayer = new ViewportLayer(this.treeLayer);

            setUnderlyingLayer(viewportLayer);
        }
View Full Code Here

                    false));

            // create a ViewportLayer for the left part of the table and
            // configure it to only contain
            // the first 5 columns
            viewportLayerLeft = new ViewportLayer(this.selectionLayer) {
                @Override
                public int getMaxColumnPosition() {
                    return getNumberOfLeftColumns();
                }
            };

            // create a ViewportLayer for the right part of the table and
            // configure it to only contain
            // the last 4 columns
            viewportLayerRight = new ViewportLayer(this.selectionLayer) {
                @Override
                public int getMinColumnPosition() {
                    return getNumberOfLeftColumns();
                }
            };
View Full Code Here

        // we need to ensure that the hover styling is removed when the mouse
        // cursor moves out of the cell area
        hoverLayer.addConfiguration(new SimpleHoverStylingBindings(hoverLayer));

        SelectionLayer selectionLayer = new SelectionLayer(hoverLayer);
        ViewportLayer viewportLayer = new ViewportLayer(selectionLayer);

        viewportLayer.setRegionName(GridRegion.BODY);

        // turn the auto configuration off as we want to add our hover styling
        // configuration
        NatTable natTable = new NatTable(parent, viewportLayer, false);
View Full Code Here

            // add a tree layer to visualise the grouping
            TreeLayer treeLayer = new TreeLayer(selectionLayer,
                    bodyDataLayer.getTreeRowModel());

            ViewportLayer viewportLayer = new ViewportLayer(treeLayer);

            setUnderlyingLayer(viewportLayer);
        }
View Full Code Here

        // directly as body layer is also working.
        IDataProvider bodyDataProvider = new DefaultBodyDataProvider<T>(values,
                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(
View Full Code Here

            // layer for event handling of GlazedLists and PropertyChanges
            GlazedListsEventLayer<T> glazedListsEventLayer = new GlazedListsEventLayer<T>(
                    bodyDataLayer, filterList);

            this.selectionLayer = new SelectionLayer(glazedListsEventLayer);
            ViewportLayer viewportLayer = new ViewportLayer(getSelectionLayer());

            setUnderlyingLayer(viewportLayer);
        }
View Full Code Here

                getSimpsonsList(), columnPropertyAccessor);
        final DataLayer firstBodyDataLayer = new DataLayer(
                firstBodyDataProvider);
        final SelectionLayer firstSelectionLayer = new SelectionLayer(
                firstBodyDataLayer);
        ViewportLayer firstViewportLayer = new ViewportLayer(
                firstSelectionLayer);

        // use a RowSelectionModel that will perform row selections and is able
        // 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,
                firstSelectionLayer);

        // register custom label styling to indicate if the table is active
        firstColumnHeaderDataLayer
                .setConfigLabelAccumulator(new IConfigLabelAccumulator() {
                    @Override
                    public void accumulateConfigLabels(LabelStack configLabels,
                            int columnPosition, int rowPosition) {
                        if (isFirstSelectionProvider) {
                            configLabels.addLabelOnTop(ACTIVE_LABEL);
                        }
                    }
                });

        // set the region labels to make default configurations work, e.g.
        // selection
        CompositeLayer firstCompositeLayer = new CompositeLayer(1, 2);
        firstCompositeLayer.setChildLayer(GridRegion.COLUMN_HEADER,
                firstColumnHeaderLayer, 0, 0);
        firstCompositeLayer.setChildLayer(GridRegion.BODY, firstViewportLayer,
                0, 1);

        final NatTable firstNatTable = new NatTable(panel, firstCompositeLayer,
                false);

        firstNatTable.addConfiguration(new DefaultNatTableStyleConfiguration());
        firstNatTable.addConfiguration(new ActiveTableStyleConfiguration());
        firstNatTable.configure();

        // set the modern theme
        firstNatTable.setTheme(new ModernNatTableThemeConfiguration());

        // add overlay painter for full borders
        firstNatTable.addOverlayPainter(new NatTableBorderOverlayPainter());

        // create the second table
        // create the body layer stack
        final IRowDataProvider<Person> secondBodyDataProvider = new ListDataProvider<Person>(
                getFlandersList(), columnPropertyAccessor);
        final DataLayer secondBodyDataLayer = new DataLayer(
                secondBodyDataProvider);
        final SelectionLayer secondSelectionLayer = new SelectionLayer(
                secondBodyDataLayer);
        ViewportLayer secondViewportLayer = new ViewportLayer(
                secondSelectionLayer);

        // use a RowSelectionModel that will perform row selections and is able
        // to identify a row via unique ID
        secondSelectionLayer.setSelectionModel(new RowSelectionModel<Person>(
View Full Code Here

                .setLayerPainter(new GridLineCellLayerPainter(true, false));

        // create a ViewportLayer for the left part of the table and configure
        // it to only contain
        // the first 5 columns
        final ViewportLayer viewportLayerLeft = new ViewportLayer(bodyDataLayer);
        viewportLayerLeft.setMaxColumnPosition(5);

        // create a ViewportLayer for the right part of the table and configure
        // it to only contain
        // the last 4 columns
        ViewportLayer viewportLayerRight = new ViewportLayer(bodyDataLayer);
        viewportLayerRight.setMinColumnPosition(5);

        // create a CompositeLayer that contains both ViewportLayers
        CompositeLayer compositeLayer = new CompositeLayer(2, 1);
        compositeLayer.setChildLayer("REGION_A", viewportLayerLeft, 0, 0);
        compositeLayer.setChildLayer("REGION_B", viewportLayerRight, 1, 0);
View Full Code Here

TOP

Related Classes of org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer$MoveViewportRunnable

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.