Package com.volantis.mcs.protocols.hr

Examples of com.volantis.mcs.protocols.hr.HorizontalRuleEmulatorWithBorderStylingOnMultipleDivs


<div margin-bottom="5px">

This style of emulation is required as some devices, such as the Samsung Z108, do not support the emulation provided by {@link com.volantis.mcs.protocols.hr.HorizontalRuleEmulatorWithBorderStylingOnDIV}when margins are set to values other than zero. ( The Line created by the border-bottom styling attribute does not render when margins are set to a value other than zero). Hence we need the extra div elements to set the top and bottom margin in order to maintain the rule.


                "border-bottom-width: 1px; "+
                "text-align: center; width: 100%'/>" +
                "<div style='margin-bottom: 2px'/>";

        HorizontalRuleEmulator emulator =
                new HorizontalRuleEmulatorWithBorderStylingOnMultipleDivs();

        /**
         * Test no style applied
         */
        DOMOutputBuffer domOutputBuffer = new DOMOutputBuffer() ;
        emulator.emulateHorizontalRule(domOutputBuffer,
                                            createHorizontalRuleAttributes(null));

        assertEquals("Incorrect Hr Emulation",noStyle_Expected,
                helper.render(domOutputBuffer.getRoot()));

        /**
         * Test width style applied
         */
        domOutputBuffer = new DOMOutputBuffer() ;
        emulator.emulateHorizontalRule(domOutputBuffer,
                                    createHorizontalRuleAttributes("width: 50%"));


        assertEquals("Incorrect Hr Emulation",widthStyle_Expected,
                helper.render(domOutputBuffer.getRoot()));

        /**
         * Test height style applied
         */
        domOutputBuffer = new DOMOutputBuffer() ;
        emulator.emulateHorizontalRule(domOutputBuffer,
                                    createHorizontalRuleAttributes("height: 5px"));


        assertEquals("Incorrect Hr Emulation",heightStyle_Expected,
                helper.render(domOutputBuffer.getRoot()));

        /**
         * Test colour style applied
         */
        domOutputBuffer = new DOMOutputBuffer() ;
        emulator.emulateHorizontalRule(domOutputBuffer,
                                    createHorizontalRuleAttributes("color: red"));


        assertEquals("Incorrect Hr Emulation",colorStyle_Expected,
                helper.render(domOutputBuffer.getRoot()));
View Full Code Here

TOP

Related Classes of com.volantis.mcs.protocols.hr.HorizontalRuleEmulatorWithBorderStylingOnMultipleDivs

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.