Examples of StyleProperty


Examples of com.volantis.styling.properties.StyleProperty

        if (canEmulateElement(elementName)) {
            // Check if we need to emulate these style properties (i.e. if the
            // css is not supported by the device).
            boolean cssNotSupported = cssVersion == null;
            for (int i = 0; i < properties.length; i++) {
                StyleProperty property = properties[i];
                cssNotSupported = cssNotSupported ||
                        cssVersion.getProperty(property) == null;
                if (cssNotSupported) {
                    ElementOnlyStyleEmulationPropertyRenderer elementRenderer =
                            new ElementOnlyStyleEmulationPropertyRenderer(
View Full Code Here

Examples of com.volantis.styling.properties.StyleProperty

            PropertyValues originalValues = originalStyles.getPropertyValues();
            PropertyValues resultValues = resultStyles.getPropertyValues();
            StylePropertyDefinitions definitions =
                    StylePropertyDetails.getDefinitions();
            for(Iterator i = definitions.stylePropertyIterator(); i.hasNext();) {
                StyleProperty property = (StyleProperty)i.next();
                assertEquals(originalValues.getComputedValue(property),
                        resultValues.getComputedValue(property));
                assertEquals(originalValues.getSpecifiedValue(property),
                        resultValues.getSpecifiedValue(property));
            }
View Full Code Here

Examples of com.volantis.styling.properties.StyleProperty

    }

    private void initialisePropertyKeywords(InternalDevice device,
            DefaultCSSProperty cssProperty) {

        StyleProperty property = cssProperty.getStyleProperty();

        final AllowableKeywords allowableKeywords =
                property.getStandardDetails().getAllowableKeywords();
        if (allowableKeywords != null) {
            List keywords = allowableKeywords.getKeywords();
            for (int i = 0; i < keywords.size(); i++) {
                StyleKeyword keyword = (StyleKeyword) keywords.get(i);

                final String externalName =
                            CSS_NAME_MAPPER.getExternalString(property);
                String externalKeywordName =
                        CSS_NAME_MAPPER.getExternalString(keyword);
                String policy = "x-css.properties." + externalName +
                        ".keyword." + externalKeywordName + ".support";

                String value = getAncestorPolicyValue(device, policy);

                if ("full".equals(value)) {
                    // Add the property definition to the css version.
                    cssProperty.addKeyword(keyword);
                    if (logger.isDebugEnabled()) {
                        logger.debug("Adding device CSS property '" +
                                property.getName() + "' keyword '" +
                                keyword.getName() + "'");
                    }
                } else if ("none".equals(value)) {
                    // Remove the property definiton from the css version.
                    cssProperty.removeKeyword(keyword);
                    if (logger.isDebugEnabled()) {
                        logger.debug("Removing device CSS property '" +
                                property.getName() + "' keyword '" +
                                keyword.getName() + "'");
                    }
                } else if (value == null || "default".equals(value)) {
                    // Leave the original definition.
View Full Code Here

Examples of com.volantis.styling.properties.StyleProperty

                                        Map map,
                                        MutablePropertyValues propertyValues,
                                        Element element) {
        while (stylePropertiesIterator.hasNext()) {
            // Get the current style property
            StyleProperty property =
                    (StyleProperty)stylePropertiesIterator.next();

            // If the style properties collection contains a value for the
            // current property and there is a rule associated then
            // render the emulated style.
View Full Code Here

Examples of com.volantis.styling.properties.StyleProperty

        // The properties that we're interested in are applied to the menu
        final PropertyValues properties =
                menu.getElementDetails().getStyles().getPropertyValues();

        // Now see what separator should be used.
        final StyleProperty ORIENTATION_PROPERTY =
                StylePropertyDetails.MCS_MENU_ORIENTATION;

        StyleValue orientation = properties.getComputedValue(
                ORIENTATION_PROPERTY);
        if (orientation == MCSMenuOrientationKeywords.HORIZONTAL) {
            separator = factory.createHorizontalMenuSeparator(
                    properties.getComputedValue(
                            StylePropertyDetails.MCS_MENU_HORIZONTAL_SEPARATOR));
        } else if (orientation == MCSMenuOrientationKeywords.VERTICAL) {
            separator = factory.createVerticalMenuSeparator();
        } else {
            throw new IllegalStateException("Unknown keyword " +
                                            orientation + " for " +
                                            ORIENTATION_PROPERTY.getName());
        }

        return separator;
    }
View Full Code Here

Examples of com.volantis.styling.properties.StyleProperty

        final PropertyValues properties =
                menu.getElementDetails().getStyles().getPropertyValues();

        // Now see what separator should be used.
        final StyleProperty ORIENTATION_PROPERTY =
                StylePropertyDetails.MCS_MENU_ITEM_ORIENTATION;

        StyleValue orientation = properties.getComputedValue(
                ORIENTATION_PROPERTY);
        if (orientation == MCSMenuItemOrientationKeywords.HORIZONTAL) {
            separator = factory.createHorizontalMenuItemSeparator(
                    properties.getComputedValue(
                            StylePropertyDetails.MCS_MENU_HORIZONTAL_SEPARATOR));
        } else if (orientation == MCSMenuItemOrientationKeywords.VERTICAL) {
            separator = factory.createVerticalMenuItemSeparator();
        } else {
            throw new IllegalStateException("Unknown keyword " +
                                            orientation + " for " +
                                            ORIENTATION_PROPERTY.getName());
        }

        return separator;
    }
View Full Code Here

Examples of com.volantis.styling.properties.StyleProperty

        return compiler.compile(new StringReader(defaultCSS), sourceDescription);
    }

    // Javadoc inherited.
    public IterationAction next(CSSProperty cssProperty) {
        final StyleProperty property = cssProperty.getStyleProperty();

        // Create a details builder that defaults to the standard details.
        PropertyDetailsBuilder builder = new PropertyDetailsBuilder(property);

        String policy = "x-css.properties." + property.getName() +
                    ".initial-value";


        // Get the standard initial value source.
        InitialValueSource initialValueSource =
                property.getStandardDetails().getInitialValueSource();
        InitialValueAccuracy accuracy = InitialValueAccuracy.ASSUMED;

        String value = device.getPolicyValue(policy);

        if (value == null || value.equals("") || value.equals("<default>")) {
View Full Code Here

Examples of com.volantis.styling.properties.StyleProperty

    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

Examples of com.volantis.styling.properties.StyleProperty

    private StyleProperty findStyleProperty(
            final MutablePropertyValues propertyValues) {

        for (Iterator it = propertyValues.stylePropertyIterator();
             it.hasNext();) {
            StyleProperty styleProperty = (StyleProperty) it.next();

            if (cssProperty.equals(styleProperty.getName())) {
                return styleProperty;
            }
        }

        return null;
View Full Code Here

Examples of com.volantis.styling.properties.StyleProperty

        category.setLevel(Level.ALL);

        // Test adding border-spacing to CSS Mobile Profile.
        // This is what XHTMLBasic MIB2.1 and Netfront3 must do.
        final String ssversion = DevicePolicyConstants.CSS_MOBILE_PROFILE1;
        final StyleProperty property = StylePropertyDetails.BORDER_SPACING;
        final String policy = createCssPropertyPolicyName(property);
        DefaultDevice device = createDevice("Master", ssversion, null);

        // Test the default setup, it shouldn't have border-spacing.
        cssConfigurator.initialise(config,
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.