Package com.volantis.mcs.protocols

Examples of com.volantis.mcs.protocols.PaneAttributes


        TestDeviceLayoutContext deviceContext = new TestDeviceLayoutContext();
        context.pushDeviceLayoutContext(deviceContext);

        DOMOutputBuffer dom = new DOMOutputBuffer();
        dom.initialise();
        PaneAttributes attributes = new PaneAttributes();
        Pane pane = new Pane(null);
        attributes.setPane(pane);

        Element body;
        body = dom.openStyledElement("body", attributes);

        dom.appendEncoded("Example");
View Full Code Here


    }

    protected void doAddPaneTableAttributesTest(
            final String expectedUnstyledAttributes,
            final String expectedStyledAttributes) throws Exception {
        doAddPaneAttributesTest(new PaneAttributes(), new InvokeElementAttributesMethod() {
            public void invoke(Element element, MCSAttributes attributes) {
                protocol.addPaneTableAttributes(
                        element, (PaneAttributes) attributes);
            }
        }, "PANE", "", false,
View Full Code Here

    /**
     * Test the method: createEnclosingElement.
     */
    public void testCreateEnclosingElement() throws Exception {
        PaneAttributes attributes = new PaneAttributes();
        attributes.setStyles(StylesBuilder.getStyles(
                "vertical-align: middle"));

//        doTestCreateEnclosingElement(attributes,
//                                     "<td>" +
//                                        "<table cellspacing=\"0\">" +
//                                     "<tr>" +
//                                     "<td valign=\"middle\">" +
//                                     "<div/>" +
//                                     "</td>" +
//                                     "</tr>" +
//                                     "</table>" +
//                                     "</td>");

        Pane pane = new Pane(new CanvasLayout());
        attributes.setPane(pane);

        // todo add in a test to make sure that the protocol is using the correct border handler for a netscape device.
        // Intialize the context.
        //context = new TestMarinerPageContext();
        //context.pushDeviceLayoutContext(new TestDeviceLayoutContext());
View Full Code Here

    /**
     * Test the method: createEnclosingElement
     */
    public void testUseEnclosingTableCell() throws Exception {
        PaneAttributes attributes = new PaneAttributes();
        attributes.setStyles(StylesBuilder.getDeprecatedStyles());

        doTestUseEnclosingTableCell(attributes, "<td/>");

        // Set some styles on the element.
        attributes.setStyles(StylesBuilder.getStyles("background-color: red"));
        doTestUseEnclosingTableCell(attributes,
                                    getExpectedEnclosingTableCellMarkup());
    }
View Full Code Here

    /**
     * Test the method: checkPaneRendering.
     */
    public void testCheckPaneRendering() throws Exception {
        Pane pane = new Pane(null);
        PaneAttributes attributes = new PaneAttributes();
        attributes.setStyles(StylesBuilder.getDeprecatedStyles());
        attributes.setPane(pane);

        doTestCheckPaneRendering("not-td", attributes,
                                 PaneRendering.DO_NOTHING);

        doTestCheckPaneRendering("td", attributes,
                                 PaneRendering.DO_NOTHING);

//        attributes.setCellSpacing("10");
        attributes.setStyles(StylesBuilder.getStyles("border-width: 2px"));
        doTestCheckPaneRendering("td", attributes,
                                 PaneRendering.USE_TABLE);

        // Other permutations tested by testCheckPaneCellAttributes and
        // existing test cases (testCheckPaneTableAttributesXXXX)
View Full Code Here

    /**
     * Test the method: checkpaneCellAttributes.
     */
    public void notestCheckPaneCellAttributes() throws Exception {
        Pane pane = new Pane(null);
        PaneAttributes attributes = new PaneAttributes();
        TestDOMOutputBuffer dom = new TestDOMOutputBuffer();

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

        attributes.setPane(pane);
       
        // No width set, return DO_NOTHING.
        PaneRendering result;
        result = protocol.checkPaneCellAttributes(element, attributes);
        assertEquals("Expected ",
View Full Code Here

        buffer.initialise();

        Pane pane = new Pane(canvasLayout);
        pane.setName(PANE_NAME);

        PaneAttributes paneAttributes = new PaneAttributes();
        paneAttributes.setStyles(StylesBuilder.getDeprecatedStyles());
        paneAttributes.setPane(pane);

        protocol.openPaneTable(buffer, paneAttributes);
        Element elem = buffer.getCurrentElement();

        System.out.println("Open Pane Table: " + DOMUtilities.toString(elem));
View Full Code Here

        DOMOutputBuffer buffer = new DOMOutputBuffer();
        buffer.initialise();

        Pane pane = new Pane(canvasLayout);
        pane.setName(PANE_NAME);
        PaneAttributes paneAttributes = new PaneAttributes();
        Styles paneStyles = StylesBuilder.getSparseStyles("padding: 10px");
        paneAttributes.setStyles(paneStyles);
        paneAttributes.setPane(pane);

        protocol.openPaneTable(buffer, paneAttributes);
        Element tableElement = (Element) buffer.getRoot().getHead();
        assertTrue("Root element should be a table", "table".equals(tableElement.getName()));
        String cellPadding = tableElement.getAttributeValue("cellpadding");
View Full Code Here

        buffer.initialise();

        Element el = null;

        Pane pane = null;
        PaneAttributes attributes = null;

        //=============================================================
        // Styles defined = No
        //=============================================================
        pane = new Pane(null);
        attributes = new PaneAttributes();
        attributes.setStyles(StylesBuilder.getDeprecatedStyles());
        attributes.setPane(pane);

        protocol.openPane(buffer, attributes);

        assertSame("The buffer current element should be the root element " +
                   "but was" + buffer.getCurrentElement(),
                   buffer.getRoot(),
                   buffer.getCurrentElement());

        //=============================================================
        // Styles defined = Yes
        //@todo XDIME-CP pass in Styles and check they're correctly propagated through
        //=============================================================
        pane = new Pane(null);

        attributes = new PaneAttributes();
        attributes.setStyles(StylesBuilder.getDeprecatedStyles());
//        attributes.setStyleClass("fred");
//        attributes.setBackgroundColour("#ff0000");
//        attributes.setBorderWidth("1");
//        attributes.setCellPadding("2");
//        attributes.setCellSpacing("3");
        attributes.setPane(pane);

        protocol.openPane(buffer, attributes);
        try {
            // A div will have been opened to render styles because:
            // 1. This protocol supports stylesheets.
View Full Code Here

        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);
View Full Code Here

TOP

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

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.