Package com.volantis.mcs.themes

Examples of com.volantis.mcs.themes.StyleValueFactory


        if (possibleExpression == null) {
            return null;
        }

        StyleValueFactory factory = StyleValueFactory.getDefaultInstance();


        StyleValue styleValue;
        if (isPAPIQuotedExpression(possibleExpression)) {
            // strip off the PAPI quoted style braces
            final String unquotedExpression = possibleExpression.substring(1,
                    possibleExpression.length() - 1);

            styleValue = factory.getComponentURI(null, unquotedExpression);

        } else if (possibleExpression.startsWith("\\{") &&
                possibleExpression.endsWith("\\}")) {

            // strip off the escape characters, remember that \\ actually
            // is just \ escaped

            String literal = possibleExpression.substring(1,
                    possibleExpression.length() - 2) + "}";
            styleValue = factory.getString(null, literal);

        } else {
            // The String provided is not an PAPI quoted expression
            String literal = possibleExpression;

            styleValue = factory.getString(null, literal);
        }

        return styleValue;
    }
View Full Code Here


                    protocol.getMarinerPageContext()
                            .getStylingEngine().getStyles(),
                    DisplayKeywords.NONE);

        MutablePropertyValues values = styles.getPropertyValues();
        StyleValueFactory svf = StyleValueFactory.getDefaultInstance();
       
        values.setComputedAndSpecifiedValue(
                StylePropertyDetails.POSITION, StyleKeywords.FIXED);
        values.setComputedAndSpecifiedValue(
                StylePropertyDetails.TOP, svf.getLength(null, 0, LengthUnit.PX));
        values.setComputedAndSpecifiedValue(
                StylePropertyDetails.LEFT, svf.getLength(null, 0, LengthUnit.PX));
        values.setComputedAndSpecifiedValue(
                StylePropertyDetails.BACKGROUND_COLOR, StyleColorNames.WHITE);       
       
        Iterator i = Arrays.asList(StyleShorthands.MARGIN.getStandardProperties()).iterator();
        while (i.hasNext()) {
            StyleProperty property = (StyleProperty)i.next();
            values.setComputedAndSpecifiedValue(property, svf.getLength(null, 5, LengthUnit.PX));
        }
        i = Arrays.asList(StyleShorthands.PADDING.getStandardProperties()).iterator();
        while (i.hasNext()) {
            StyleProperty property = (StyleProperty)i.next();
            values.setComputedAndSpecifiedValue(property, svf.getLength(null, 0.5, LengthUnit.EM));
        }
        i = Arrays.asList(StyleShorthands.BORDER_WIDTH.getStandardProperties()).iterator();
        while (i.hasNext()) {
            StyleProperty property = (StyleProperty)i.next();
            values.setComputedAndSpecifiedValue(property, svf.getLength(null, 1, LengthUnit.PX));
        }
        i = Arrays.asList(StyleShorthands.BORDER_STYLE.getStandardProperties()).iterator();
        while (i.hasNext()) {
            StyleProperty property = (StyleProperty)i.next();
            values.setComputedAndSpecifiedValue(property, StyleKeywords.SOLID);
View Full Code Here

TOP

Related Classes of com.volantis.mcs.themes.StyleValueFactory

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.