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

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


    }

    // Load

    public static Style loadStyle(String prefix, Properties properties) {
        Style style = new Style();
        prefix = prefix + DOT + STYLE_PERSISTENCE_PREFIX;

        // BG Color
        String bgColorPrefix = prefix + DOT + BG_COLOR_PREFIX;
        Color bgColor = loadColor(bgColorPrefix, properties);
        if (bgColor != null) {
            style.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR,
                    bgColor);
        }

        // FG Color
        String fgColorPrefix = prefix + DOT + FG_COLOR_PREFIX;
        Color fgColor = loadColor(fgColorPrefix, properties);
        if (fgColor != null) {
            style.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR,
                    fgColor);
        }

        // Alignment
        String hAlignPrefix = prefix + DOT + H_ALIGNMENT_PREFIX;
        HorizontalAlignmentEnum hAlign = loadHAlignment(hAlignPrefix,
                properties);
        if (hAlign != null) {
            style.setAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT,
                    hAlign);
        }

        String vAlignPrefix = prefix + DOT + V_ALIGNMENT_PREFIX;
        VerticalAlignmentEnum vAlign = loadVAlignment(vAlignPrefix, properties);
        if (vAlign != null) {
            style.setAttributeValue(CellStyleAttributes.VERTICAL_ALIGNMENT,
                    vAlign);
        }

        // Font
        String fontPrefix = prefix + DOT + FONT_PREFIX;
        Font font = loadFont(fontPrefix, properties);
        if (font != null) {
            style.setAttributeValue(CellStyleAttributes.FONT, font);
        }

        // Border Style
        String borderPrefix = prefix + DOT + BORDER_PREFIX;
        BorderStyle borderStyle = loadBorderStyle(borderPrefix, properties);
        if (borderStyle != null) {
            style.setAttributeValue(CellStyleAttributes.BORDER_STYLE,
                    borderStyle);
        }

        return style;
    }
View Full Code Here


        return this.rHeaderSelectionCellPainter;
    }

    @Override
    protected IStyle getRowHeaderFullSelectionStyle() {
        IStyle cellStyle = new Style();
        cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR,
                rHeaderFullSelectionBgColor);
        cellStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR,
                rHeaderFullSelectionFgColor);
        cellStyle.setAttributeValue(
                CellStyleAttributes.GRADIENT_BACKGROUND_COLOR,
                rHeaderFullSelectionGradientBgColor);
        cellStyle.setAttributeValue(
                CellStyleAttributes.GRADIENT_FOREGROUND_COLOR,
                rHeaderFullSelectionGradientFgColor);
        cellStyle.setAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT,
                rHeaderFullSelectionHAlign);
        cellStyle.setAttributeValue(CellStyleAttributes.VERTICAL_ALIGNMENT,
                rHeaderFullSelectionVAlign);
        cellStyle.setAttributeValue(CellStyleAttributes.FONT,
                rHeaderFullSelectionFont);
        cellStyle.setAttributeValue(CellStyleAttributes.IMAGE,
                rHeaderFullSelectionImage);
        cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE,
                rHeaderFullSelectionBorderStyle);
        cellStyle.setAttributeValue(CellStyleAttributes.PASSWORD_ECHO_CHAR,
                rHeaderFullSelectionPWEchoChar);
        cellStyle.setAttributeValue(CellStyleAttributes.TEXT_DECORATION,
                rHeaderFullSelectionTextDecoration);
        return cellStyle;
    }
View Full Code Here

        return this.rHeaderFullSelectionCellPainter;
    }

    @Override
    protected IStyle getCornerSelectionStyle() {
        IStyle cellStyle = new Style();
        cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR,
                cornerSelectionBgColor);
        cellStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR,
                cornerSelectionFgColor);
        cellStyle.setAttributeValue(
                CellStyleAttributes.GRADIENT_BACKGROUND_COLOR,
                cornerSelectionGradientBgColor);
        cellStyle.setAttributeValue(
                CellStyleAttributes.GRADIENT_FOREGROUND_COLOR,
                cornerSelectionGradientFgColor);
        cellStyle.setAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT,
                cornerSelectionHAlign);
        cellStyle.setAttributeValue(CellStyleAttributes.VERTICAL_ALIGNMENT,
                cornerSelectionVAlign);
        cellStyle.setAttributeValue(CellStyleAttributes.FONT,
                cornerSelectionFont);
        cellStyle.setAttributeValue(CellStyleAttributes.IMAGE,
                cornerSelectionImage);
        cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE,
                cornerSelectionBorderStyle);
        cellStyle.setAttributeValue(CellStyleAttributes.PASSWORD_ECHO_CHAR,
                cornerSelectionPWEchoChar);
        cellStyle.setAttributeValue(CellStyleAttributes.TEXT_DECORATION,
                cornerSelectionTextDecoration);
        return cellStyle;
    }
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

                CellConfigAttributes.DISPLAY_CONVERTER,
                new DefaultDateDisplayConverter(), DisplayMode.EDIT,
                _4451_CrossValidationGridExample.DATE_LABEL);

        // configure the validation error style
        IStyle validationErrorStyle = new Style();
        validationErrorStyle.setAttributeValue(
                CellStyleAttributes.BACKGROUND_COLOR, GUIHelper.COLOR_RED);
        validationErrorStyle.setAttributeValue(
                CellStyleAttributes.FOREGROUND_COLOR, GUIHelper.COLOR_WHITE);

        configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE,
                validationErrorStyle, DisplayMode.NORMAL,
                _4451_CrossValidationGridExample.INVALID_LABEL);
View Full Code Here

            this.conversionErrorStyle = configRegistry.getConfigAttribute(
                    EditConfigAttributes.CONVERSION_ERROR_STYLE,
                    DisplayMode.EDIT, labelStack.getLabels());

            if (this.conversionErrorStyle == null) {
                this.conversionErrorStyle = new Style();
                this.conversionErrorStyle.setAttributeValue(
                        CellStyleAttributes.FOREGROUND_COLOR,
                        GUIHelper.COLOR_RED);
            }

            this.validationErrorStyle = configRegistry.getConfigAttribute(
                    EditConfigAttributes.VALIDATION_ERROR_STYLE,
                    DisplayMode.EDIT, labelStack.getLabels());

            if (this.validationErrorStyle == null) {
                this.validationErrorStyle = new Style();
                this.validationErrorStyle.setAttributeValue(
                        CellStyleAttributes.FOREGROUND_COLOR,
                        GUIHelper.COLOR_RED);
            }
        }
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 this.selectionAnchorSelectionCellPainter;
    }

    @Override
    protected IStyle getSelectionAnchorGridLineStyle() {
        Style cellStyle = new Style();
        cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE,
                selectionAnchorGridBorderStyle);
        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

                configRegistry.registerConfigAttribute(
                        CellConfigAttributes.CELL_PAINTER,
                        new CheckBoxPainter(), DisplayMode.NORMAL,
                        ColumnLabelAccumulator.COLUMN_LABEL_PREFIX + 4);

                IStyle style = new Style();
                style.setAttributeValue(
                        CellStyleAttributes.HORIZONTAL_ALIGNMENT,
                        HorizontalAlignmentEnum.RIGHT);
                configRegistry.registerConfigAttribute(
                        CellConfigAttributes.CELL_STYLE, style,
                        DisplayMode.NORMAL,
                        ColumnLabelAccumulator.COLUMN_LABEL_PREFIX + 2);
                configRegistry.registerConfigAttribute(
                        CellConfigAttributes.CELL_STYLE, style,
                        DisplayMode.NORMAL,
                        ColumnLabelAccumulator.COLUMN_LABEL_PREFIX + 3);

                configRegistry.registerConfigAttribute(
                        CellConfigAttributes.DISPLAY_CONVERTER,
                        new DefaultDoubleDisplayConverter(),
                        DisplayMode.NORMAL,
                        ColumnLabelAccumulator.COLUMN_LABEL_PREFIX + 3);

                // the main styling of the summary row cell in the row header is
                // done via
                // summary row default style, but we need to override the
                // alignment
                style = new Style();
                style.setAttributeValue(
                        CellStyleAttributes.HORIZONTAL_ALIGNMENT,
                        HorizontalAlignmentEnum.CENTER);
                configRegistry.registerConfigAttribute(
                        CellConfigAttributes.CELL_STYLE, style,
                        DisplayMode.NORMAL, ROW_HEADER_SUMMARY_ROW);
View Full Code Here

TOP

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

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.