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

Examples of org.eclipse.nebula.widgets.nattable.layer.stack.DefaultBodyLayerStack


                columnPropertyAccessor);

        bodyDataLayer = new DataLayer(bodyDataProvider);
        glazedListsEventLayer = new GlazedListsEventLayer<T>(bodyDataLayer,
                eventList);
        bodyLayerStack = new DefaultBodyLayerStack(glazedListsEventLayer);

        // Sort Column header
        IDataProvider columnHeaderDataProvider = new DefaultColumnHeaderDataProvider(
                propertyNames, propertyToLabelMap);
        columnHeaderDataLayer = new DefaultColumnHeaderDataLayer(
View Full Code Here


    @Before
    public void setUp() {
        final DataLayer bodyDataLayer = new DataLayer(
                new DummyBodyDataProvider(10, 10));
        final DefaultBodyLayerStack bodyLayer = new DefaultBodyLayerStack(
                bodyDataLayer);
        selectionLayer = bodyLayer.getSelectionLayer();

        freezeLayer = new FreezeLayer(selectionLayer);
        compositeFreezeLayer = new CompositeFreezeLayer(freezeLayer,
                bodyLayer.getViewportLayer(), bodyLayer.getSelectionLayer());
        viewportLayer = bodyLayer.getViewportLayer();
        commandHandler = new FreezeCommandHandler(freezeLayer, viewportLayer,
                selectionLayer);
        compositeFreezeLayer.registerCommandHandler(commandHandler);

        compositeFreezeLayer.setClientAreaProvider(new IClientAreaProvider() {
View Full Code Here

            IUniqueIndexLayer columnHeaderDataLayer,
            IUniqueIndexLayer rowHeaderDataLayer,
            IUniqueIndexLayer cornerDataLayer) {
        // Body
        this.bodyDataLayer = bodyDataLayer;
        DefaultBodyLayerStack bodyLayer = new DefaultBodyLayerStack(
                bodyDataLayer);

        SelectionLayer selectionLayer = bodyLayer.getSelectionLayer();

        // Column header
        this.columnHeaderDataLayer = columnHeaderDataLayer;
        ILayer columnHeaderLayer = new ColumnHeaderLayer(columnHeaderDataLayer,
                bodyLayer, selectionLayer);
View Full Code Here

                columnPropertyAccessor);

        bodyDataLayer = new DataLayer(bodyDataProvider);
        GlazedListsEventLayer<T> glazedListsEventLayer = new GlazedListsEventLayer<T>(
                bodyDataLayer, eventList);
        bodyLayerStack = new DefaultBodyLayerStack(glazedListsEventLayer);

        // Column header
        columnHeaderLayerStack = new GlazedListsColumnHeaderLayerStack<T>(
                columnHeaderDataProvider, sortedList, columnPropertyAccessor,
                configRegistry, bodyLayerStack);
View Full Code Here

    private DefaultBodyLayerStack layerStack;

    @Before
    public void setup() {
        layerStack = new DefaultBodyLayerStack(new DataLayerFixture(10, 5, 100,
                20));
        layerStack.setClientAreaProvider(new IClientAreaProvider() {
            public Rectangle getClientArea() {
                return new Rectangle(0, 0, 2000, 250);
            }
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(
                bodyDataProvider);
        DefaultRowHeaderDataLayer rowHeaderDataLayer = new DefaultRowHeaderDataLayer(
                rowHeaderDataProvider);
        RowHeaderLayer rowHeaderLayer = new RowHeaderLayer(rowHeaderDataLayer,
                bodyLayer, bodyLayer.getSelectionLayer());

        // Corner layer
        DefaultCornerDataProvider cornerDataProvider = new DefaultCornerDataProvider(
                columnHeaderDataProvider, rowHeaderDataProvider);
        DataLayer cornerDataLayer = new DataLayer(cornerDataProvider);
View Full Code Here

        IColumnPropertyAccessor<RowDataFixture> columnPropertyAccessor = new ReflectiveColumnPropertyAccessor<RowDataFixture>(
                propertyNames);
        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(
                bodyDataProvider);
        DefaultRowHeaderDataLayer rowHeaderDataLayer = new DefaultRowHeaderDataLayer(
                rowHeaderDataProvider);
        RowHeaderLayer rowHeaderLayer = new RowHeaderLayer(rowHeaderDataLayer,
                bodyLayer, bodyLayer.getSelectionLayer());

        // Corner layer
        DefaultCornerDataProvider cornerDataProvider = new DefaultCornerDataProvider(
                columnHeaderDataProvider, rowHeaderDataProvider);
        DataLayer cornerDataLayer = new DataLayer(cornerDataProvider);
View Full Code Here

                columnPropertyAccessor);

        bodyDataLayer = new DataLayer(bodyDataProvider);
        GlazedListsEventLayer<T> glazedListsEventLayer = new GlazedListsEventLayer<T>(
                bodyDataLayer, eventList);
        DefaultBodyLayerStack bodyLayer = new DefaultBodyLayerStack(
                glazedListsEventLayer);

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

        // Auto configure off. Configurations have to applied manually.
        SortHeaderLayer<T> columnHeaderSortableLayer = new SortHeaderLayer<T>(
                columnHeaderLayer, new GlazedListsSortModel<T>(sortedList,
                        columnPropertyAccessor, configRegistry,
                        columnHeaderDataLayer), false);

        // Row header
        DefaultRowHeaderDataProvider rowHeaderDataProvider = new DefaultRowHeaderDataProvider(
                bodyDataProvider);
        DefaultRowHeaderDataLayer rowHeaderDataLayer = new DefaultRowHeaderDataLayer(
                rowHeaderDataProvider);
        RowHeaderLayer rowHeaderLayer = new RowHeaderLayer(rowHeaderDataLayer,
                bodyLayer, bodyLayer.getSelectionLayer());

        // Corner
        DefaultCornerDataProvider cornerDataProvider = new DefaultCornerDataProvider(
                columnHeaderDataProvider, rowHeaderDataProvider);
        DataLayer cornerDataLayer = new DataLayer(cornerDataProvider);
View Full Code Here

TOP

Related Classes of org.eclipse.nebula.widgets.nattable.layer.stack.DefaultBodyLayerStack

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.