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

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


    @Test
    public void getConfigLabelsByPosition() throws Exception {
        DataLayer underlyingLayer = new DataLayerFixture();
        columnReorderLayer = new ColumnReorderLayer(underlyingLayer);
        ColumnOverrideLabelAccumulator columnLabelAccumulator = new ColumnOverrideLabelAccumulator(
                underlyingLayer);
        registerCellStyleAccumulators(underlyingLayer, columnLabelAccumulator);

        columnLabelAccumulator.registerColumnOverrides(4, "INDEX_4_LABEL");

        List<String> labelsForIndex4 = columnReorderLayer
                .getConfigLabelsByPosition(4, 0).getLabels();
        assertEquals(2, labelsForIndex4.size());
        assertEquals("INDEX_4_LABEL", labelsForIndex4.get(0));
View Full Code Here


                createNumberValuesList(), propertyNames, propertyToLabelMap);
        DataLayer bodyDataLayer = (DataLayer) gridLayer.getBodyDataLayer();
        bodyDataLayer.setDefaultRowHeight(40);
        bodyDataLayer.setDefaultColumnWidth(40);

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

        NatTable natTable = new NatTable(parent, gridLayer, false);
View Full Code Here

        ColumnHeaderLayer columnHeaderLayer = new ColumnHeaderLayer(
                columnHeaderDataLayer, viewportLayer, selectionLayer);
        // Note: The column header layer is wrapped in a filter row composite.
        // This plugs in the filter row functionality

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

        // Register labels
        SortHeaderLayer<Datum> sortHeaderLayer = new SortHeaderLayer<Datum>(
View Full Code Here

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

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

        final NatTable natTable = new NatTable(gridPanel, gridLayer, false);
View Full Code Here

        ColumnHeaderLayer columnHeaderLayer = new ColumnHeaderLayer(
                columnHeaderDataLayer, viewportLayer, selectionLayer);
        // Note: The column header layer is wrapped in a filter row composite.
        // This plugs in the filter row functionality

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

        // Register labels
        SortHeaderLayer<Datum> sortHeaderLayer = new SortHeaderLayer<Datum>(
View Full Code Here

        ColumnHeaderLayer columnHeaderLayer = new ColumnHeaderLayer(
                columnHeaderDataLayer, compFreeze, selectionLayer);
        // Note: The column header layer is wrapped in a filter row composite.
        // This plugs in the filter row functionality

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

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

        // Row header layer
        DefaultRowHeaderDataProvider rowHeaderDataProvider = new DefaultRowHeaderDataProvider(
View Full Code Here

                        propertyToLabelMap));

        final DataLayer bodyDataLayer = (DataLayer) gridLayer
                .getBodyDataLayer();

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

        final NatTable natTable = new NatTable(parent, gridLayer, false);
View Full Code Here

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

        // accumulators to this as required
        AggregrateConfigLabelAccumulator aggregrateConfigLabelAccumulator = new AggregrateConfigLabelAccumulator();
        bodyDataLayer
                .setConfigLabelAccumulator(aggregrateConfigLabelAccumulator);

        ColumnOverrideLabelAccumulator columnLabelAccumulator = new ColumnOverrideLabelAccumulator(
                bodyDataLayer);
        ColumnOverrideLabelAccumulator bodyLabelAccumulator = new ColumnOverrideLabelAccumulator(
                bodyDataLayer);

        aggregrateConfigLabelAccumulator.add(columnLabelAccumulator);
        aggregrateConfigLabelAccumulator.add(bodyLabelAccumulator);

        // Add a label for the highlighted column
        // We will add a style for this label to the config registry in a bit
        bodyLabelAccumulator.registerColumnOverrides(2, BODY_LABEL_1);
        columnLabelAccumulator.registerColumnOverrides(2, COLUMN_LABEL_1);

        // Register a command handler for the StyleEditorDialog
        DisplayColumnStyleEditorCommandHandler styleChooserCommandHandler = new DisplayColumnStyleEditorCommandHandler(
                gridLayer.getBodyLayer().getSelectionLayer(),
View Full Code Here

        DataLayer bodyDataLayer = gridLayer.getBodyDataLayer();

        // Step 1: Create a label accumulator - adds custom labels to all cells
        // which we
        // wish to render differently. In this case render as a button.
        ColumnOverrideLabelAccumulator cellLabelAccumulator = new ColumnOverrideLabelAccumulator(
                bodyDataLayer);
        cellLabelAccumulator.registerColumnOverrides(2, CUSTOM_CELL_LABEL);

        // Step 2: Register label accumulator
        bodyDataLayer.setConfigLabelAccumulator(cellLabelAccumulator);

        // Step 3: Register your custom cell painter, cell style, against the
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.