Package com.volantis.styling.values

Examples of com.volantis.styling.values.MutablePropertyValues


     * @param attributes the attributes containing styles to check.
     * @return true if display:block, false otherwise.
     */
    private boolean isDisplayBlock(MCSAttributes attributes) {
        boolean block = false;
        final MutablePropertyValues propertyValues =
                attributes.getStyles().getPropertyValues();
        if (propertyValues.getComputedValue(StylePropertyDetails.DISPLAY)
                == DisplayKeywords.BLOCK) {
            block = true;
        }
        return block;
    }
View Full Code Here


            // display:block by surrounding it with a block element. We need to
            // do this because it is the only way that having a caption makes
            // sense.
            writeOpenContainerElement(displayBlockAttributes);

            final MutablePropertyValues propertyValues =
                    attributes.getStyles().getPropertyValues();
            StyleValue captionSide = propertyValues.getComputedValue(
                    StylePropertyDetails.CAPTION_SIDE);
            if (captionSide instanceof StyleKeyword) {
                final OutputBuffer buffer =
                        context.getCurrentOutputBuffer();
                if (captionSide == CaptionSideKeywords.TOP) {
View Full Code Here

        if (isElementToBeStyled(element)) {

            Styles styles = element.getStyles();

            if (styles != null) {
                MutablePropertyValues propertyValues =
                        styles.getPropertyValues();
                if (propertyValues != null) {
                    propertiesRenderer.applyProperties(element, propertyValues);
                }
            }
View Full Code Here

        }
    }

    private void transformStyles(Styles styles, StyleValues parentValues) {

        MutablePropertyValues inputValues = styles.findPropertyValues();
        StyleValue value = inputValues.getStyleValue(TEXT_ALIGN);
        if (value == TextAlignKeywords._INTERNAL_DEFERRED_INHERIT) {
            // Inherit the value from the parent.
            StyleValue parent = parentValues.getStyleValue(TEXT_ALIGN);
            inputValues.setComputedValue(TEXT_ALIGN, parent);
            inputValues.markAsUnspecified(TEXT_ALIGN);
        }

        // Process nested styles.
        styles.iterate(this);
    }
View Full Code Here

        // According to the CSS specification a width value of auto is treated
        // as 100% on block elements. Unfortunately, for backwards
        // compatibility reasons layouts can generate widths of 100% so convert
        // them back to auto so that they do not appear in the output.
        Styles styles = container.getStyles();
        MutablePropertyValues propertyValues = styles.getPropertyValues();
        StyleValue value = propertyValues.getStyleValue(StylePropertyDetails.WIDTH);
        if (value.equals(HUNDRED_PERCENT)) {
            propertyValues.setComputedValue(StylePropertyDetails.WIDTH,
                    WidthKeywords.AUTO);
        }
        dom.openStyledElement(name, styles);
    }
View Full Code Here

            // no custom content is set
            // the browser's inbuilt list renderer can be used.
            markerProcessor = new DefaultMarkerProcessor();
        } else {
            Styles styles = element.getStyles();
            MutablePropertyValues propertyValues = styles.getPropertyValues();
            StyleValue listStylePosition =
                    propertyValues.getComputedValue(
                            StylePropertyDetails.LIST_STYLE_POSITION);

            if (listStylePosition == ListStylePositionKeywords.OUTSIDE) {
                // table-based emulation deals with the outside position
                markerProcessor = new TableMarkerProcessor();
View Full Code Here

            Styles styles = element.getStyles();
            if (styles != null) {
                Styles markerStyles =
                        styles.findNestedStyles(PseudoElements.MARKER);
                if (markerStyles != null) {
                    MutablePropertyValues propValues =
                            markerStyles.getPropertyValues();
                    StyleValue content =
                            propValues.getComputedValue(
                                    StylePropertyDetails.CONTENT);
                    markerContentFound =
                            content != ContentKeywords.NORMAL &&
                                    content != ContentKeywords.NONE;
                }
View Full Code Here

     * @param element
     * @return a String value - not null.
     */
    private String evaluateExpression(Element element) {

        final MutablePropertyValues propertyValues = element.getStyles().
                getPropertyValues();

        StyleProperty styleProperty = findStyleProperty(propertyValues);

        if (styleProperty != null) {
            StyleValue styleValue = propertyValues.getComputedValue(styleProperty);
            if (styleValue != null) {
                return styleValue.getStandardCSS();
            }
        }

View Full Code Here

    // javadoc inherited
    public Element createElement(Element element, Styles styles) {

        Element e = getElement(element, styles);
        MutablePropertyValues propValues = styles.getPropertyValues();
        StyleValue content =
                propValues.getComputedValue(StylePropertyDetails.CONTENT);

        if (content != ContentKeywords.NORMAL &&
                content != ContentKeywords.NONE) {
            Inserter inserter = domProtocol.getInserter();
            inserter.insert(e, content);

            // Clear the content property as we have already dealt with it.
            propValues.clearPropertyValue(StylePropertyDetails.CONTENT);
        }

        return e;
    }
View Full Code Here

     * @param element the parent element.
     * @param styles  the pseudo element styles.
     * @return the element that effects the pseudo element.
     */
    private Element getElement(Element element, Styles styles) {
        MutablePropertyValues propValues = styles.getPropertyValues();
        Element e = element.getDOMFactory().createElement();
        e.setStyles(styles);

        // Get the computed value, as the properties are from a pseudo element
        // it will not be fully populated so use the defaults if not set.
        StyleValue display = propValues
                .getComputedValue(StylePropertyDetails.DISPLAY);
        if (display == null) {
            display = StylePropertyDetails.DISPLAY.getStandardDetails()
                    .getInitialValue();
        } else {
            // Clear the property value.
            propValues.clearPropertyValue(StylePropertyDetails.DISPLAY);
        }

        String name = (String) DISPLAY_MAP.get(display);
        if (name == null) {
            // displayValue may be a CSS-valid value but only
View Full Code Here

TOP

Related Classes of com.volantis.styling.values.MutablePropertyValues

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.