Package org.eclipse.nebula.widgets.nattable.style

Examples of org.eclipse.nebula.widgets.nattable.style.IStyle


        // to avoid strange rendering behaviour. By default there is no border
        // configuration added,
        // so there shouldn't be issues with backwards compatibility. And if
        // there are some, they can
        // be solved easily by adding the necessary border style configuration.
        IStyle cellStyle = configRegistry.getConfigAttribute(
                CellConfigAttributes.CELL_STYLE, DisplayMode.SELECT,
                SelectionStyleLabels.SELECTION_ANCHOR_GRID_LINE_STYLE);
        BorderStyle borderStyle = cellStyle != null ? cellStyle
                .getAttributeValue(CellStyleAttributes.BORDER_STYLE) : null;

        // if there is no border style configured, use the default one for
        // backwards compatibility
        if (borderStyle == null) {
View Full Code Here


        return this.cornerSelectionCellPainter;
    }

    @Override
    protected IStyle getSelectionAnchorStyle() {
        IStyle cellStyle = new Style();
        cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR,
                selectionAnchorBgColor);
        cellStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR,
                selectionAnchorFgColor);
        cellStyle.setAttributeValue(
                CellStyleAttributes.GRADIENT_BACKGROUND_COLOR,
                selectionAnchorGradientBgColor);
        cellStyle.setAttributeValue(
                CellStyleAttributes.GRADIENT_FOREGROUND_COLOR,
                selectionAnchorGradientFgColor);
        cellStyle.setAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT,
                selectionAnchorHAlign);
        cellStyle.setAttributeValue(CellStyleAttributes.VERTICAL_ALIGNMENT,
                selectionAnchorVAlign);
        cellStyle.setAttributeValue(CellStyleAttributes.FONT,
                selectionAnchorFont);
        cellStyle.setAttributeValue(CellStyleAttributes.IMAGE,
                selectionAnchorImage);
        cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE,
                selectionAnchorBorderStyle);
        cellStyle.setAttributeValue(CellStyleAttributes.PASSWORD_ECHO_CHAR,
                selectionAnchorPWEchoChar);
        cellStyle.setAttributeValue(CellStyleAttributes.TEXT_DECORATION,
                selectionAnchorTextDecoration);
        return cellStyle;
    }
View Full Code Here

        return this.selectionAnchorCellPainter;
    }

    @Override
    protected IStyle getSelectionAnchorSelectionStyle() {
        IStyle cellStyle = new Style();
        cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR,
                selectionAnchorSelectionBgColor);
        cellStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR,
                selectionAnchorSelectionFgColor);
        cellStyle.setAttributeValue(
                CellStyleAttributes.GRADIENT_BACKGROUND_COLOR,
                selectionAnchorSelectionGradientBgColor);
        cellStyle.setAttributeValue(
                CellStyleAttributes.GRADIENT_FOREGROUND_COLOR,
                selectionAnchorSelectionGradientFgColor);
        cellStyle.setAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT,
                selectionAnchorSelectionHAlign);
        cellStyle.setAttributeValue(CellStyleAttributes.VERTICAL_ALIGNMENT,
                selectionAnchorSelectionVAlign);
        cellStyle.setAttributeValue(CellStyleAttributes.FONT,
                selectionAnchorSelectionFont);
        cellStyle.setAttributeValue(CellStyleAttributes.IMAGE,
                selectionAnchorSelectionImage);

        // if there is not explicitly another border style configured use the
        // same as in getSelectionAnchorStyle()
        BorderStyle border = selectionAnchorSelectionBorderStyle != null ? selectionAnchorSelectionBorderStyle
                : selectionAnchorBorderStyle;
        cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE, border);

        cellStyle.setAttributeValue(CellStyleAttributes.PASSWORD_ECHO_CHAR,
                selectionAnchorSelectionPWEchoChar);
        cellStyle.setAttributeValue(CellStyleAttributes.TEXT_DECORATION,
                selectionAnchorSelectionTextDecoration);
        return cellStyle;
    }
View Full Code Here

        return cellStyle;
    }

    @Override
    protected IStyle getEvenRowStyle() {
        IStyle cellStyle = new Style();
        cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR,
                evenRowBgColor);
        cellStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR,
                evenRowFgColor);
        cellStyle.setAttributeValue(
                CellStyleAttributes.GRADIENT_BACKGROUND_COLOR,
                evenRowGradientBgColor);
        cellStyle.setAttributeValue(
                CellStyleAttributes.GRADIENT_FOREGROUND_COLOR,
                evenRowGradientFgColor);
        cellStyle.setAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT,
                evenRowHAlign);
        cellStyle.setAttributeValue(CellStyleAttributes.VERTICAL_ALIGNMENT,
                evenRowVAlign);
        cellStyle.setAttributeValue(CellStyleAttributes.FONT, evenRowFont);
        cellStyle.setAttributeValue(CellStyleAttributes.IMAGE, evenRowImage);
        cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE,
                evenRowBorderStyle);
        cellStyle.setAttributeValue(CellStyleAttributes.PASSWORD_ECHO_CHAR,
                evenRowPWEchoChar);
        cellStyle.setAttributeValue(CellStyleAttributes.TEXT_DECORATION,
                evenRowTextDecoration);
        return cellStyle;
    }
View Full Code Here

        return this.evenRowCellPainter;
    }

    @Override
    protected IStyle getOddRowStyle() {
        IStyle cellStyle = new Style();
        cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR,
                oddRowBgColor);
        cellStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR,
                oddRowFgColor);
        cellStyle.setAttributeValue(
                CellStyleAttributes.GRADIENT_BACKGROUND_COLOR,
                oddRowGradientBgColor);
        cellStyle.setAttributeValue(
                CellStyleAttributes.GRADIENT_FOREGROUND_COLOR,
                oddRowGradientFgColor);
        cellStyle.setAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT,
                oddRowHAlign);
        cellStyle.setAttributeValue(CellStyleAttributes.VERTICAL_ALIGNMENT,
                oddRowVAlign);
        cellStyle.setAttributeValue(CellStyleAttributes.FONT, oddRowFont);
        cellStyle.setAttributeValue(CellStyleAttributes.IMAGE, oddRowImage);
        cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE,
                oddRowBorderStyle);
        cellStyle.setAttributeValue(CellStyleAttributes.PASSWORD_ECHO_CHAR,
                oddRowPWEchoChar);
        cellStyle.setAttributeValue(CellStyleAttributes.TEXT_DECORATION,
                oddRowTextDecoration);
        return cellStyle;
    }
View Full Code Here

        return this.oddRowCellPainter;
    }

    @Override
    protected IStyle getColumnGroupHeaderStyle() {
        IStyle cellStyle = new Style();
        cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR,
                cGroupHeaderBgColor);
        cellStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR,
                cGroupHeaderFgColor);
        cellStyle.setAttributeValue(
                CellStyleAttributes.GRADIENT_BACKGROUND_COLOR,
                cGroupHeaderGradientBgColor);
        cellStyle.setAttributeValue(
                CellStyleAttributes.GRADIENT_FOREGROUND_COLOR,
                cGroupHeaderGradientFgColor);
        cellStyle.setAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT,
                cGroupHeaderHAlign);
        cellStyle.setAttributeValue(CellStyleAttributes.VERTICAL_ALIGNMENT,
                cGroupHeaderVAlign);
        cellStyle.setAttributeValue(CellStyleAttributes.FONT, cGroupHeaderFont);
        cellStyle.setAttributeValue(CellStyleAttributes.IMAGE,
                cGroupHeaderImage);
        cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE,
                cGroupHeaderBorderStyle);
        cellStyle.setAttributeValue(CellStyleAttributes.PASSWORD_ECHO_CHAR,
                cGroupHeaderPWEchoChar);
        cellStyle.setAttributeValue(CellStyleAttributes.TEXT_DECORATION,
                cGroupHeaderTextDecoration);
        return cellStyle;
    }
View Full Code Here

        return this.cGroupHeaderCellPainter;
    }

    @Override
    protected IStyle getRowGroupHeaderStyle() {
        IStyle cellStyle = new Style();
        cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR,
                rGroupHeaderBgColor);
        cellStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR,
                rGroupHeaderFgColor);
        cellStyle.setAttributeValue(
                CellStyleAttributes.GRADIENT_BACKGROUND_COLOR,
                rGroupHeaderGradientBgColor);
        cellStyle.setAttributeValue(
                CellStyleAttributes.GRADIENT_FOREGROUND_COLOR,
                rGroupHeaderGradientFgColor);
        cellStyle.setAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT,
                rGroupHeaderHAlign);
        cellStyle.setAttributeValue(CellStyleAttributes.VERTICAL_ALIGNMENT,
                rGroupHeaderVAlign);
        cellStyle.setAttributeValue(CellStyleAttributes.FONT, rGroupHeaderFont);
        cellStyle.setAttributeValue(CellStyleAttributes.IMAGE,
                rGroupHeaderImage);
        cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE,
                rGroupHeaderBorderStyle);
        cellStyle.setAttributeValue(CellStyleAttributes.PASSWORD_ECHO_CHAR,
                rGroupHeaderPWEchoChar);
        cellStyle.setAttributeValue(CellStyleAttributes.TEXT_DECORATION,
                rGroupHeaderTextDecoration);
        return cellStyle;
    }
View Full Code Here

        return this.rGroupHeaderCellPainter;
    }

    @Override
    protected IStyle getSortHeaderStyle() {
        IStyle cellStyle = new Style();
        cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR,
                sortHeaderBgColor);
        cellStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR,
                sortHeaderFgColor);
        cellStyle.setAttributeValue(
                CellStyleAttributes.GRADIENT_BACKGROUND_COLOR,
                sortHeaderGradientBgColor);
        cellStyle.setAttributeValue(
                CellStyleAttributes.GRADIENT_FOREGROUND_COLOR,
                sortHeaderGradientFgColor);
        cellStyle.setAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT,
                sortHeaderHAlign);
        cellStyle.setAttributeValue(CellStyleAttributes.VERTICAL_ALIGNMENT,
                sortHeaderVAlign);
        cellStyle.setAttributeValue(CellStyleAttributes.FONT, sortHeaderFont);
        cellStyle.setAttributeValue(CellStyleAttributes.IMAGE, sortHeaderImage);
        cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE,
                sortHeaderBorderStyle);
        cellStyle.setAttributeValue(CellStyleAttributes.PASSWORD_ECHO_CHAR,
                sortHeaderPWEchoChar);
        cellStyle.setAttributeValue(CellStyleAttributes.TEXT_DECORATION,
                sortHeaderTextDecoration);
        return cellStyle;
    }
View Full Code Here

        if (paintFg) {
            Rectangle originalClipping = gc.getClipping();
            gc.setClipping(rectangle.intersection(originalClipping));

            IStyle cellStyle = CellStyleUtil.getCellStyle(cell, configRegistry);
            setupGCFromConfig(gc, cellStyle);

            boolean underline = renderUnderlined(cellStyle);
            boolean strikethrough = renderStrikethrough(cellStyle);
View Full Code Here

    @Override
    public void paintCell(ILayerCell cell, GC gc, Rectangle rectangle,
            IConfigRegistry configRegistry) {
        // check for the configuration of a echo character in the corresponding
        // cell style
        IStyle cellStyle = CellStyleUtil.getCellStyle(cell, configRegistry);
        Character configEchoChar = cellStyle
                .getAttributeValue(CellStyleAttributes.PASSWORD_ECHO_CHAR);
        if (configEchoChar != null) {
            this.echoChar = configEchoChar;
        }
        super.paintCell(cell, gc, rectangle, configRegistry);
View Full Code Here

TOP

Related Classes of org.eclipse.nebula.widgets.nattable.style.IStyle

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.