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

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


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


        ConfigRegistry configRegistry = new ConfigRegistry();

        // Summary row fixed on top
        DataLayer dataLayer = new DataLayer(dataProvider);

        ViewportLayer viewportLayer = new ViewportLayer(dataLayer);

        // Plug in the SummaryRowLayer
        SummaryRowLayer summaryRowLayer = new SummaryRowLayer(dataLayer, configRegistry, false);
        // configure the SummaryRowLayer to be rendered standalone
        summaryRowLayer.setStandalone(true);

        CompositeLayer composite = new CompositeLayer(1, 2);
        composite.setChildLayer("SUMMARY", summaryRowLayer, 0, 0);
        composite.setChildLayer(GridRegion.BODY, viewportLayer, 0, 1);

        NatTable natTable = new NatTable(panel, composite, false);
        GridDataFactory.fillDefaults().grab(true, true).applyTo(natTable);

        // Configure custom summary formula for a column
        natTable.addConfiguration(new ExampleSummaryRowConfiguration(dataProvider));
        natTable.addConfiguration(new DefaultNatTableStyleConfiguration());
        natTable.setConfigRegistry(configRegistry);
        natTable.configure();

        // Summary row fixed at the bottom
        dataLayer = new DataLayer(dataProvider);
        // IMPORTANT:
        // since the summary row layer is to the bottom of the viewport layer
        // we need to configure a GridLineCellLayerPainter that clips the top
        // cell. This means the body data layer is clipped at the bottom since
        // the painter is used globally
        dataLayer.setLayerPainter(new GridLineCellLayerPainter(false, true));

        viewportLayer = new ViewportLayer(dataLayer);

        // Plug in the SummaryRowLayer
        summaryRowLayer = new SummaryRowLayer(dataLayer, configRegistry, false);
        // configure the SummaryRowLayer to be rendered standalone
        summaryRowLayer.setStandalone(true);
View Full Code Here

                        return rowObject.getId();
                    }

                }, false));

        ViewportLayer viewportLayer = new ViewportLayer(selectionLayer);

        ILayer columnHeaderLayer = new ColumnHeaderLayer(new DataLayer(
                new DummyColumnHeaderDataProvider(bodyDataProvider)),
                viewportLayer, selectionLayer);
View Full Code Here

                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);

        return natTable;
    }
View Full Code Here

        // create the body layer stack
        IRowDataProvider<Person> bodyDataProvider = new ListDataProvider<Person>(
                data, columnPropertyAccessor);
        final DataLayer bodyDataLayer = new DataLayer(bodyDataProvider);
        final SelectionLayer selectionLayer = new SelectionLayer(bodyDataLayer);
        ViewportLayer viewportLayer = new ViewportLayer(selectionLayer);

        // use a RowSelectionModel that will perform row selections and is able
        // to identify a row via unique ID
        selectionLayer.setSelectionModel(new RowSelectionModel<Person>(
                selectionLayer, bodyDataProvider, new IRowIdAccessor<Person>() {

                    @Override
                    public Serializable getRowId(Person rowObject) {
                        return rowObject.getId();
                    }

                }));

        // register different selection move command handler that always moves
        // by row
        selectionLayer
                .addConfiguration(new RowOnlySelectionConfiguration<Person>());

        // register selection bindings that will perform row selections instead
        // of cell selections
        // registering the bindings on a layer that is above the SelectionLayer
        // 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(
View Full Code Here

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

            ViewportLayer viewportLayer = new ViewportLayer(treeLayer);

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

        DataLayer dataLayer = new DataLayer(dataProvider);

        // Plug in the SummaryRowLayer
        SummaryRowLayer summaryRowLayer = new SummaryRowLayer(dataLayer, configRegistry, false);
        ViewportLayer viewportLayer = new ViewportLayer(summaryRowLayer);

        NatTable natTable = new NatTable(parent, viewportLayer, false);

        // Configure custom summary formula for a column
        natTable.addConfiguration(new ExampleSummaryRowConfiguration(dataProvider));
View Full Code Here

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

                PersonService.getPersons(10), propertyNames);
        DataLayer bodyDataLayer = new DataLayer(bodyDataProvider);
        ColumnHideShowLayer columnHideShowLayer = new ColumnHideShowLayer(
                bodyDataLayer);
        SelectionLayer selectionLayer = new SelectionLayer(columnHideShowLayer);
        ViewportLayer viewportLayer = new ViewportLayer(selectionLayer);

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

                PersonService.getPersons(10), propertyNames);
        DataLayer bodyDataLayer = new DataLayer(bodyDataProvider);
        ColumnReorderLayer columnReorderLayer = new ColumnReorderLayer(
                bodyDataLayer);
        SelectionLayer selectionLayer = new SelectionLayer(columnReorderLayer);
        ViewportLayer viewportLayer = new ViewportLayer(selectionLayer);

        // build the column header layer
        IDataProvider columnHeaderDataProvider = new DefaultColumnHeaderDataProvider(
                propertyNames, propertyToLabelMap);
        DataLayer columnHeaderDataLayer = new DefaultColumnHeaderDataLayer(
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.