Examples of PaneAttributes


Examples of com.volantis.mcs.protocols.PaneAttributes

     * This exercises the checkPaneTableAttributes method when the pane has no
     * style class.
     */
    public void notestCheckPaneTableAttributesWithNoStyleClass()
            throws Throwable {
        PaneAttributes paneAttributes = new PaneAttributes();
        paneAttributes.setStyles(StylesBuilder.getDeprecatedStyles());
        // A border width requires a table.
//        paneAttributes.setBorderWidth("50");
        assertTrue("Table should be required for border width and " +
                "no style class",
                isTableRequired(null, paneAttributes));

        paneAttributes = new PaneAttributes();
        paneAttributes.setStyles(StylesBuilder.getDeprecatedStyles());
        // Cell padding requires a table.
//        paneAttributes.setCellPadding("50");
        assertTrue("Table should be required for cell padding and " +
                "no style class",
                isTableRequired(null, paneAttributes));

        paneAttributes = new PaneAttributes();
        paneAttributes.setStyles(StylesBuilder.getDeprecatedStyles());
        // Cell spacing requires a table.
//        paneAttributes.setCellSpacing("50");
        assertTrue("Table should be required for cell spacing and " +
                "no style class",
                isTableRequired(null, paneAttributes));
View Full Code Here

Examples of com.volantis.mcs.protocols.PaneAttributes

    /**
     * This exercises the checkPaneTableAttributes method when the pane has a
     * style class.
     */
    public void notestCheckPaneTableAttributesWithStyleClass() throws Throwable {
        PaneAttributes paneAttributes = new PaneAttributes();
        paneAttributes.setStyles(StylesBuilder.getDeprecatedStyles());
        // A border width requires a table if there is a style class and the
        // protocol supports style sheets.
//        paneAttributes.setBorderWidth("50");

        assertTrue("Table should be required for border width",
                   isTableRequired("fred", paneAttributes));

        // A cell padding requires a table if there is a style class and the
        // protocol supports style sheets.
        paneAttributes = new PaneAttributes();
        paneAttributes.setStyles(StylesBuilder.getDeprecatedStyles());
//        paneAttributes.setCellPadding("50");

        assertTrue("Table should be required for cell padding",
                   isTableRequired("fred", paneAttributes));

        // A cell spacing requires a table if there is a style class and the
        // protocol supports style sheets.
        paneAttributes = new PaneAttributes();
        paneAttributes.setStyles(StylesBuilder.getDeprecatedStyles());
//        paneAttributes.setCellSpacing("50");

        assertTrue("Table should be required for cell spacing",
                   isTableRequired("fred", paneAttributes));
    }
View Full Code Here

Examples of com.volantis.mcs.protocols.PaneAttributes

    /**
     * This exercises the checkPaneTableAttributes method when the pane has no
     * style class, and a width value is set.
     */
    public void notestCheckPaneTableAttributeWidth() throws Throwable {
        PaneAttributes paneAttributes = new PaneAttributes();
        paneAttributes.setStyles(StylesBuilder.getDeprecatedStyles());
        // A table is not required if none of the appropriate attributes are
        // set.
        assertFalse("Table should not be required when there are no " +
                "attributes set",
                isTableRequired(null, paneAttributes));

        paneAttributes = new PaneAttributes();
        paneAttributes.setStyles(StylesBuilder.getDeprecatedStyles());
        // A 100% width requires no table.
//        paneAttributes.setWidth("100");
//        paneAttributes.setWidthUnits(PaneAttributes.WIDTH_UNITS_VALUE_PERCENT);
        assertFalse("Table should not be required for 100% width",
                isTableRequired(null, paneAttributes));

        paneAttributes = new PaneAttributes();
        paneAttributes.setStyles(StylesBuilder.getDeprecatedStyles());
        // A 0 width requires no table.
//        paneAttributes.setWidth("0");
//        paneAttributes.setWidthUnits(PaneAttributes.WIDTH_UNITS_VALUE_PERCENT);
        assertFalse("Table should not be required for 0% width",
                isTableRequired(null, paneAttributes));

        paneAttributes = new PaneAttributes();
        paneAttributes.setStyles(StylesBuilder.getDeprecatedStyles());
        // A null width requires no table.
//        paneAttributes.setWidth(null);
        assertFalse("Table should not be required for null width",
                isTableRequired(null, paneAttributes));

        paneAttributes = new PaneAttributes();
        paneAttributes.setStyles(StylesBuilder.getDeprecatedStyles());
        // A width requires a table if there is no stylesheet.
//        paneAttributes.setWidth("55");
//        paneAttributes.setWidthUnits(PaneAttributes.WIDTH_UNITS_VALUE_PIXELS);
        assertTrue("Table should be required for 55 pixels width",
                isTableRequired(null, paneAttributes));
View Full Code Here

Examples of com.volantis.mcs.protocols.PaneAttributes

        buffer.initialise();

        Element el = null;

        Pane pane = null;
        PaneAttributes attributes = null;

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

        protocol.openPane(buffer, attributes);

        // We expect absolutely no markup to be rendered for a pane that has
        // no attributes and no styling
        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);
        pane.setName(PANE_NAME);

        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);

        el = buffer.closeElement("div");
//        assertEquals("Invalid class attribute on div",
View Full Code Here

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

Examples of com.volantis.mcs.protocols.PaneAttributes

    }

    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

Examples of com.volantis.mcs.protocols.PaneAttributes

    /**
     * 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

Examples of com.volantis.mcs.protocols.PaneAttributes

    /**
     * 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

Examples of com.volantis.mcs.protocols.PaneAttributes

    /**
     * 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

Examples of com.volantis.mcs.protocols.PaneAttributes

    /**
     * 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
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.