Package org.eclipse.nebula.widgets.nattable

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


        CompositeLayer compositeLayer = new CompositeLayer(1, 2);
        compositeLayer.setChildLayer(GridRegion.COLUMN_HEADER,
                columnHeaderLayer, 0, 0);
        compositeLayer.setChildLayer(GridRegion.BODY, viewportLayer, 0, 1);

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

        natTable.addConfiguration(new DefaultNatTableStyleConfiguration() {
            {
                vAlign = VerticalAlignmentEnum.TOP;
                hAlign = HorizontalAlignmentEnum.LEFT;
                cellPainter = new LineBorderDecorator(painter);
                font = GUIHelper.getFont(new FontData("Arial", 20, SWT.NORMAL));
            }
        });

        natTable.configure();
        GridDataFactory.fillDefaults().grab(true, true).applyTo(natTable);
    }
View Full Code Here


        CompositeLayer compositeLayer = new CompositeLayer(1, 2);
        compositeLayer.setChildLayer(GridRegion.COLUMN_HEADER,
                columnHeaderLayer, 0, 0);
        compositeLayer.setChildLayer(GridRegion.BODY, viewportLayer, 0, 1);

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

        natTable.addConfiguration(new DefaultNatTableStyleConfiguration() {
            {
                vAlign = VerticalAlignmentEnum.MIDDLE;
                hAlign = HorizontalAlignmentEnum.LEFT;
                cellPainter = new LineBorderDecorator(painter);
                font = GUIHelper.getFont(new FontData("Arial", 20, SWT.NORMAL));
            }
        });

        natTable.configure();

        GridDataFactory.fillDefaults().grab(true, true).applyTo(natTable);
    }
View Full Code Here

                + "Out of the box, labels can be applied to whole columns, rows and cells.";
    }

    public Control createExampleControl(Composite parent) {
        SelectionExampleGridLayer gridLayer = new SelectionExampleGridLayer();
        NatTable natTable = new NatTable(parent, gridLayer, false);

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

        // Label accumulator - adds labels to all cells with the given data
        // value
        CellOverrideLabelAccumulator<RowDataFixture> cellLabelAccumulator = new CellOverrideLabelAccumulator<RowDataFixture>(
                gridLayer.getBodyDataProvider());
        cellLabelAccumulator.registerOverride("AAA", 2, CELL_LABEL);

        // Register your cell style, against the label applied to the cell
        // Other configuration which can be added (apart from style) include
        // CellConfigAttributes, EditConfigAttributes, SortConfigAttributes etc.
        IConfigRegistry configRegistry = new ConfigRegistry();
        addColumnHighlight(configRegistry);

        // Register label accumulator
        bodyDataLayer.setConfigLabelAccumulator(cellLabelAccumulator);
        gridLayer.getSelectionLayer().addConfiguration(
                new DefaultSelectionLayerConfiguration());

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

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

                .setConfigLabelAccumulator(new ValidatorMessageLabelAccumulator());

        ViewportLayer layer = new ViewportLayer(dataLayer);
        layer.setRegionName(GridRegion.BODY);

        NatTable natTable = new NatTable(panel, NatTable.DEFAULT_STYLE_OPTIONS
                | SWT.BORDER, layer, false);
        natTable.addConfiguration(new ValidationMessageTableStyleConfiguration());

        natTable.configure();

        GridDataFactory.fillDefaults().grab(true, true).applyTo(natTable);

        return panel;
    }
View Full Code Here

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

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

        this.natTable.setConfigRegistry(configRegistry);

        this.natTable.addConfiguration(new DefaultNatTableStyleConfiguration());
        // Popup menu
View Full Code Here

        // unaffected by column order.
        final ColumnOverrideLabelAccumulator columnLabelAccumulator = new ColumnOverrideLabelAccumulator(
                bodyDataLayer);
        bodyDataLayer.setConfigLabelAccumulator(columnLabelAccumulator);

        NatTable natTable = new NatTable(parent, underlyingLayer, false);
        natTable.addConfiguration(new DefaultNatTableStyleConfiguration());
        natTable.addConfiguration(new HeaderMenuConfiguration(natTable));
        // natTable.addConfiguration(new DebugMenuConfiguration(natTable));
        natTable.addConfiguration(new FilterRowCustomConfiguration());

        natTable.addConfiguration(EditableGridExample
                .editableGridConfiguration(columnLabelAccumulator, dataProvider));

        natTable.setConfigRegistry(configRegistry);
        natTable.configure();

        return natTable;
    }
View Full Code Here

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

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

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

        natTable.configure();

        return natTable;
    }
View Full Code Here

                + "to trigger business actions as required.";
    }

    public Control createExampleControl(Composite parent) {
        gridLayer = new SelectionExampleGridLayer();
        nattable = new NatTable(parent, gridLayer, false);

        nattable.addConfiguration(new DefaultNatTableStyleConfiguration());
        nattable.addConfiguration(new HeaderMenuConfiguration(nattable));
        nattable.addConfiguration(new DefaultSelectionStyleConfiguration());
View Full Code Here

        // unaffected by column order.
        final ColumnOverrideLabelAccumulator columnLabelAccumulator = new ColumnOverrideLabelAccumulator(
                bodyDataLayer);
        bodyDataLayer.setConfigLabelAccumulator(columnLabelAccumulator);

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

        natTable.addConfiguration(new DefaultNatTableStyleConfiguration());
        natTable.addConfiguration(new HeaderMenuConfiguration(natTable));
        natTable.addConfiguration(editableGridConfiguration(
                columnLabelAccumulator, dataProvider));

        final ColumnHeaderCheckBoxPainter columnHeaderCheckBoxPainter = new ColumnHeaderCheckBoxPainter(
                bodyDataLayer);
        final ICellPainter column9HeaderPainter = new BeveledBorderDecorator(
                new CellPainterDecorator(new TextPainter(), CellEdgeEnum.RIGHT,
                        columnHeaderCheckBoxPainter));
        natTable.addConfiguration(new AbstractRegistryConfiguration() {
            @Override
            public void configureRegistry(IConfigRegistry configRegistry) {
                configRegistry.registerConfigAttribute(
                        CellConfigAttributes.CELL_PAINTER,
                        column9HeaderPainter, DisplayMode.NORMAL,
                        ColumnLabelAccumulator.COLUMN_LABEL_PREFIX + 9);
            }

            @Override
            public void configureUiBindings(UiBindingRegistry uiBindingRegistry) {
                uiBindingRegistry.registerFirstSingleClickBinding(
                        new CellPainterMouseEventMatcher(
                                GridRegion.COLUMN_HEADER,
                                MouseEventMatcher.LEFT_BUTTON,
                                columnHeaderCheckBoxPainter),
                                new ToggleCheckBoxColumnAction(
                                        columnHeaderCheckBoxPainter, bodyDataLayer));
            }
        });

        natTable.configure();

        return natTable;
    }
View Full Code Here

        };

        ILayer layer = new DataLayer(myDataProvider);

        return new NatTable(parent, layer);
    }
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.