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

Examples of org.eclipse.nebula.widgets.nattable.layer.cell.ColumnOverrideLabelAccumulator


        // as the selection mouse bindings are registered for the region label
        // GridRegion.BODY we need to set that region label to the viewport so
        // the selection via mouse is working correctly
        viewportLayer.setRegionName(GridRegion.BODY);

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

        // add some edit configuration
        viewportLayer.addConfiguration(new DefaultEditBindings());
View Full Code Here


                labels.get(1));
    }

    @Test
    public void defaultConfigLabelsAreAdded() throws Exception {
        ColumnOverrideLabelAccumulator labelAcc = new ColumnOverrideLabelAccumulator(
                layerStackWithSummary);
        labelAcc.registerColumnOverrides(0, "myLabel");
        ((ViewportLayer) layerStackWithSummary)
                .setConfigLabelAccumulator(labelAcc);

        LabelStack configLabels = natTable.getConfigLabelsByPosition(0, 4);
        List<String> labels = configLabels.getLabels();
View Full Code Here

    }

    private ColumnOverrideLabelAccumulator getColumnLabelAccumulator(
            DataLayer dataLayer) {
        if (columnLabelAccumulator == null) {
            columnLabelAccumulator = new ColumnOverrideLabelAccumulator(
                    dataLayer);
            dataLayer.setConfigLabelAccumulator(columnLabelAccumulator);
        }
        return columnLabelAccumulator;
    }
View Full Code Here

                filterList, columnPropertyAccessor);
        DataLayer bodyDataLayer = new DataLayer(bodyDataProvider);
        ColumnGroupBodyLayerStack bodyLayer = new ColumnGroupBodyLayerStack(
                bodyDataLayer, columnGroupModel);

        ColumnOverrideLabelAccumulator bodyLabelAccumulator = new ColumnOverrideLabelAccumulator(
                bodyDataLayer);
        bodyDataLayer.setConfigLabelAccumulator(bodyLabelAccumulator);

        bodyLabelAccumulator
                .registerColumnOverrides(
                        RowDataListFixture
                                .getColumnIndexOfProperty(RowDataListFixture.PRICING_TYPE_PROP_NAME),
                        "PRICING_TYPE_PROP_NAME");

        // Column header
        IDataProvider columnHeaderDataProvider = new DefaultColumnHeaderDataProvider(
                propertyNames, propertyToLabelMap);
        DataLayer columnHeaderDataLayer = new DefaultColumnHeaderDataLayer(
                columnHeaderDataProvider);
        columnHeaderLayer = new ColumnHeaderLayer(columnHeaderDataLayer,
                bodyLayer, bodyLayer.getSelectionLayer());
        ColumnGroupHeaderLayer columnGroupHeaderLayer = new ColumnGroupHeaderLayer(
                columnHeaderLayer, bodyLayer.getSelectionLayer(),
                columnGroupModel);

        columnGroupHeaderLayer.addColumnsIndexesToGroup("Group 1", 1, 2);

        // calculate the height of the column header area dependent if column
        // groups exist or not
        columnGroupHeaderLayer.setCalculateHeight(true);

        // Note: The column header layer is wrapped in a filter row composite.
        // This plugs in the filter row functionality
        final FilterRowHeaderComposite<RowDataFixture> filterRowHeaderLayer = new FilterRowHeaderComposite<RowDataFixture>(
                new DefaultGlazedListsFilterStrategy<RowDataFixture>(
                        filterList, columnPropertyAccessor, configRegistry),
                columnGroupHeaderLayer, columnHeaderDataProvider,
                configRegistry);

        filterRowHeaderLayer.setFilterRowVisible(false);

        ColumnOverrideLabelAccumulator labelAccumulator = new ColumnOverrideLabelAccumulator(
                columnHeaderDataLayer);
        columnHeaderDataLayer.setConfigLabelAccumulator(labelAccumulator);

        // Register labels
        labelAccumulator.registerColumnOverrides(RowDataListFixture
                .getColumnIndexOfProperty(RowDataListFixture.RATING_PROP_NAME),
                "CUSTOM_COMPARATOR_LABEL");

        // Row header
View Full Code Here

TOP

Related Classes of org.eclipse.nebula.widgets.nattable.layer.cell.ColumnOverrideLabelAccumulator

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.