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

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


    public ColumnStyleChooserConfiguration(AbstractLayer bodyLayer,
            SelectionLayer selectionLayer) {
        this.bodyLayer = bodyLayer;
        this.selectionLayer = selectionLayer;
        labelAccumulator = new ColumnOverrideLabelAccumulator(bodyLayer);
        bodyLayer.setConfigLabelAccumulator(labelAccumulator);
    }
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

                PersonService.getPersons(5));
        final NatTable natTable = new NatTable(gridPanel, grid, false);

        // add labels to show that alignment configurations are also exported
        // correctly
        final ColumnOverrideLabelAccumulator columnLabelAccumulator = new ColumnOverrideLabelAccumulator(
                grid.getBodyLayer());
        ((AbstractLayer) grid.getBodyLayer())
                .setConfigLabelAccumulator(columnLabelAccumulator);
        columnLabelAccumulator.registerColumnOverrides(0, COLUMN_ONE_LABEL);
        columnLabelAccumulator.registerColumnOverrides(1, COLUMN_TWO_LABEL);

        natTable.addConfiguration(new AbstractRegistryConfiguration() {

            @Override
            public void configureRegistry(IConfigRegistry configRegistry) {
View Full Code Here

        DefaultGridLayer gridLayer = new DefaultGridLayer(
                bodyDataProvider, new DefaultColumnHeaderDataProvider(propertyNames, 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);
        natTable.addConfiguration(new DefaultNatTableStyleConfiguration());
View Full Code Here

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

        commandHandler = new TickUpdateCommandHandler(selectionLayer);
    }

    private void registerCellStyleAccumulators(DataLayer bodyDataLayer) {
        AggregrateConfigLabelAccumulator aggregrateConfigLabelAccumulator = new AggregrateConfigLabelAccumulator();
        columnLabelAccumulator = new ColumnOverrideLabelAccumulator(
                new DataLayerFixture());
        aggregrateConfigLabelAccumulator.add(columnLabelAccumulator,
                new AlternatingRowConfigLabelAccumulator());
        bodyDataLayer
                .setConfigLabelAccumulator(aggregrateConfigLabelAccumulator);
View Full Code Here

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

    private DisplayColumnStyleEditorCommandHandler handlerUnderTest;
    private IConfigRegistry configRegistryFixture;

    @Before
    public void setup() {
        labelAccumulatorFixture = new ColumnOverrideLabelAccumulator(
                new DataLayerFixture());
        natTableFixture = new NatTableFixture();
        configRegistryFixture = natTableFixture.getConfigRegistry();
        commandFixture = new DisplayColumnStyleEditorCommand(natTableFixture,
                natTableFixture.getConfigRegistry(), 1, 1);
View Full Code Here

        bodyDataLayer = new DataLayer(bodyDataProvider);
        GlazedListsEventLayer<RowDataFixture> glazedListsEventLayer = new GlazedListsEventLayer<RowDataFixture>(
                bodyDataLayer, eventList);
        DefaultBodyLayerStack bodyLayer = new DefaultBodyLayerStack(
                glazedListsEventLayer);
        ColumnOverrideLabelAccumulator bodyLabelAccumulator = new ColumnOverrideLabelAccumulator(
                bodyDataLayer);
        bodyDataLayer.setConfigLabelAccumulator(bodyLabelAccumulator);

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

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

        SortHeaderLayer<RowDataFixture> sortHeaderLayer = new SortHeaderLayer<RowDataFixture>(
                columnHeaderLayer, new GlazedListsSortModel<RowDataFixture>(
                        sortedList, columnPropertyAccessor, configRegistry,
                        columnHeaderDataLayer), false);
        sortHeaderLayer.addConfiguration(new SingleClickSortConfiguration());

        // Note: The column header layer is wrapped in a filter row composite.
        // This plugs in the filter row functionality

        // DefaultGlazedListsFilterStrategy<RowDataFixture> filterStrategy =
        // new
        // DefaultGlazedListsFilterStrategy<RowDataFixture>(autoFilterMatcherEditor,
        // columnPropertyAccessor, configRegistry);
        DefaultGlazedListsStaticFilterStrategy<RowDataFixture> filterStrategy = new DefaultGlazedListsStaticFilterStrategy<RowDataFixture>(
                filterList, columnPropertyAccessor, configRegistry);
        filterStrategy.addStaticFilter(new Matcher<RowDataFixture>() {

            @Override
            public boolean matches(RowDataFixture item) {
                return !(item.rating.equals("AAA"));
            }
        });

        FilterRowHeaderComposite<RowDataFixture> filterRowHeaderLayer = new FilterRowHeaderComposite<RowDataFixture>(
                filterStrategy, sortHeaderLayer, columnHeaderDataProvider,
                configRegistry);

        ColumnOverrideLabelAccumulator labelAccumulator = new ColumnOverrideLabelAccumulator(
                columnHeaderDataLayer);
        columnHeaderDataLayer.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

        bodyDataProvider = new ListDataProvider<RowDataFixture>(filterList,
                columnPropertyAccessor);
        DataLayer bodyDataLayer = new DataLayer(bodyDataProvider);
        DefaultBodyLayerStack bodyLayer = new DefaultBodyLayerStack(
                bodyDataLayer);
        ColumnOverrideLabelAccumulator bodyLabelAccumulator = new ColumnOverrideLabelAccumulator(
                bodyDataLayer);
        bodyDataLayer.setConfigLabelAccumulator(bodyLabelAccumulator);

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

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

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

        ColumnOverrideLabelAccumulator labelAccumulator = new ColumnOverrideLabelAccumulator(
                columnHeaderDataLayer);
        columnHeaderDataLayer.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

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.