Package org.eclipse.nebula.widgets.nattable.selection

Examples of org.eclipse.nebula.widgets.nattable.selection.SelectionLayer


    @SuppressWarnings("unused")
    private void createNatTable3(Composite parent, final ICellPainter painter) {
        IDataProvider bodyDataProvider = new ExampleHeaderDataProvider();
        DataLayer dataLayer = new DataLayer(bodyDataProvider);

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

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


    @SuppressWarnings("unused")
    private void createVerticalNatTable(Composite parent,
            final ICellPainter painter) {
        IDataProvider bodyDataProvider = new ExampleHeaderDataProvider();
        SelectionLayer selectionLayer = new SelectionLayer(new DataLayer(
                bodyDataProvider, 20, 100));
        ViewportLayer viewportLayer = new ViewportLayer(selectionLayer);

        ColumnHeaderLayer columnHeaderLayer = new ColumnHeaderLayer(
                new DataLayer(new DummyColumnHeaderDataProvider(
View Full Code Here

        nattable.addConfiguration(new DefaultNatTableStyleConfiguration());
        nattable.addConfiguration(new HeaderMenuConfiguration(nattable));
        nattable.addConfiguration(new DefaultSelectionStyleConfiguration());

        // Custom selection configuration
        SelectionLayer selectionLayer = gridLayer.getSelectionLayer();
        selectionLayer.setSelectionModel(new RowSelectionModel<RowDataFixture>(
                selectionLayer, gridLayer.getBodyDataProvider(),
                new IRowIdAccessor<RowDataFixture>() {

                    public Serializable getRowId(RowDataFixture rowObject) {
                        return rowObject.getSecurity_id();
                    }

                }));

        selectionLayer
                .addConfiguration(new RowOnlySelectionConfiguration<RowDataFixture>());
        nattable.addConfiguration(new RowOnlySelectionBindings());

        nattable.configure();
View Full Code Here

        nattable.setConfigRegistry(configRegistry);
        nattable.addConfiguration(new DefaultNatTableStyleConfiguration());
        nattable.addConfiguration(new SingleClickSortConfiguration());

        SelectionLayer selectionLayer = glazedListsGridLayer
                .getBodyLayerStack().getSelectionLayer();
        ListDataProvider<RowDataFixture> bodyDataProvider = glazedListsGridLayer
                .getBodyDataProvider();

        // Select complete rows
        RowOnlySelectionConfiguration<RowDataFixture> selectionConfig = new RowOnlySelectionConfiguration<RowDataFixture>();
        selectionLayer.addConfiguration(selectionConfig);
        nattable.addConfiguration(new RowOnlySelectionBindings());

        // Preserve selection on updates and sort
        selectionLayer.setSelectionModel(new RowSelectionModel<RowDataFixture>(
                selectionLayer, bodyDataProvider,
                new IRowIdAccessor<RowDataFixture>() {

                    public Serializable getRowId(RowDataFixture rowObject) {
                        return rowObject.getSecurity_id();
View Full Code Here

        layer = new ViewportLayer(hideShowLayer);
    }

    @Test
    public void testViewportSelectionDataLayerPerformance() {
        layer = new ViewportLayer(new SelectionLayer(new DataLayer(
                new DummyBodyDataProvider(1000000, 1000000))));
    }
View Full Code Here

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

                        1000000, 1000000)))));
    }

    @Test
    public void testViewportSelectionHideShowReorderDataLayerPerformance() {
        layer = new ViewportLayer(new SelectionLayer(new ColumnHideShowLayer(
                new ColumnReorderLayer(new DataLayer(new DummyBodyDataProvider(
                        1000000, 1000000))))));
    }
View Full Code Here

        // directly as body layer is also working.
        final ListDataProvider<Person> bodyDataProvider = new DefaultBodyDataProvider<Person>(
                PersonService.getPersons(10), propertyNames);
        final DataLayer bodyDataLayer = new DataLayer(bodyDataProvider);
        HoverLayer bodyHoverLayer = new HoverLayer(bodyDataLayer);
        SelectionLayer selectionLayer = new SelectionLayer(bodyHoverLayer);
        ViewportLayer viewportLayer = new ViewportLayer(selectionLayer);

        // add labels to provider conditional styling
        bodyDataLayer.setConfigLabelAccumulator(new IConfigLabelAccumulator() {
            @Override
View Full Code Here

            IDataProvider dataProvider = new ListDataProvider<NumberValues>(
                    valuesToShow, new CalculatingDataProvider());
            bodyDataLayer = new DataLayer(dataProvider);
            columnReorderLayer = new ColumnReorderLayer(bodyDataLayer);
            columnHideShowLayer = new ColumnHideShowLayer(columnReorderLayer);
            selectionLayer = new SelectionLayer(columnHideShowLayer);
            viewportLayer = new ViewportLayer(selectionLayer);
            setUnderlyingLayer(viewportLayer);

            registerCommandHandler(new CopyDataCommandHandler(selectionLayer));
        }
View Full Code Here

        ColumnReorderLayer columnReorderLayer = new ColumnReorderLayer(
                eventLayer);
        ColumnHideShowLayer columnHideShowLayer = new ColumnHideShowLayer(
                columnReorderLayer);
        SelectionLayer selectionLayer = new SelectionLayer(columnHideShowLayer);
        ViewportLayer viewportLayer = new ViewportLayer(selectionLayer);

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

TOP

Related Classes of org.eclipse.nebula.widgets.nattable.selection.SelectionLayer

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.