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

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


        Map<String, String> propertyToLabelMap = RowDataListFixture
                .getPropertyToLabelMap();
        DefaultBodyDataProvider<RowDataFixture> bodyDataProvider = new DefaultBodyDataProvider<RowDataFixture>(
                RowDataListFixture.getList(2000), propertyNames);
        ColumnGroupBodyLayerStack bodyLayer = new ColumnGroupBodyLayerStack(
                new DataLayer(bodyDataProvider), sndColumnGroupModel,
                columnGroupModel);

        // Column header

        DefaultColumnHeaderDataProvider defaultColumnHeaderDataProvider = new DefaultColumnHeaderDataProvider(
                propertyNames, propertyToLabelMap);
        DefaultColumnHeaderDataLayer columnHeaderDataLayer = new DefaultColumnHeaderDataLayer(
                defaultColumnHeaderDataProvider);
        columnHeaderLayer = new ColumnHeaderLayer(columnHeaderDataLayer,
                bodyLayer, bodyLayer.getSelectionLayer());
        ColumnGroupHeaderLayer columnGroupHeaderLayer = new ColumnGroupHeaderLayer(
                columnHeaderLayer, bodyLayer.getSelectionLayer(),
                columnGroupModel);

        columnGroupHeaderLayer.addColumnsIndexesToGroup("Group 1", 1, 2);
        columnGroupHeaderLayer.addColumnsIndexesToGroup("UnBreakable group 2",
                4, 5, 6, 7);
        columnGroupHeaderLayer.addColumnsIndexesToGroup("UnBreakable group 3",
                8, 9, 10);
        columnGroupHeaderLayer.addColumnsIndexesToGroup("Group 4", 11, 12, 13);
        columnGroupHeaderLayer.addColumnsIndexesToGroup("Group 5", 14, 15, 16,
                17);
        columnGroupHeaderLayer.setGroupUnbreakable(4);
        columnGroupHeaderLayer.setGroupUnbreakable(8);
        columnGroupHeaderLayer.setGroupAsCollapsed(11);

        ColumnGroupGroupHeaderLayer sndGroup = new ColumnGroupGroupHeaderLayer(
                columnGroupHeaderLayer, bodyLayer.getSelectionLayer(),
                sndColumnGroupModel);

        sndGroup.addColumnsIndexesToGroup("GroupGroup 1", 1, 2, 3, 4, 5, 6, 7);
        sndGroup.addColumnsIndexesToGroup("GroupGroup 2", 11, 12, 13, 14, 15,
                16, 17);

        sndGroup.setStaticColumnIndexesByGroup("GroupGroup 1", 1, 2);

        // Row header

        final DefaultRowHeaderDataProvider rowHeaderDataProvider = new DefaultRowHeaderDataProvider(
                bodyDataProvider);
        DefaultRowHeaderDataLayer rowHeaderDataLayer = new DefaultRowHeaderDataLayer(
                rowHeaderDataProvider);
        ILayer rowHeaderLayer = new RowHeaderLayer(rowHeaderDataLayer,
                bodyLayer, bodyLayer.getSelectionLayer());

        // Corner

        final DefaultCornerDataProvider cornerDataProvider = new DefaultCornerDataProvider(
                defaultColumnHeaderDataProvider, rowHeaderDataProvider);
        DataLayer cornerDataLayer = new DataLayer(cornerDataProvider);
        ILayer cornerLayer = new CornerLayer(cornerDataLayer, rowHeaderLayer,
                sndGroup);

        // Grid
        GridLayer gridLayer = new GridLayer(bodyLayer, sndGroup,
View Full Code Here


        propertyToLabelMap.put("columnFourNumber", "Column 4");
        propertyToLabelMap.put("columnFiveNumber", "Column 5");

        DefaultGridLayer gridLayer = new DefaultGridLayer(
                createNumberValuesList(), propertyNames, propertyToLabelMap);
        DataLayer bodyDataLayer = (DataLayer) gridLayer.getBodyDataLayer();

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

        NatTable natTable = new NatTable(parent, gridLayer, false);
        natTable.addConfiguration(new DefaultNatTableStyleConfiguration());
        natTable.addConfiguration(new TableEditConfiguration());
View Full Code Here

    }

    private NatTable setup(Composite parent) {
        DummyGridLayerStack gridLayer = new DummyGridLayerStack();
        final NatTable natTable = new NatTable(parent, gridLayer, false);
        DataLayer bodyDataLayer = (DataLayer) gridLayer.getBodyDataLayer();

        // Add an AggregrateConfigLabelAccumulator - we can add other
        // accumulators to this as required
        AggregrateConfigLabelAccumulator aggregrateConfigLabelAccumulator = new AggregrateConfigLabelAccumulator();
        bodyDataLayer
                .setConfigLabelAccumulator(aggregrateConfigLabelAccumulator);

        ColumnOverrideLabelAccumulator columnLabelAccumulator = new ColumnOverrideLabelAccumulator(
                bodyDataLayer);
        ColumnOverrideLabelAccumulator bodyLabelAccumulator = new ColumnOverrideLabelAccumulator(
View Full Code Here

                + "the default example layer. In this case the backing layer is a basic data layer that simply displays dummy data and does "
                + "nothing else.";
    }

    public Control createExampleControl(Composite parent) {
        ILayer layer = new DataLayer(new DummyBodyDataProvider(20, 20));
        return new NatTable(parent, layer);
    }
View Full Code Here

        Map<String, String> propertyToLabelMap = RowDataListFixture
                .getPropertyToLabelMap();
        DefaultBodyDataProvider<RowDataFixture> bodyDataProvider = new DefaultBodyDataProvider<RowDataFixture>(
                RowDataListFixture.getList(200), propertyNames);
        ColumnGroupBodyLayerStack bodyLayer = new ColumnGroupBodyLayerStack(
                new DataLayer(bodyDataProvider), columnGroupModel);

        // Column header

        DefaultColumnHeaderDataProvider defaultColumnHeaderDataProvider = new DefaultColumnHeaderDataProvider(
                propertyNames, propertyToLabelMap);
        DefaultColumnHeaderDataLayer columnHeaderDataLayer = new DefaultColumnHeaderDataLayer(
                defaultColumnHeaderDataProvider);
        columnHeaderLayer = new ColumnHeaderLayer(columnHeaderDataLayer,
                bodyLayer, bodyLayer.getSelectionLayer());
        ColumnGroupHeaderLayer columnGroupHeaderLayer = new ColumnGroupHeaderLayer(
                columnHeaderLayer, bodyLayer.getSelectionLayer(),
                columnGroupModel);

        columnGroupHeaderLayer.addColumnsIndexesToGroup("Group 1", 1, 2);
        columnGroupHeaderLayer.addColumnsIndexesToGroup("UnBreakable group 2",
                4, 5, 6, 7);
        columnGroupHeaderLayer.addColumnsIndexesToGroup("UnBreakable group 3",
                8, 9, 10);
        columnGroupHeaderLayer.addColumnsIndexesToGroup("Group 4", 11, 12, 13);
        columnGroupHeaderLayer.addColumnsIndexesToGroup("Group 5", 14, 15, 16,
                17);
        columnGroupHeaderLayer.setStaticColumnIndexesByGroup("Group 5", 15, 17);
        columnGroupHeaderLayer.setGroupUnbreakable(4);
        columnGroupHeaderLayer.setGroupUnbreakable(8);
        columnGroupHeaderLayer.setGroupAsCollapsed(11);

        // Row header

        final DefaultRowHeaderDataProvider rowHeaderDataProvider = new DefaultRowHeaderDataProvider(
                bodyDataProvider);
        DefaultRowHeaderDataLayer rowHeaderDataLayer = new DefaultRowHeaderDataLayer(
                rowHeaderDataProvider);
        ILayer rowHeaderLayer = new RowHeaderLayer(rowHeaderDataLayer,
                bodyLayer, bodyLayer.getSelectionLayer());

        // Corner

        final DefaultCornerDataProvider cornerDataProvider = new DefaultCornerDataProvider(
                defaultColumnHeaderDataProvider, rowHeaderDataProvider);
        DataLayer cornerDataLayer = new DataLayer(cornerDataProvider);
        ILayer cornerLayer = new CornerLayer(cornerDataLayer, rowHeaderLayer,
                columnGroupHeaderLayer);

        // Grid
        GridLayer gridLayer = new GridLayer(bodyLayer, columnGroupHeaderLayer,
View Full Code Here

                RowDataListFixture.getPropertyNames(),
                RowDataListFixture.getPropertyToLabelMap());
        ColumnHideShowLayer columnHideShowLayer = gridLayer.getBodyLayer()
                .getColumnHideShowLayer();
        ColumnHeaderLayer columnHeaderLayer = gridLayer.getColumnHeaderLayer();
        DataLayer columnHeaderDataLayer = (DataLayer) gridLayer
                .getColumnHeaderDataLayer();

        List<ColumnEntry> visibleEntries = ColumnChooserUtils
                .getVisibleColumnsEntries(columnHideShowLayer,
                        columnHeaderLayer, columnHeaderDataLayer);
View Full Code Here

                colHeaderDataProvider);
        RowHeaderLayerStack rowHeaderLayer = new RowHeaderLayerStack(
                rowHeaderDataProvider);
        DefaultCornerDataProvider cornerDataProvider = new DefaultCornerDataProvider(
                colHeaderDataProvider, rowHeaderDataProvider);
        CornerLayer cornerLayer = new CornerLayer(new DataLayer(
                cornerDataProvider), rowHeaderLayer, columnHeaderLayer);

        GridLayer gridLayer = new GridLayer(bodyLayer, columnHeaderLayer,
                rowHeaderLayer, cornerLayer);
        NatTable natTable = new NatTable(parent, gridLayer);
View Full Code Here

    public class BodyLayerStack extends AbstractLayerTransform {

        private SelectionLayer selectionLayer;

        public BodyLayerStack(IDataProvider dataProvider) {
            DataLayer bodyDataLayer = new DataLayer(dataProvider);
            ColumnReorderLayer columnReorderLayer = new ColumnReorderLayer(
                    bodyDataLayer);
            ColumnHideShowLayer columnHideShowLayer = new ColumnHideShowLayer(
                    columnReorderLayer);
            selectionLayer = new SelectionLayer(columnHideShowLayer);
View Full Code Here

    }

    public class ColumnHeaderLayerStack extends AbstractLayerTransform {

        public ColumnHeaderLayerStack(IDataProvider dataProvider) {
            DataLayer dataLayer = new DataLayer(dataProvider);
            ColumnHeaderLayer colHeaderLayer = new ColumnHeaderLayer(dataLayer,
                    bodyLayer, bodyLayer.getSelectionLayer());
            setUnderlyingLayer(colHeaderLayer);
        }
View Full Code Here

    }

    public class RowHeaderLayerStack extends AbstractLayerTransform {

        public RowHeaderLayerStack(IDataProvider dataProvider) {
            DataLayer dataLayer = new DataLayer(dataProvider, 50, 20);
            RowHeaderLayer rowHeaderLayer = new RowHeaderLayer(dataLayer,
                    bodyLayer, bodyLayer.getSelectionLayer());
            setUnderlyingLayer(rowHeaderLayer);
        }
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.