Package com.volantis.mcs.protocols

Examples of com.volantis.mcs.protocols.DOMOutputBuffer


        i = element.exprElementEnd(requestContext,attributes);
        assertEquals("Wrong code returned by elementEnd",
                PAPIElement.CONTINUE_PROCESSING, i);

        // Language is not handled by XHTMLFull
        DOMOutputBuffer dob = protocol.getCurrentBuffer();
        String str = DOMUtilities.toString(dob.getRoot());
        assertEquals("Incorrect output ",
                "<script charset=\"Ascii\" defer=\"defer\""+
                " type=\"text/javascript\"/>", str );
    }
View Full Code Here


        DOMOutputBuffer outputbuffer;

        MyXHTMLTransitional() {
            super(new DefaultProtocolSupportFactory(),
                    new XHTMLFullConfiguration());
            outputbuffer = new DOMOutputBuffer();
            outputbuffer.initialise();
        }
View Full Code Here

        DOMOutputBuffer outputbuffer;

        MyXHTMLFull() {
            super(new DefaultProtocolSupportFactory(),
                new XHTMLFullConfiguration());
            outputbuffer = new DOMOutputBuffer();
            outputbuffer.initialise();
        }
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

     *                   a menu item
     */
    protected void createMenuItem(MenuModelBuilder builder,
                                  String text,
                                  FormatReference pane) throws Exception{
        DOMOutputBuffer buffer = new TestDOMOutputBuffer();

        buffer.appendEncoded(text);

        builder.startMenuItem();

        builder.setHref(new LiteralLinkAssetReference("href"));

View Full Code Here

     *
     * todo XDIME-CP
     */
    public void notestOpenPaneUseDiv() throws Exception {
        privateSetUp();
        DOMOutputBuffer dom = new DOMOutputBuffer();
        Pane pane = new Pane(null);
        pane.setName(PANE_NAME);

        dom.initialise();

        PaneAttributes attributes = new PaneAttributes();
        attributes.setStyles(StylesBuilder.getStyles(
                "background-color: #ff0000"));
        attributes.setPane(pane);

        context.setFormatInstance(new TestPaneInstance());
        protocol.setMarinerPageContext(context);
        protocol.openPane(dom, attributes);

        Element element = dom.getCurrentElement();
        assertEquals("Element name", "div", element.getName());
    }
View Full Code Here

     * To use the surrounding td cell, there may be stylistic values on the
     * pane, but these must not clash with the cell's own attributes.
     */
    public void testOpenPaneUseCell() throws Exception {
        privateSetUp();
        DOMOutputBuffer dom = new DOMOutputBuffer();
        Pane pane = new Pane(null);
        pane.setName(PANE_NAME);

        dom.initialise();

        PaneAttributes attributes = new PaneAttributes();
        attributes.setStyles(StylesBuilder.getStyles(
                "background-color: #ff0000"));
        attributes.setPane(pane);

        context.setFormatInstance(new TestPaneInstance());
        protocol.setMarinerPageContext(context);
        Element parent = dom.openStyledElement("td", attributes);
        protocol.openPane(dom, attributes);

        Element element = dom.getCurrentElement();
        assertEquals("Element added", parent, element);
    }
View Full Code Here

     * that clash with those of the pane. In this case a div will be output
     * to surround the pane's content.
     */
    public void testOpenPaneCantUseCell() throws Exception {
        privateSetUp();
        DOMOutputBuffer dom = new DOMOutputBuffer();
        Pane pane = new Pane(null);
        pane.setName(PANE_NAME);
        Element parent = null;

        dom.initialise();

        PaneAttributes attributes = new PaneAttributes();
        attributes.setStyles(StylesBuilder.getStyles(
                "background-color: #ff0000"));
        attributes.setPane(pane);

        context.setFormatInstance(new TestPaneInstance());
        protocol.setMarinerPageContext(context);
        parent = dom.openStyledElement("td", attributes);
        parent.setAttribute("id", "parent");
        attributes.setId("child");
        protocol.openPane(dom, attributes);

        Element element = dom.getCurrentElement();
        assertEquals("Element name", "div", element.getName());
    }
View Full Code Here

     * The pane's content doesn't need to be surrounded by anything if there
     * are no stylistic attributes on the pane.
     */
    public void notestOpenPaneDoNothing() throws Exception {
        privateSetUp();
        DOMOutputBuffer dom = new DOMOutputBuffer();
        Pane pane = new Pane(null);
        pane.setName(PANE_NAME);
        PaneAttributes attributes = new PaneAttributes();
        Element parent = null;
        Element element = null;

        dom.initialise();

        attributes.setPane(pane);
        pane.setBackgroundColour(null);
        pane.setBorderWidth(null);
        pane.setCellPadding(null);
        pane.setCellSpacing(null);
        pane.setHeight(null);
        pane.setWidth(null);
        pane.setHorizontalAlignment(null);
        pane.setVerticalAlignment(null);

        context.setFormatInstance(new TestPaneInstance());
        protocol.setMarinerPageContext(context);

        // Make the test framework behave as if no style class is required!
//        context.setStyleClassName(null);
        testable.setPageHead(new PageHead());

        parent = dom.openStyledElement("body", attributes);
        protocol.openPane(dom, attributes);

        try {
            element = dom.closeElement("body");
        } catch (IllegalStateException e) {
            fail("Expected body element not found");
        }

        assertSame("The parent was not as expected",
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.