Package org.eclipse.nebula.widgets.nattable.viewport

Examples of org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer$MoveViewportRunnable


                        return rowObject.getSecurity_id();
                    }

                }));

        this.viewportLayer = new ViewportLayer(this.selectionLayer);
    }
View Full Code Here


        IDataProvider bodyDataProvider = new DefaultBodyDataProvider<Person>(
                PersonService.getPersons(10), propertyNames);
        DataLayer bodyDataLayer = new DataLayer(bodyDataProvider);
        RowHideShowLayer rowHideShowLayer = new RowHideShowLayer(bodyDataLayer);
        SelectionLayer selectionLayer = new SelectionLayer(rowHideShowLayer);
        ViewportLayer viewportLayer = new ViewportLayer(selectionLayer);

        // build the column header layer
        IDataProvider columnHeaderDataProvider = new DefaultColumnHeaderDataProvider(
                propertyNames, propertyToLabelMap);
        DataLayer columnHeaderDataLayer = new DefaultColumnHeaderDataLayer(
View Full Code Here

                    .addConfiguration(new CalculatingSummaryRowConfiguration(
                            bodyDataLayer.getDataProvider()));
            columnReorderLayer = new ColumnReorderLayer(summaryRowLayer);
            columnHideShowLayer = new ColumnHideShowLayer(columnReorderLayer);
            selectionLayer = new SelectionLayer(columnHideShowLayer);
            viewportLayer = new ViewportLayer(selectionLayer);
            setUnderlyingLayer(viewportLayer);

            registerCommandHandler(new CopyDataCommandHandler(selectionLayer));
        }
View Full Code Here

    public void openEditorForSpannedCellsShouldOpenInline() throws Exception {
        CompositeLayer layer = new CompositeLayer(1, 1);
        SelectionLayer selectionLayer = new SelectionLayer(
                new SpanningDataLayer(new DummySpanningBodyDataProvider(100,
                        100)));
        layer.setChildLayer(GridRegion.BODY, new ViewportLayer(selectionLayer),
                0, 0);
        natTable = new NatTableFixture(layer, 1200, 300, false);

        layer.addConfiguration(new DefaultEditBindings());
        layer.addConfiguration(new DefaultEditConfiguration());
View Full Code Here

        CompositeLayer layer = new CompositeLayer(1, 1);
        DummySpanningBodyDataProvider dataProvider = new DummySpanningBodyDataProvider(
                100, 100);
        SelectionLayer selectionLayer = new SelectionLayer(
                new SpanningDataLayer(dataProvider));
        layer.setChildLayer(GridRegion.BODY, new ViewportLayer(selectionLayer),
                0, 0);
        natTable = new NatTableFixture(layer, 1200, 300, false);

        layer.addConfiguration(new DefaultEditBindings());
        layer.addConfiguration(new DefaultEditConfiguration());
View Full Code Here

                bodyDataLayer);
        RowReorderLayer rowReorderLayer = new RowReorderLayer(
                columnReorderLayer);
        final SelectionLayer selectionLayer = new SelectionLayer(
                rowReorderLayer);
        final ViewportLayer viewportLayer = new ViewportLayer(selectionLayer);

        // build the column header layer
        IDataProvider columnHeaderDataProvider = new DefaultColumnHeaderDataProvider(
                propertyNames, propertyToLabelMap);
        DataLayer columnHeaderDataLayer = new DefaultColumnHeaderDataLayer(
View Full Code Here

                    treeData);

            this.selectionLayer = new SelectionLayer(glazedListsEventLayer);

            TreeLayer treeLayer = new TreeLayer(selectionLayer, treeRowModel);
            ViewportLayer viewportLayer = new ViewportLayer(treeLayer);

            setUnderlyingLayer(viewportLayer);
        }
View Full Code Here

                columnGroupReorderLayer);
        ColumnGroupExpandCollapseLayer columnGroupExpandCollapseLayer = new ColumnGroupExpandCollapseLayer(
                columnHideShowLayer, columnGroupModel);
        SelectionLayer selectionLayer = new SelectionLayer(
                columnGroupExpandCollapseLayer);
        ViewportLayer viewportLayer = new ViewportLayer(selectionLayer);

        // build the column header layer
        IDataProvider columnHeaderDataProvider = new DefaultColumnHeaderDataProvider(
                propertyNames, propertyToLabelMap);
        DataLayer columnHeaderDataLayer = new DefaultColumnHeaderDataLayer(
                columnHeaderDataProvider);
        ColumnHeaderLayer columnHeaderLayer = new ColumnHeaderLayer(
                columnHeaderDataLayer, viewportLayer, selectionLayer);
        ColumnGroupHeaderLayer columnGroupHeaderLayer = new ColumnGroupHeaderLayer(
                columnHeaderLayer, selectionLayer, columnGroupModel);

        // configure the column groups
        columnGroupHeaderLayer.addColumnsIndexesToGroup("Person", 0, 1, 2, 3);
        columnGroupHeaderLayer.addColumnsIndexesToGroup("Address", 4, 5, 6, 7);
        columnGroupHeaderLayer.addColumnsIndexesToGroup("Facts", 8, 9, 10);
        columnGroupHeaderLayer.addColumnsIndexesToGroup("Personal", 11, 12, 13);
        columnGroupHeaderLayer.setStaticColumnIndexesByGroup("Person", 0, 1);
        columnGroupHeaderLayer
                .setStaticColumnIndexesByGroup("Address", 4, 5, 6);
        columnGroupHeaderLayer.setGroupUnbreakable(1);

        // build the row header layer
        IDataProvider rowHeaderDataProvider = new DefaultRowHeaderDataProvider(
                bodyDataProvider);
        DataLayer rowHeaderDataLayer = new DefaultRowHeaderDataLayer(
                rowHeaderDataProvider);
        ILayer rowHeaderLayer = new RowHeaderLayer(rowHeaderDataLayer,
                viewportLayer, selectionLayer);

        // build the corner layer
        IDataProvider cornerDataProvider = new DefaultCornerDataProvider(
                columnHeaderDataProvider, rowHeaderDataProvider);
        DataLayer cornerDataLayer = new DataLayer(cornerDataProvider);
        ILayer cornerLayer = new CornerLayer(cornerDataLayer, rowHeaderLayer,
                columnGroupHeaderLayer);

        // build the grid layer
        GridLayer gridLayer = new GridLayer(viewportLayer,
                columnGroupHeaderLayer, rowHeaderLayer, cornerLayer);

        // turn the auto configuration off as we want to add our header menu
        // configuration
        NatTable natTable = new NatTable(parent, gridLayer, false);

        // as the autoconfiguration of the NatTable is turned off, we have to
        // add the
        // DefaultNatTableStyleConfiguration manually
        natTable.addConfiguration(new DefaultNatTableStyleConfiguration());

        natTable.addConfiguration(new HeaderMenuConfiguration(natTable) {
            @Override
            protected PopupMenuBuilder createColumnHeaderMenu(NatTable natTable) {
                return super.createColumnHeaderMenu(natTable)
                        .withColumnChooserMenuItem();
            }
        });

        // Column group header menu
        final Menu columnGroupHeaderMenu = new PopupMenuBuilder(natTable)
                .withMenuItemProvider(
                        ColumnGroupMenuItemProviders
                                .renameColumnGroupMenuItemProvider())
                .withMenuItemProvider(
                        ColumnGroupMenuItemProviders
                                .removeColumnGroupMenuItemProvider()).build();

        natTable.addConfiguration(new AbstractUiBindingConfiguration() {
            @Override
            public void configureUiBindings(UiBindingRegistry uiBindingRegistry) {
                uiBindingRegistry.registerFirstMouseDownBinding(
                        new MouseEventMatcher(SWT.NONE,
                                GridRegion.COLUMN_GROUP_HEADER,
                                MouseEventMatcher.RIGHT_BUTTON),
                        new PopupMenuAction(columnGroupHeaderMenu));
            }
        });

        // enable this configuration to verify the automatic height calculation
        // when using vertical text painter
        // natTable.addConfiguration(new AbstractRegistryConfiguration() {
        //
        // @Override
        // public void configureRegistry(IConfigRegistry configRegistry) {
        // ICellPainter cellPainter = new BeveledBorderDecorator(new
        // VerticalTextPainter(false, true, 5, true, true));
        // configRegistry.registerConfigAttribute(
        // CellConfigAttributes.CELL_PAINTER, cellPainter, DisplayMode.NORMAL,
        // GridRegion.COLUMN_HEADER);
        // }
        // });

        // Register column chooser
        DisplayColumnChooserCommandHandler columnChooserCommandHandler = new DisplayColumnChooserCommandHandler(
                selectionLayer, columnHideShowLayer, columnHeaderLayer,
                columnHeaderDataLayer, columnGroupHeaderLayer, columnGroupModel);
        viewportLayer.registerCommandHandler(columnChooserCommandHandler);

        natTable.configure();

        return natTable;
    }
View Full Code Here

                bodyDataLayer);
        RowHideShowLayer rowHideShowLayer = new RowHideShowLayer(
                columnHideShowLayer);
        final SelectionLayer selectionLayer = new SelectionLayer(
                rowHideShowLayer);
        final ViewportLayer viewportLayer = new ViewportLayer(selectionLayer);

        // build the column header layer
        IDataProvider columnHeaderDataProvider = new DefaultColumnHeaderDataProvider(
                propertyNames, propertyToLabelMap);
        DataLayer columnHeaderDataLayer = new DefaultColumnHeaderDataLayer(
View Full Code Here

        this.dataLayer = new DataLayer(this.testDataProvider);
        this.reorderLayer = new ColumnReorderLayer(this.dataLayer);
        this.rowHideShowLayer = new RowHideShowLayer(this.reorderLayer);
        this.columnHideShowLayer = new ColumnHideShowLayer(this.rowHideShowLayer);
        this.selectionLayer = new SelectionLayer(this.columnHideShowLayer);
        this.viewportLayer = new ViewportLayer(this.selectionLayer);
        this.freezeLayer = new FreezeLayer(this.selectionLayer);

        this.compositeFreezeLayer = new CompositeFreezeLayer(
                this.freezeLayer, this.viewportLayer, this.selectionLayer);
        this.compositeFreezeLayer.setClientAreaProvider(new IClientAreaProvider() {
View Full Code Here

TOP

Related Classes of org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer$MoveViewportRunnable

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.