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

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


                CellConfigAttributes.DISPLAY_CONVERTER,
                new DefaultDateDisplayConverter(), DisplayMode.EDIT,
                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,
                CrossValidationGridExample.INVALID_LABEL);
View Full Code Here


            }
        });
        // 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);
View Full Code Here

        configRegistry.registerConfigAttribute(
                BlinkConfigAttributes.BLINK_RESOLVER, getBlinkResolver(),
                DisplayMode.NORMAL);

        // Bg color styles to be used for blinking cells
        Style cellStyle = new Style();
        cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR,
                GUIHelper.COLOR_GREEN);
        configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE,
                cellStyle, DisplayMode.NORMAL, BLINK_UP_CONFIG_LABEL);

        cellStyle = new Style();
        cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR,
                GUIHelper.COLOR_RED);
        configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE,
                cellStyle, DisplayMode.NORMAL, BLINK_DOWN_CONFIG_LABEL);
    }
View Full Code Here

    class CustomPaintingConfig extends AbstractRegistryConfiguration {

        public void configureRegistry(IConfigRegistry configRegistry) {
            // Register cell style
            Style cellStyle = new Style();
            cellStyle.setAttributeValue(
                    CellStyleAttributes.HORIZONTAL_ALIGNMENT,
                    HorizontalAlignmentEnum.CENTER);
            cellStyle.setAttributeValue(CellStyleAttributes.VERTICAL_ALIGNMENT,
                    VerticalAlignmentEnum.MIDDLE);

            cellStyle
                    .setAttributeValue(
                            PercentageBarDecorator.PERCENTAGE_BAR_COMPLETE_REGION_START_COLOR,
                            GUIHelper.getColor(new RGB(251, 149, 123)));
            cellStyle
                    .setAttributeValue(
                            PercentageBarDecorator.PERCENTAGE_BAR_COMPLETE_REGION_END_COLOR,
                            GUIHelper.getColor(new RGB(248, 253, 219)));
            cellStyle
                    .setAttributeValue(
                            PercentageBarDecorator.PERCENTAGE_BAR_INCOMPLETE_REGION_COLOR,
                            GUIHelper.getColor(new RGB(236, 217, 255)));

            configRegistry.registerConfigAttribute(
View Full Code Here

        // configure the multi line text editor to always open in a subdialog
        configRegistry.registerConfigAttribute(
                EditConfigAttributes.OPEN_IN_DIALOG, Boolean.TRUE,
                DisplayMode.EDIT, EditorExample.COLUMN_FOUR_LABEL);

        Style cellStyle = new Style();
        cellStyle.setAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT,
                HorizontalAlignmentEnum.LEFT);
        configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE,
                cellStyle, DisplayMode.NORMAL, EditorExample.COLUMN_FOUR_LABEL);
        configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE,
                cellStyle, DisplayMode.EDIT, EditorExample.COLUMN_FOUR_LABEL);
View Full Code Here

    private void registerErrorHandlingStyles(IConfigRegistry configRegistry) {
        // this is needed to support different styling on just in time
        // conversion/validation
        // error rendering in a text editor
        Style conversionErrorStyle = new Style();
        conversionErrorStyle.setAttributeValue(
                CellStyleAttributes.BACKGROUND_COLOR, GUIHelper.COLOR_RED);
        conversionErrorStyle.setAttributeValue(
                CellStyleAttributes.FOREGROUND_COLOR, GUIHelper.COLOR_WHITE);

        configRegistry.registerConfigAttribute(
                EditConfigAttributes.CONVERSION_ERROR_STYLE,
                conversionErrorStyle, DisplayMode.EDIT,
                EditErrorHandlingExample.COLUMN_TWO_LABEL);

        Style validationErrorStyle = new Style();
        validationErrorStyle.setAttributeValue(
                CellStyleAttributes.BACKGROUND_COLOR, GUIHelper.COLOR_BLACK);
        validationErrorStyle.setAttributeValue(
                CellStyleAttributes.FOREGROUND_COLOR, GUIHelper.COLOR_WHITE);

        configRegistry.registerConfigAttribute(
                EditConfigAttributes.VALIDATION_ERROR_STYLE,
                validationErrorStyle, DisplayMode.EDIT,
View Full Code Here

     * Register an attribute to be applied to all cells with the highlight
     * label. A similar approach can be used to bind styling to an arbitrary
     * group of cells
     */
    private void addColumnHighlight(IConfigRegistry configRegistry) {
        Style style = new Style();
        style.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR,
                GUIHelper.COLOR_BLUE);
        style.setAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT,
                HorizontalAlignmentEnum.RIGHT);

        configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, // attribute
                                                                                // to
                                                                                // apply
View Full Code Here

        // Add your listener to the button
        buttonPainter.addClickListener(new MyMouseAction());

        // Set the color of the cell. This is picked up by the button painter to
        // style the button
        Style style = new Style();
        style.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR,
                GUIHelper.COLOR_WHITE);

        configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE,
                style, DisplayMode.NORMAL, CUSTOM_CELL_LABEL);
        configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE,
View Full Code Here

        return builder.build();
    }

    private void customize() {
        Style style = new Style();
        style.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR,
                GUIHelper.COLOR_RED);

        ListDataProvider<TableRowFixture> bodyDataProvider = builder
                .getBodyLayerStack().getDataProvider();
        CellOverrideLabelAccumulator<TableRowFixture> myAccumulator = new CellOverrideLabelAccumulator<TableRowFixture>(
View Full Code Here

    public Color validationErrorFgColor = null;
    public Font validationErrorFont = null;

    @Override
    protected IStyle getDefaultCellStyle() {
        IStyle cellStyle = new Style();
        cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR,
                defaultBgColor);
        cellStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR,
                defaultFgColor);
        cellStyle.setAttributeValue(
                CellStyleAttributes.GRADIENT_BACKGROUND_COLOR,
                defaultGradientBgColor);
        cellStyle.setAttributeValue(
                CellStyleAttributes.GRADIENT_FOREGROUND_COLOR,
                defaultGradientFgColor);
        cellStyle.setAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT,
                defaultHAlign);
        cellStyle.setAttributeValue(CellStyleAttributes.VERTICAL_ALIGNMENT,
                defaultVAlign);
        cellStyle.setAttributeValue(CellStyleAttributes.FONT, defaultFont);
        cellStyle.setAttributeValue(CellStyleAttributes.IMAGE, defaultImage);
        cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE,
                defaultBorderStyle);
        cellStyle.setAttributeValue(CellStyleAttributes.PASSWORD_ECHO_CHAR,
                defaultPWEchoChar);
        cellStyle.setAttributeValue(CellStyleAttributes.TEXT_DECORATION,
                defaultTextDecoration);
        return cellStyle;
    }
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.