Package nextapp.echo2.app

Examples of nextapp.echo2.app.MutableStyleSheet.addStyle()


        MutableStyleSheet styleSheet = new MutableStyleSheet();

        MutableStyle alphaButtonStyle = new MutableStyle();
        alphaButtonStyle.setProperty(Button.PROPERTY_BORDER, TestConstants.BORDER_THICK_ORANGE);
        alphaButtonStyle.setProperty(Button.PROPERTY_BACKGROUND, Color.YELLOW);
        styleSheet.addStyle(Button.class, "alpha", alphaButtonStyle);

        MutableStyle bravoButtonStyle = new MutableStyle();
        bravoButtonStyle.setProperty(Button.PROPERTY_BORDER, TestConstants.BORDER_THIN_YELLOW);
        bravoButtonStyle.setProperty(Button.PROPERTY_BACKGROUND, Color.GREEN);
        styleSheet.addStyle(Button.class, "bravo", bravoButtonStyle);
View Full Code Here


        styleSheet.addStyle(Button.class, "alpha", alphaButtonStyle);

        MutableStyle bravoButtonStyle = new MutableStyle();
        bravoButtonStyle.setProperty(Button.PROPERTY_BORDER, TestConstants.BORDER_THIN_YELLOW);
        bravoButtonStyle.setProperty(Button.PROPERTY_BACKGROUND, Color.GREEN);
        styleSheet.addStyle(Button.class, "bravo", bravoButtonStyle);

        MutableStyle bravoLabelStyle = new MutableStyle();
        bravoLabelStyle.setProperty(Label.PROPERTY_FOREGROUND, Color.RED);
        styleSheet.addStyle(Label.class, "bravo", bravoLabelStyle);
       
View Full Code Here

        bravoButtonStyle.setProperty(Button.PROPERTY_BACKGROUND, Color.GREEN);
        styleSheet.addStyle(Button.class, "bravo", bravoButtonStyle);

        MutableStyle bravoLabelStyle = new MutableStyle();
        bravoLabelStyle.setProperty(Label.PROPERTY_FOREGROUND, Color.RED);
        styleSheet.addStyle(Label.class, "bravo", bravoLabelStyle);
       
        app.setStyleSheet(styleSheet);

        assertNull(app.getLabel().getRenderProperty(Label.PROPERTY_FOREGROUND));
        app.getLabel().setStyleName("charlie");
View Full Code Here

        MutableStyleSheet styleSheet = new MutableStyleSheet();
       
        MutableStyle alphaButtonStyle = new MutableStyle();
        alphaButtonStyle.setProperty(Button.PROPERTY_BORDER, TestConstants.BORDER_THICK_ORANGE);
        alphaButtonStyle.setProperty(Button.PROPERTY_BACKGROUND, Color.YELLOW);
        styleSheet.addStyle(Button.class, "alpha", alphaButtonStyle);
       
        assertEquals(alphaButtonStyle, styleSheet.getStyle(Button.class, "alpha"));
        assertNull(styleSheet.getStyle(Button.class, "bravo"));
       
        MutableStyle bravoButtonStyle = new MutableStyle();
View Full Code Here

        assertNull(styleSheet.getStyle(Button.class, "bravo"));
       
        MutableStyle bravoButtonStyle = new MutableStyle();
        bravoButtonStyle.setProperty(Button.PROPERTY_BORDER, TestConstants.BORDER_THIN_YELLOW);
        bravoButtonStyle.setProperty(Button.PROPERTY_BACKGROUND, Color.GREEN);
        styleSheet.addStyle(Button.class, "bravo", bravoButtonStyle);

        assertEquals(alphaButtonStyle, styleSheet.getStyle(Button.class, "alpha"));
        assertEquals(bravoButtonStyle, styleSheet.getStyle(Button.class, "bravo"));
       
        MutableStyle bravoLabelStyle = new MutableStyle();
View Full Code Here

        assertEquals(alphaButtonStyle, styleSheet.getStyle(Button.class, "alpha"));
        assertEquals(bravoButtonStyle, styleSheet.getStyle(Button.class, "bravo"));
       
        MutableStyle bravoLabelStyle = new MutableStyle();
        bravoLabelStyle.setProperty(Label.PROPERTY_FOREGROUND, Color.RED);
        styleSheet.addStyle(Label.class, "bravo", bravoLabelStyle);

        assertEquals(alphaButtonStyle, styleSheet.getStyle(Button.class, "alpha"));
        assertEquals(bravoButtonStyle, styleSheet.getStyle(Button.class, "bravo"));
        assertEquals(bravoLabelStyle, styleSheet.getStyle(Label.class, "bravo"));
    }
View Full Code Here

                classToStyleMap = new HashMap();
                namedStyleMap.put(name, classToStyleMap);
            }
            classToStyleMap.put(componentClass, style);
           
            styleSheet.addStyle(componentClass, name, style);
        }
       
        // Second pass, bind derived styles to base styles where applicable.
        for (int i = 0; i < styleElements.length; ++i) {
            if (styleElements[i].hasAttribute("base-name")) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.