Package org.eclipse.nebula.widgets.nattable

Examples of org.eclipse.nebula.widgets.nattable.NatTable


        // Grid
        final GridLayer gridLayer = new GridLayer(compositeFreezeLayer,
                columnHeaderLayer, rowHeaderLayer, cornerLayer);

        NatTable natTable = new NatTable(parent, gridLayer, false);

        // Configuration
        natTable.addConfiguration(new DefaultNatTableStyleConfiguration());
        natTable.addConfiguration(new HeaderMenuConfiguration(natTable));
        natTable.addConfiguration(new DefaultFreezeGridBindings());

        natTable.configure();

        return natTable;
    }
View Full Code Here


        // Grid
        GridLayer gridLayer = new GridLayer(viewportLayer, columnHeaderLayer,
                rowGroupHeaderLayer, cornerLayer);

        NatTable natTable = new NatTable(parent, gridLayer, false);
        natTable.addConfiguration(new DefaultNatTableStyleConfiguration());
        natTable.addConfiguration(new HeaderMenuConfiguration(natTable));

        natTable.configure();
        return natTable;
    }
View Full Code Here

                columnHeaderLayer);

        GridLayer compositeLayer = new GridLayer(viewportLayer,
                columnHeaderLayer, rowHeaderLayer, cornerLayer);

        return new NatTable(parent, compositeLayer);
    }
View Full Code Here

                groupByModel, gridLayer, columnHeaderDataProvider);
        compositeGridLayer.setChildLayer(GroupByHeaderLayer.GROUP_BY_REGION,
                groupByHeaderLayer, 0, 0);
        compositeGridLayer.setChildLayer("Grid", gridLayer, 0, 1);

        NatTable natTable = new NatTable(comp, compositeGridLayer, false);
        natTable.addConfiguration(new DefaultNatTableStyleConfiguration());
        natTable.addConfiguration(new GroupByHeaderMenuConfiguration(natTable,
                groupByHeaderLayer));
        natTable.addConfiguration(new HeaderMenuConfiguration(natTable));
        natTable.addConfiguration(new DebugMenuConfiguration(natTable));

        natTable.setConfigRegistry(configRegistry);

        natTable.configure();

        natTable.setLayoutData(new GridData(GridData.FILL_BOTH));

        Button button = new Button(comp, SWT.NONE);
        button.setText("Toggle Group By Header");
        button.addMouseListener(new MouseAdapter() {
            @Override
View Full Code Here

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

        final NatTable natTable = new NatTable(gridPanel, gridLayer, false);
        natTable.setConfigRegistry(configRegistry);
        natTable.addConfiguration(new DefaultNatTableStyleConfiguration());
        natTable.addConfiguration(new CalculatingEditConfiguration());
        natTable.configure();
        GridDataFactory.fillDefaults().grab(true, true).applyTo(natTable);

        Button addRowButton = new Button(buttonPanel, SWT.PUSH);
        addRowButton.setText("add row");
        addRowButton.addSelectionListener(new SelectionAdapter() {
View Full Code Here

        // Grid
        GridLayer gridLayer = new GridLayer(viewportLayer, sortHeaderLayer,
                rowHeaderLayer, cornerLayer);

        NatTable natTable = new NatTable(parent, gridLayer, false);
        natTable.setConfigRegistry(configRegistry);
        natTable.addConfiguration(new DefaultNatTableStyleConfiguration());
        natTable.addConfiguration(new HeaderMenuConfiguration(natTable) {
            @Override
            protected PopupMenuBuilder createRowHeaderMenu(NatTable natTable) {
                return super.createRowHeaderMenu(natTable)
                        .withHideRowMenuItem().withShowAllRowsMenuItem();
            }
        });
        natTable.addConfiguration(new DefaultTreeLayerConfiguration(treeLayer));
        natTable.addConfiguration(new SingleClickSortConfiguration());

        // Uncomment to see the native tree list printed to stout.
        // printTree(treeList, treeData);

        natTable.configure();
        return natTable;
    }
View Full Code Here

                }
            }
        };
        bodyLayer.setConfigLabelAccumulator(cellLabelAccumulator);

        NatTable natTable = new NatTable(parent, gridLayer, false);

        natTable.addConfiguration(new DefaultNatTableStyleConfiguration() {
            {
                // override the LineBorderDecorator here to show how to paint
                // borders on single sides of a cell
                cellPainter = new CustomLineBorderDecorator(new TextPainter());
                // set a border style
                borderStyle = new BorderStyle(2, GUIHelper.COLOR_BLUE,
                        LineStyleEnum.DASHDOT);
            }
        });
        // Custom style for label "FOO"
        natTable.addConfiguration(new AbstractRegistryConfiguration() {
            public void configureRegistry(IConfigRegistry configRegistry) {
                Style cellStyle = new Style();
                cellStyle.setAttributeValue(
                        CellStyleAttributes.BACKGROUND_COLOR,
                        GUIHelper.COLOR_GREEN);
                configRegistry.registerConfigAttribute(
                        CellConfigAttributes.CELL_STYLE, cellStyle,
                        DisplayMode.NORMAL, FOO_LABEL);

                cellStyle = new Style();
                cellStyle.setAttributeValue(
                        CellStyleAttributes.TEXT_DECORATION,
                        TextDecorationEnum.UNDERLINE_STRIKETHROUGH);
                configRegistry.registerConfigAttribute(
                        CellConfigAttributes.CELL_STYLE, cellStyle,
                        DisplayMode.NORMAL, BAR_LABEL);
            }
        });
        natTable.configure();

        return natTable;
    }
View Full Code Here

        }
        this.gridLayer = new GlazedListsGridLayer<RowDataFixture>(
                GlazedLists.eventList(RowDataListFixture.getList()),
                propertyNames, RowDataListFixture.getPropertyToLabelMap(), configRegistry);

        NatTable natTable = new NatTable(parent, this.gridLayer, false);
        natTable.addConfiguration(new DefaultNatTableStyleConfiguration());
        natTable.addConfiguration(new HeaderMenuConfiguration(natTable) {
            @Override
            protected PopupMenuBuilder createColumnHeaderMenu(NatTable natTable) {
                return super.createColumnHeaderMenu(natTable)
                        .withCategoriesBasedColumnChooser("Choose columns");
            }
        });

        configureColumnCategoriesInChooser();

        natTable.configure();
        return natTable;
    }
View Full Code Here

        // Plug in the SummaryRowLayer
        IUniqueIndexLayer summaryRowLayer = new SummaryRowLayer(dataLayer,
                configRegistry, false);
        ViewportLayer viewportLayer = new ViewportLayer(summaryRowLayer);

        NatTable natTable = new NatTable(parent, viewportLayer, false);

        // Configure custom summary formula for a column
        natTable.addConfiguration(new MySummaryRowConfig(myDataProvider));
        natTable.addConfiguration(new DefaultNatTableStyleConfiguration());
        natTable.setConfigRegistry(configRegistry);
        natTable.configure();

        return natTable;
    }
View Full Code Here

                new DefaultColumnHeaderDataLayer(
                        defaultColumnHeaderDataProvider),
                new DefaultRowHeaderDataLayer(rowHeaderDataProvider),
                new DataLayer(cornerDataProvider));

        NatTable natTable = new NatTable(parent, gridLayer, false);

        natTable.setConfigRegistry(configRegistry);
        natTable.addConfiguration(new DefaultNatTableStyleConfiguration());

        natTable.configure();

        return natTable;
    }
View Full Code Here

TOP

Related Classes of org.eclipse.nebula.widgets.nattable.NatTable

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.