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

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


    class ActiveTableStyleConfiguration extends AbstractRegistryConfiguration {

        @Override
        public void configureRegistry(IConfigRegistry configRegistry) {
            IStyle style = new Style();
            style.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR,
                    GUIHelper.COLOR_BLUE);
            style.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR,
                    GUIHelper.COLOR_WHITE);

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


    class HoverAndHeaderStyleConfiguration extends
            AbstractRegistryConfiguration {

        @Override
        public void configureRegistry(IConfigRegistry configRegistry) {
            Style style = new Style();
            style.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR,
                    GUIHelper.COLOR_YELLOW);

            configRegistry.registerConfigAttribute(
                    CellConfigAttributes.CELL_STYLE, style, DisplayMode.HOVER);

            style = new Style();
            style.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR,
                    GUIHelper.COLOR_GREEN);

            configRegistry.registerConfigAttribute(
                    CellConfigAttributes.CELL_STYLE, style,
                    DisplayMode.SELECT_HOVER);

            style = new Style();
            style.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR,
                    GUIHelper.COLOR_RED);

            configRegistry.registerConfigAttribute(
                    CellConfigAttributes.CELL_STYLE, style, DisplayMode.HOVER,
                    GridRegion.ROW_HEADER);

            style = new Style();
            style.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR,
                    GUIHelper.COLOR_BLUE);

            configRegistry.registerConfigAttribute(
                    CellConfigAttributes.CELL_STYLE, style,
                    DisplayMode.SELECT_HOVER, GridRegion.ROW_HEADER);
View Full Code Here

        return this.filterRowCellPainter;
    }

    @Override
    protected IStyle getTreeStyle() {
        IStyle cellStyle = new Style();
        cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR,
                treeBgColor);
        cellStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR,
                treeFgColor);
        cellStyle.setAttributeValue(
                CellStyleAttributes.GRADIENT_BACKGROUND_COLOR,
                treeGradientBgColor);
        cellStyle.setAttributeValue(
                CellStyleAttributes.GRADIENT_FOREGROUND_COLOR,
                treeGradientFgColor);
        cellStyle.setAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT,
                treeHAlign);
        cellStyle.setAttributeValue(CellStyleAttributes.VERTICAL_ALIGNMENT,
                treeVAlign);
        cellStyle.setAttributeValue(CellStyleAttributes.FONT, treeFont);
        cellStyle.setAttributeValue(CellStyleAttributes.IMAGE, treeImage);
        cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE,
                treeBorderStyle);
        cellStyle.setAttributeValue(CellStyleAttributes.PASSWORD_ECHO_CHAR,
                treePWEchoChar);
        cellStyle.setAttributeValue(CellStyleAttributes.TEXT_DECORATION,
                treeTextDecoration);
        return cellStyle;
    }
View Full Code Here

        Assert.assertEquals("", "012345".substring(6));
    }

    private void registerFont(FontData fontData) {
        // Register default body font
        Style cellStyle = new Style();
        defaultFont = GUIHelper.getFont(fontData);
        cellStyle.setAttributeValue(CellStyleAttributes.FONT, defaultFont);
        configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE,
                cellStyle, DisplayMode.NORMAL,
                AlternatingRowConfigLabelAccumulator.ODD_ROW_CONFIG_TYPE);
    }
View Full Code Here

        addSummaryProviderConfig(configRegistry);
        addSummaryRowDisplayConverter(configRegistry);
    }

    protected void addSummaryRowStyleConfig(IConfigRegistry configRegistry) {
        Style cellStyle = new Style();
        cellStyle.setAttributeValue(CellStyleAttributes.FONT, summaryRowFont);
        cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR,
                summaryRowBgColor);
        cellStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR,
                summaryRowFgColor);
        cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE,
                summaryRowBorderStyle);
        configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE,
                cellStyle, DisplayMode.NORMAL,
                SummaryRowLayer.DEFAULT_SUMMARY_ROW_CONFIG_LABEL);
    }
View Full Code Here

public class ColumnStyleEditorDialogRunner {

    public static void main(String[] args) throws Exception {
        Shell shell = new Shell();
        ColumnStyleEditorDialog dialog = new ColumnStyleEditorDialog(shell,
                new Style());
        dialog.open();
        System.out.println("Style: " + dialog.getNewColumnCellStyle());
    }
View Full Code Here

                properties.getProperty(expectedPrefix + BORDER_PREFIX));
    }

    @Test
    public void loadPersistedColorSettings() throws Exception {
        Style style = StylePersistor.loadStyle(TEST_PREFIX, propertiesFixture);

        Color fgColor = style.getAttributeValue(FOREGROUND_COLOR);
        assertEquals("RGB {100, 110, 120}", fgColor.getRGB().toString());

        Color bgColor = style.getAttributeValue(BACKGROUND_COLOR);
        assertEquals("RGB {200, 210, 220}", bgColor.getRGB().toString());
    }
View Full Code Here

        assertEquals("RGB {200, 210, 220}", bgColor.getRGB().toString());
    }

    @Test
    public void loadPersistedAlignmentSettings() throws Exception {
        Style style = StylePersistor.loadStyle(TEST_PREFIX, propertiesFixture);

        HorizontalAlignmentEnum expecetdHAlign = style
                .getAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT);
        assertEquals(HorizontalAlignmentEnum.LEFT, expecetdHAlign);

        VerticalAlignmentEnum expecetdVAlign = style
                .getAttributeValue(CellStyleAttributes.VERTICAL_ALIGNMENT);
        assertEquals(VerticalAlignmentEnum.TOP, expecetdVAlign);
    }
View Full Code Here

        assertEquals(VerticalAlignmentEnum.TOP, expecetdVAlign);
    }

    @Test
    public void loadFontSettings() throws Exception {
        Style style = StylePersistor.loadStyle(TEST_PREFIX, propertiesFixture);

        Font font = style.getAttributeValue(CellStyleAttributes.FONT);
        assertTrue(font.getFontData()[0].toString().contains("|Tahoma|8.25|"));
    }
View Full Code Here

        assertTrue(font.getFontData()[0].toString().contains("|Tahoma|8.25|"));
    }

    @Test
    public void loadBorderStyleSettings() throws Exception {
        Style style = StylePersistor.loadStyle(TEST_PREFIX, propertiesFixture);

        BorderStyle borderStyle = style
                .getAttributeValue(CellStyleAttributes.BORDER_STYLE);
        assertEquals(2, borderStyle.getThickness());
        assertEquals(100, borderStyle.getColor().getRed());
        assertEquals(110, borderStyle.getColor().getGreen());
        assertEquals(120, borderStyle.getColor().getBlue());
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.