Package com.volantis.styling.values

Examples of com.volantis.styling.values.MutablePropertyValues


        String actual = DOMUtilities.toString(dom.getRoot());
        assertEquals("Result shouild match\n" +
                     "EXPECTED: " + expected + "\n" +
                     "ACTUAL  : " + actual + "\n", expected, actual);
        final MutablePropertyValues attributePropertyValues =
            attributes.getStyles().getPropertyValues();
        final MutablePropertyValues elementPropertyValues =
            element.getStyles().getPropertyValues();
        final StylePropertyDefinitions stylePropertyDefinitions =
            attributePropertyValues.getStylePropertyDefinitions();
        final int count = stylePropertyDefinitions.count();
        for (int i = 0; i < count; i++) {
            final StyleProperty styleProperty =
                stylePropertyDefinitions.getStyleProperty(i);
            if (styleProperty.equals(StylePropertyDetails.DISPLAY)) {
                assertEquals(DisplayKeywords.TABLE_CELL,
                    elementPropertyValues.getComputedValue(styleProperty));
                assertEquals(DisplayKeywords.TABLE_CELL,
                    elementPropertyValues.getSpecifiedValue(styleProperty));
            } else {
                assertEquals(attributePropertyValues.getComputedValue(styleProperty),
                    elementPropertyValues.getComputedValue(styleProperty));
                assertEquals(attributePropertyValues.getSpecifiedValue(styleProperty),
                    elementPropertyValues.getSpecifiedValue(styleProperty));
            }
        }
    }
View Full Code Here


        // =====================================================================

        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

    }

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


        StyleValue width = StyleValueFactory.getDefaultInstance()
                .getLength(null, 15, LengthUnit.PX);

        MutablePropertyValues propertyValues = createPropertyValues();
        propertyValues.setComputedValue(StylePropertyDetails.BORDER_LEFT_WIDTH,
                width);

        propertiesRenderer.applyProperties(tdElement, propertyValues);

        assertEquals("Buffer should match",
View Full Code Here

        Element tdElement = createElement("td");

        StyleValue width = StyleValueFactory.getDefaultInstance()
                .getLength(null, 15, LengthUnit.PX);

        MutablePropertyValues propertyValues = createPropertyValues();
        propertyValues.setComputedValue(
                StylePropertyDetails.BORDER_RIGHT_WIDTH,
                width);
        propertyValues.setComputedValue(StylePropertyDetails.BORDER_LEFT_WIDTH,
                width);


        propertiesRenderer.applyProperties(tdElement, propertyValues);
View Full Code Here

        return getCompleteStyles(css, false);
            }

    public static Styles getCompleteStyles(String css, boolean specified) {
        Styles styles = getStyles(css, specified);
        final MutablePropertyValues propertyValues = styles.getPropertyValues();
        StylePropertyDetails.getDefinitions().iterateStyleProperties(new StylePropertyIteratee() {
            public IterationAction next(StyleProperty property) {
                StyleValue value = propertyValues.getComputedValue(property);
                if (value == null) {
                    propertyValues.setComputedValue(property,
                            property.getStandardDetails().getInitialValue());
                }
                return IterationAction.CONTINUE;
        }
        });
View Full Code Here

    private static void setComputedValuesFromProperties(
            final Styles styles,
            final StyleProperties properties, final boolean specified) {

        final MutablePropertyValues values =
                styles.getPropertyValues();
        if (properties != null) {
            values.iterateStyleProperties(new StylePropertyIteratee() {
                public IterationAction next(StyleProperty property) {
                    StyleValue value = properties.getStyleValue(property);
                    values.setComputedValue(property, value);
                    if (specified) {
                        values.setSpecifiedValue(property, value);
                    }
                    return IterationAction.CONTINUE;
                }
            });
        }
View Full Code Here

        final List options =
                xfSingleSelectElement.getProtocolAttributes().getOptions();
        assertEquals(1, options.size());

        final SelectOption option = (SelectOption) options.get(0);
        final MutablePropertyValues propertyValues =
                option.getCaptionStyles().getPropertyValues();
        assertEquals(FontWeightKeywords.BOLD,
                propertyValues.getComputedValue(StylePropertyDetails.FONT_WEIGHT));
        assertEquals(FontSizeKeywords.LARGE,
                propertyValues.getComputedValue(StylePropertyDetails.FONT_SIZE));
        assertEquals(FontStyleKeywords.ITALIC,
                propertyValues.getComputedValue(StylePropertyDetails.FONT_STYLE));
    }
View Full Code Here

            final StyleValue bottomValue, final StyleValue leftValue,
            final StyleValue rightValue, final StyleValue topValue,
            final PropertyStatus bottomStatus, final PropertyStatus leftStatus,
            final PropertyStatus rightStatus, final PropertyStatus topStatus) {

        MutablePropertyValues inputValues =
                STYLING_FACTORY.createPropertyValues();

        setPropertyValue(inputValues, StylePropertyDetails.BORDER_BOTTOM_WIDTH,
                bottomValue, bottomStatus);
View Full Code Here

            final StyleValue widthValue,
            final PropertyStatus colorStatus,
            final PropertyStatus styleStatus,
            final PropertyStatus widthStatus) {

        MutablePropertyValues inputValues =
                STYLING_FACTORY.createPropertyValues();

        setPropertyValue(inputValues, StylePropertyDetails.BORDER_LEFT_COLOR,
                colorValue, colorStatus);
        setPropertyValue(inputValues, StylePropertyDetails.BORDER_LEFT_STYLE,
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.