Package org.eclipse.nebula.widgets.nattable.layer

Examples of org.eclipse.nebula.widgets.nattable.layer.DataLayer


                1000000, 1000000)));
    }

    @Test
    public void testViewportReorderDataLayerPerformance() {
        ColumnReorderLayer reorderLayer = new ColumnReorderLayer(new DataLayer(
                new DummyBodyDataProvider(1000000, 1000000)));
        reorderLayer.reorderColumnPosition(1, 2);
        layer = new ViewportLayer(reorderLayer);
    }
View Full Code Here


    @SuppressWarnings("boxing")
    @Test
    public void testViewportHideShowDataLayerPerformance() {
        ColumnHideShowLayer hideShowLayer = new ColumnHideShowLayer(
                new DataLayer(new DummyBodyDataProvider(1000000, 1000000)));
        hideShowLayer
                .hideColumnPositions(Arrays.asList(new Integer[] { 3, 5 }));
        layer = new ViewportLayer(hideShowLayer);
    }
View Full Code Here

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

        // create the corner layer stack
        ILayer cornerLayer = new CornerLayer(new DataLayer(
                new DefaultCornerDataProvider(columnHeaderDataProvider,
                        rowHeaderDataProvider)), rowHeaderLayer,
                columnHeaderLayer);

        // create the grid layer composed with the prior created layer stacks
        GridLayer gridLayer = new GridLayer(bodyLayerStack, columnHeaderLayer,
                rowHeaderLayer, cornerLayer);

        final NatTable natTable = new NatTable(gridPanel, gridLayer, false);
        natTable.setConfigRegistry(configRegistry);
        natTable.addConfiguration(new DefaultNatTableStyleConfiguration());
        natTable.addConfiguration(new HeaderMenuConfiguration(natTable));
        natTable.addConfiguration(new SingleClickSortConfiguration());
        natTable.configure();
        GridDataFactory.fillDefaults().grab(true, true).applyTo(natTable);

        Button addColumnButton = new Button(buttonPanel, SWT.PUSH);
        addColumnButton.setText("Add Column");
        addColumnButton.addSelectionListener(new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent e) {
                String newColumn = "Column_" + columns.size();
                columns.add(newColumn);

                for (Map<String, String> value : values) {
                    String prefix = value.get("Column_0");
                    prefix = prefix.substring(0, prefix.indexOf("_"));
                    value.put(newColumn, prefix + "_" + (columns.size() - 1));
                }

                bodyDataLayer.fireLayerEvent(new ColumnInsertEvent(
                        bodyDataLayer, columns.size() - 1));
            }
        });

        return panel;
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

    @Test
    public void testCompositeViewportDataLayerPerformance() {
        CompositeLayer compositeLayer = new CompositeLayer(1, 1);
        compositeLayer.setChildLayer(GridRegion.BODY, new ViewportLayer(
                new DataLayer(new DummyBodyDataProvider(1000000, 1000000))), 0,
                0);

        layer = compositeLayer;
    }
View Full Code Here

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

        // build the grid layer
        GridLayer gridLayer = new GridLayer(viewportLayer, columnHeaderLayer,
View Full Code Here

public class BodyStackLayerPerformanceTest extends AbstractLayerPerformanceTest {

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

    }

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

                        1000000, 1000000))))));
    }

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

        ConfigRegistry configRegistry = new ConfigRegistry();

        CalculatingGridLayer gridLayer = new CalculatingGridLayer(valuesToShow,
                configRegistry, propertyNames, propertyToLabelMap);
        DataLayer bodyDataLayer = gridLayer.getBodyDataLayer();

        final ColumnOverrideLabelAccumulator columnLabelAccumulator = new ColumnOverrideLabelAccumulator(
                bodyDataLayer);
        bodyDataLayer.setConfigLabelAccumulator(columnLabelAccumulator);
        registerColumnLabels(columnLabelAccumulator);

        final NatTable natTable = new NatTable(gridPanel, gridLayer, false);
        natTable.setConfigRegistry(configRegistry);
        natTable.addConfiguration(new DefaultNatTableStyleConfiguration());
View Full Code Here

TOP

Related Classes of org.eclipse.nebula.widgets.nattable.layer.DataLayer

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.