Package com.volantis.mcs.protocols

Examples of com.volantis.mcs.protocols.PaneAttributes


        context.setDevice(INTERNAL_DEVICE_FACTORY.createInternalDevice(
            new DefaultDevice(DEVICE_NAME, new HashMap(), null)));
        DOMOutputBuffer buffer = new DOMOutputBuffer();
        buffer.initialise();

        PaneAttributes paneAttrs = new PaneAttributes();
        paneAttrs.setStyles(StylesBuilder.getDeprecatedStyles());
//        paneAttrs.setBorderWidth("5");
        paneAttrs.setPane(pane);

        protocol.openPane(buffer, paneAttrs);

        buffer.closeElement("td");
        buffer.closeElement("tr");
View Full Code Here


        final String cssValues = "background-color: #ff00ff; " +
                "border-width: 5px; " +
                "border-spacing: 7px";

        PaneAttributes attributes = new PaneAttributes();
        attributes.setStyles(StylesBuilder.getStyles(cssValues));
//        attributes.setBackgroundColour("#ff00ff");
//        attributes.setBorderWidth("5");
//        attributes.setCellPadding("6");
//        attributes.setCellSpacing("7");
        attributes.setPane(pane);

        protocol.openPane(buffer, attributes);
        try {
            el = buffer.closeElement("td");
        } catch (IllegalStateException ise) {
View Full Code Here

        containerCell.setAttribute("valign", "top");

        Pane pane1 = new Pane(null);
        pane1.setName(PANE_NAME);

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

//        context.setStyleClassName(CLASS_NAME);
        protocol.setMarinerPageContext(context);
        protocol.openPane(dom, attributes);
View Full Code Here

        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;
        // @todo 2005060816 annotate child with style information if it's not inherited from the parent
        body = dom.openStyledElement("body", attributes);
        dom.openElement("table");
View Full Code Here

        final String cssValues = "background-color: #ff00ff; " +
                        "border-width: 5px; " +
                        "border-spacing: 7px";

        PaneAttributes attributes = new PaneAttributes();
        attributes.setStyles(StylesBuilder.getStyles(cssValues));
        attributes.setPane(pane);

        protocol.openPane(buffer, attributes);
        try {
            el = buffer.closeElement("td");
        } catch (IllegalStateException ise) {
View Full Code Here

        dom.openElement("td");

        Pane pane1 = new Pane(null);
        pane1.setName(PANE_NAME);
        PaneAttributes attributes = new PaneAttributes();
        attributes.setStyles(StylesBuilder.getStyles(
                "background-color: #ff0000; border-width: 5px"));
        attributes.setPane(pane1);
        // Setting the border width to 5 will render the pane as a table
        // because the pane has no style class.

        protocol.setMarinerPageContext(context);
        protocol.openPane(dom, attributes);
View Full Code Here

     * 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

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

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

        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

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.