Examples of Styles


Examples of com.volantis.styling.Styles

        privateSetUp();

        TableAttributes tableAttributes = new TableAttributes();
        tableAttributes.setStyles(StylesBuilder.getInitialValueStyles());
        CaptionAttributes captionAttributes = new CaptionAttributes();
        Styles captionStyles = StylesBuilder.getInitialValueStyles();
        captionStyles.getPropertyValues().setComputedValue(
                StylePropertyDetails.CAPTION_SIDE, captionSide);
        captionAttributes.setStyles(captionStyles);

        // Write an empty table with a caption
        protocol.openTable(buffer, tableAttributes);
View Full Code Here

Examples of com.volantis.styling.Styles

        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");
        assertNotNull("Table should have cell padding attribute set", cellPadding);
        assertEquals("Cell padding should be 10 pixels", "10", cellPadding);

        Styles tableStyles = tableElement.getStyles();
        assertNull("Table should have no padding (bottom)",
                tableStyles.getPropertyValues().
                getSpecifiedValue(StylePropertyDetails.PADDING_BOTTOM));
        assertNull("Table should have no padding (top)",
                tableStyles.getPropertyValues().
                getSpecifiedValue(StylePropertyDetails.PADDING_TOP));
        assertNull("Table should have no padding (left)",
                tableStyles.getPropertyValues().
                getSpecifiedValue(StylePropertyDetails.PADDING_LEFT));
        assertNull("Table should have no padding (right)",
                tableStyles.getPropertyValues().
                getSpecifiedValue(StylePropertyDetails.PADDING_RIGHT));

        // We test for the computed values being null - the current
        // implementation sets them to null. In theory having the default value
        // for the computed value here should be acceptable.
        assertNull("Table should have no padding (bottom)",
                tableStyles.getPropertyValues().
                getComputedValue(StylePropertyDetails.PADDING_BOTTOM));
        assertNull("Table should have no padding (top)",
                tableStyles.getPropertyValues().
                getComputedValue(StylePropertyDetails.PADDING_TOP));
        assertNull("Table should have no padding (left)",
                tableStyles.getPropertyValues().
                getComputedValue(StylePropertyDetails.PADDING_LEFT));
        assertNull("Table should have no padding (right)",
                tableStyles.getPropertyValues().
                getComputedValue(StylePropertyDetails.PADDING_RIGHT));

        Element rowElement = (Element) tableElement.getHead();
        Element cellElement = (Element) rowElement.getHead();

        Styles cellStyles = cellElement.getStyles();
        StyleValue expectedPadding = StyleValueFactory.getDefaultInstance().
            getLength(null, 10, LengthUnit.PX);
        // Check the computed values for the table cell (since these are the
        // values that will be displayed
        assertEquals("Cell should have 10px padding (bottom)", expectedPadding,
                cellStyles.getPropertyValues().
                getComputedValue(StylePropertyDetails.PADDING_BOTTOM));
        assertEquals("Cell should have 10px padding (top)", expectedPadding,
                cellStyles.getPropertyValues().
                getComputedValue(StylePropertyDetails.PADDING_TOP));
        assertEquals("Cell should have 10px padding (left)", expectedPadding,
                cellStyles.getPropertyValues().
                getComputedValue(StylePropertyDetails.PADDING_LEFT));
        assertEquals("Cell should have 10px padding (right)", expectedPadding,
                cellStyles.getPropertyValues().
                getComputedValue(StylePropertyDetails.PADDING_RIGHT));
    }
View Full Code Here

Examples of com.volantis.styling.Styles

        // =====================================================================
        //   Test Expectations
        // =====================================================================

        Styles styles = new StylesImpl();

        Styles nestedStyles = styles.getNestedStyles(pseudoStyleEntityMock);
        MutablePropertyValues nestedValues = nestedStyles.getPropertyValues();
        assertNotNull("Nested styles", nestedStyles);
        assertNotNull("Nested values", nestedValues);

        Styles foundStyles = styles.findNestedStyles(pseudoStyleEntityMock);
        MutablePropertyValues foundValues = foundStyles.getPropertyValues();
        assertSame("Found and got styles", nestedStyles, foundStyles);
        assertSame("Found and got values", nestedValues, foundValues);
    }
View Full Code Here

Examples of com.volantis.styling.Styles

        return engine;
    }

    private StyleValue getContainerValue(
            StylingEngine engine, final StyleProperty property) {
        Styles styles = engine.getStyles();
        MutablePropertyValues propertyValues = styles.getPropertyValues();
        return propertyValues.getComputedValue(
                property);
    }
View Full Code Here

Examples of com.volantis.styling.Styles

        renderer.open(buffer, item);

        AnchorAttributes attributes = (AnchorAttributes)PrivateAccessor.
                getField(renderer, "attributes");
        assertNotNull("MCS Attributes should not be null", attributes);
        Styles styles = attributes.getStyles();

        assertNotNull("The Styles on the MCS Attributes must not be null",
                styles);
        assertEquals("The styles on the MCS Attributes must be the same " +
                "as the styles on the ElementDetails",
View Full Code Here

Examples of com.volantis.styling.Styles

        throws RendererException {

        MenuLabel label = item.getLabel();
        MenuIcon icon = label.getIcon();
        ElementDetails elementDetails = icon.getElementDetails();
        Styles styles = null;
        if (elementDetails != null) {
            styles = elementDetails.getStyles();
        }

        DOMOutputBuffer outputBuffer = (DOMOutputBuffer) buffer;
View Full Code Here

Examples of com.volantis.styling.Styles

        // Build a very simple menu with a single item which contains a label
        // with some text and an icon.
        MenuModelBuilder builder = new ConcreteMenuModelBuilder();
        builder.startMenu();

        Styles menuStyles = StylesBuilder.getCompleteStyles(
                (imageStyle == null ? "" :
                "mcs-menu-image-style: " + imageStyle + "; ") +
                (textStyle == null ? "" :
                "mcs-menu-text-style: " + textStyle + "; ") +
                (orderStyle == null ? "" :
View Full Code Here

Examples of com.volantis.styling.Styles

        } catch (IllegalArgumentException iae) {
            // Test succeeded - the call caused this exception
        }

        // Test setting
        Styles testStyles = StylesBuilder.getEmptyStyles();
        testElementDetails.setStyles(testStyles);

        // Test getting
        Styles gotStyles = testElementDetails.getStyles();
        assertNotNull("Should not be null", gotStyles);
        assertEquals("Should be the same", testStyles, gotStyles);
        assertNotNull("Should not be null", gotStyles.getPropertyValues());
    }
View Full Code Here

Examples of com.volantis.styling.Styles

        ContextInternals.setMarinerPageContext(requestContext, context);

        DOMOutputBuffer dom = new DOMOutputBuffer();
        dom.initialise();
        XFFormAttributes attributes = new XFFormAttributes();
        final Styles styles = StylesBuilder.getInitialValueStyles();
        attributes.setStyles(styles);
        attributes.setFormData(formInstance);
        attributes.setAction(new LiteralLinkAssetReference("testaction"));
        attributes.setMethod("post");
        attributes.setFormSpecifier(formSpecifier);
View Full Code Here

Examples of com.volantis.styling.Styles

                "}" +
                "*:active {" +
                "background-color: #0000ff; " +
                "}"));

        Styles styles = tableCellAttributes.getStyles();

        // we need to override the style with this mock style only for testing
        // the bgimage as the actual addBackgroundImage in the style attempts
        // to perform methods on a null Volantis object.
        WapTV5_WMLVersion1_3Style style =
                new WapTV5_WMLVersion1_3Style(
                        styles.getPropertyValues(), wapProtocol);
        wapProtocol.setStyle(style);
        wapProtocol.setActiveStyle(new WapTV5_WMLVersion1_3Style(
                styles.findNestedStyles(StatefulPseudoClasses.ACTIVE)
                .getPropertyValues(), wapProtocol));
        wapProtocol.setFormatStyle(new WapTV5_WMLVersion1_3Style(
                styles.findNestedStyles(StatefulPseudoClasses.ACTIVE)
                .getPropertyValues(), wapProtocol));

        Element element = domFactory.createElement();
        protocol.addTableCellAttributes(element, tableCellAttributes);
        assertEquals("1", element.getAttributeValue("linegap"));
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.