Package org.eclipse.nebula.widgets.nattable.config

Examples of org.eclipse.nebula.widgets.nattable.config.IConfigRegistry


    }

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

        DataLayer bodyDataLayer = gridLayer.getBodyDataLayer();

        // Step 1: Create a label accumulator - adds custom labels to all cells
        // which we
View Full Code Here


            public void setDataValue(int columnIndex, int rowIndex,
                    Object newValue) {}
        };

        IConfigRegistry configRegistry = new ConfigRegistry();
        IUniqueIndexLayer dataLayer = new DataLayer(myDataProvider);

        // Plug in the SummaryRowLayer
        IUniqueIndexLayer summaryRowLayer = new SummaryRowLayer(dataLayer,
                configRegistry, false);
View Full Code Here

        StandaloneNatExampleRunner.run(new PersistentNatExampleWrapper(
                new FilterRowGridExample()));
    }

    public Control createExampleControl(Composite parent) {
        IConfigRegistry configRegistry = new ConfigRegistry();
        ILayer underlyingLayer = new FilterRowExampleGridLayer(configRegistry);

        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() {
            @Override
            public void configureRegistry(IConfigRegistry configRegistry) {
                super.configureRegistry(configRegistry);

                // Shade the row to be slightly darker than the blue background.
                final Style rowStyle = new Style();
                rowStyle.setAttributeValue(
                        CellStyleAttributes.BACKGROUND_COLOR,
                        GUIHelper.getColor(197, 212, 231));
                configRegistry.registerConfigAttribute(
                        CellConfigAttributes.CELL_STYLE, rowStyle,
                        DisplayMode.NORMAL, GridRegion.FILTER_ROW);
            }
        });
View Full Code Here

                bodyDataProvider);
        myAccumulator.registerOverride("AAA", 2, "myLabel");

        builder.addCellLabelsToBody(myAccumulator);

        IConfigRegistry configRegistry = natTable.getConfigRegistry();
        configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE,
                style, DisplayMode.NORMAL, "myLabel");
    }
View Full Code Here

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

                + "It is also sortable and editable and has a filter row to show that the static filter\n"
                + "also works with some other features.";
    }

    public Control createExampleControl(Composite parent) {
        IConfigRegistry configRegistry = new ConfigRegistry();
        StaticFilterExampleGridLayer underlyingLayer = new StaticFilterExampleGridLayer(
                configRegistry);

        DataLayer bodyDataLayer = underlyingLayer.getBodyDataLayer();
        IDataProvider dataProvider = underlyingLayer.getBodyDataProvider();
View Full Code Here

    }

    @Override
    public boolean doCommand(EditSelectionCommand command) {
        Composite parent = command.getParent();
        IConfigRegistry configRegistry = command.getConfigRegistry();
        Character initialValue = command.getCharacter();

        if (EditUtils.allCellsEditable(this.selectionLayer, configRegistry)
                && EditUtils.isEditorSame(this.selectionLayer, configRegistry)
                && EditUtils.isConverterSame(this.selectionLayer, configRegistry)
View Full Code Here

    @Override
    public boolean doCommand(EditCellCommand command) {
        ILayerCell cell = command.getCell();
        Composite parent = command.getParent();
        IConfigRegistry configRegistry = command.getConfigRegistry();

        // check if the cell is editable
        IEditableRule rule = configRegistry.getConfigAttribute(
                EditConfigAttributes.CELL_EDITABLE_RULE, DisplayMode.EDIT, cell
                        .getConfigLabels().getLabels());

        if (rule.isEditable(cell, configRegistry)) {
            EditController.editCell(cell, parent, cell.getDataValue(),
View Full Code Here

            // Bug 407598: only perform a check if the click in the body region
            // was performed on a cell
            // cell == null can happen if the viewport is quite large and
            // contains not enough cells to fill it.
            if (cell != null) {
                IConfigRegistry configRegistry = natTable.getConfigRegistry();
                ICellPainter cellPainter = cell.getLayer().getCellPainter(
                        columnPosition, rowPosition, cell, configRegistry);

                GC gc = new GC(natTable.getDisplay());
                try {
View Full Code Here

        yOffset = currentEvent.y - cellBounds.y;
        Image image = new Image(natTable.getDisplay(), cellBounds.width,
                cellBounds.height);

        GC gc = new GC(image);
        IConfigRegistry configRegistry = natTable.getConfigRegistry();
        ICellPainter cellPainter = cell.getLayer().getCellPainter(
                columnPosition, rowPosition, cell, configRegistry);
        if (cellPainter != null) {
            cellPainter.paintCell(cell, gc, new Rectangle(0, 0,
                    cellBounds.width, cellBounds.height), configRegistry);
View Full Code Here

TOP

Related Classes of org.eclipse.nebula.widgets.nattable.config.IConfigRegistry

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.