Package com.volantis.mcs.protocols

Examples of com.volantis.mcs.protocols.DOMOutputBuffer


     */
    private DOMOutputBuffer setupForPaneTests(PaneRendering rendering,
                                              PaneAttributes attributes) {
        context = new TestMarinerPageContext();

        DOMOutputBuffer dom = new DOMOutputBuffer();
        TestDeviceLayoutContext deviceLayoutContext = new TestDeviceLayoutContext();

        // Intialize the dom
        dom.initialise();

        // Intialize the context.
        context.pushDeviceLayoutContext(deviceLayoutContext);

        // Intialize the protocol
View Full Code Here


    }

    // javadoc inherited.
    public void testClosePane() throws Exception {
        PaneAttributes attributes = new PaneAttributes();
        DOMOutputBuffer dom = setupForPaneTests(PaneRendering.USE_TABLE,
                                                attributes);

        final Element expected;
        // @todo 2005060816 annotate child with style information if it's not inherited from the parent
        dom.openStyledElement("body", attributes);
        expected = dom.openElement("div");

        protocol.closePane(dom, attributes);

        assertSame("The DOM's current element isn't the body element",
                   dom.getCurrentElement(),
                   expected);
    }
View Full Code Here

     * Test closing a pane where a div has been used to surround the pane's
     * content.
     */
    public void testClosePaneUseDiv() throws Exception {
        PaneAttributes attributes = new PaneAttributes();
        DOMOutputBuffer dom = setupForPaneTests(
                PaneRendering.CREATE_ENCLOSING_ELEMENT, attributes);


        // This does not effect the outcome of the test.
//        context.setStyleClassName(PANE_CLASS);

        final Element expected;
        // @todo 2005060816 annotate child with style information if it's not inherited from the parent
        expected = dom.openStyledElement("body", attributes);
        dom.openElement("div");
        dom.appendEncoded("Example");

        protocol.closePane(dom, attributes);

        assertSame("The DOM's current element isn't the body element",
                   dom.getCurrentElement(),
                   expected);
    }
View Full Code Here

     * Test closing a pane where the surrounding td has been used as the
     * pane's content container.
     */
    public void testClosePaneUseCell() throws Exception {
        PaneAttributes attributes = new PaneAttributes();
        DOMOutputBuffer dom = setupForPaneTests(
                PaneRendering.USE_ENCLOSING_TABLE_CELL, attributes);

        final Element expected;
        expected = dom.openStyledElement("td", attributes);

        dom.appendEncoded("Example");

        protocol.closePane(dom, attributes);

        assertSame("The DOM's current element isn't the td element",
                   dom.getCurrentElement(),
                   expected);
    }
View Full Code Here

     *
     * @throws Exception
     */
    public void testClosePaneDoNothing() throws Exception {
        PaneAttributes attributes = new PaneAttributes();
        DOMOutputBuffer dom = setupForPaneTests(
                PaneRendering.DO_NOTHING, attributes);

        final Element expected;
        expected = dom.openStyledElement("body", attributes);
        dom.appendEncoded("Example");

        protocol.closePane(dom, attributes);

        assertSame("The DOM's current element isn't the body element",
                   dom.getCurrentElement(),
                   expected);
    }
View Full Code Here

    }

    public boolean open(OutputBuffer buffer, MenuItem item)
        throws RendererException {

        DOMOutputBuffer outputBuffer = (DOMOutputBuffer) buffer;

        Element element = outputBuffer.openElement("span");

        ElementDetails elementDetails = item.getElementDetails();
        Styles styles = elementDetails.getStyles();
        if (styles != null) {
            element.setStyles(styles);
View Full Code Here

    }

    public void close(OutputBuffer buffer, MenuItem item)
        throws RendererException {

        DOMOutputBuffer outputBuffer = (DOMOutputBuffer) buffer;

        outputBuffer.closeElement("span");
    }
View Full Code Here

   
    // javadoc inherited from super class
    protected void setUp() throws Exception {
        super.setUp();

        outputBuffer = new DOMOutputBuffer();

        bufferFactory = new OutputBufferFactory() {
            public OutputBuffer createOutputBuffer() {
               return outputBuffer;
            }
View Full Code Here

    }

    protected DOMOutputBuffer getCurrentBuffer(
            ContainerInstance containerInstance) {

        DOMOutputBuffer buffer = (DOMOutputBuffer)
                containerInstanceBufferMap.get(containerInstance);
        return (null != buffer) ? buffer :
                super.getCurrentBuffer(containerInstance);
    }
View Full Code Here

    }

    protected DOMOutputBuffer getCurrentBuffer (
            ContainerInstance containerInstance) {

        DOMOutputBuffer buffer = (DOMOutputBuffer)
                containerInstanceBufferMap.get(containerInstance);
        return (null != buffer) ? buffer : super.getCurrentBuffer(containerInstance);
    }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.protocols.DOMOutputBuffer

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.