Package com.volantis.mcs.themes

Examples of com.volantis.mcs.themes.StyleList


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

        StyleValue value;

        StyleList expected = STYLE_VALUE_FACTORY.getList(Arrays.asList(
                new Object[]{
                    XYZ_STRING,
                    ABC_STRING,
                    XYZ_STRING
                }));
View Full Code Here


    // Javadoc inherited
    public StyleValue postProcess(final StyleValue value) {
        StyleValue processed = value;
        if (value instanceof StyleList) {
            StyleList list = (StyleList) value;
            List values = list.getList();
            List processedValues = new ArrayList();
            boolean changed = false;
            Iterator it = values.iterator();
            while (it.hasNext()) {
                StyleValue listValue = (StyleValue) it.next();
                StyleValue listValueProcessed = processor.postProcess(listValue);
                processedValues.add(listValueProcessed);
                if (listValue != listValueProcessed) {
                    changed = true;
                }
            }
            if (changed) {
                StyleList processedList =
                    STYLE_VALUE_FACTORY.getList(processedValues);
                processed = processedList;
            }
        }
        return processed;
View Full Code Here

            if (afterStyles != null) {

                MutablePropertyValues propertyValues =
                        afterStyles.getPropertyValues();
                StyleList content = (StyleList) propertyValues.
                        getComputedValue(StylePropertyDetails.CONTENT);

                // if we have a specified seperator then create a ShortcutProperties
                // object and configure it.
                ShortcutProperties shortcutProps = new ShortcutProperties();
View Full Code Here

                        StylePropertyDetails.CONTENT));

        // Render label content
        if (null != labelContent) {
            if (labelContent instanceof StyleList) {
                StyleList contentList = (StyleList) labelContent;
                if (contentList.getList().isEmpty()) {
                    throw new ProtocolException(exceptionLocalizer
                            .format("widget-tab-label-empty-content"));
                }
                labelContent =  (StyleValue) contentList.getList().get(0);
                if (labelContent.getStyleValueType() == StyleValueType.STRING) {
                    textLabel = ((StyleString)labelContent).getString();
                } else {
                    textLabel = labelContent.getStandardCSS();
                }
View Full Code Here

     */
    public void testStyleInteger()
            throws IOException, SAXException {

        StyleInteger integer = STYLE_VALUE_FACTORY.getInteger(null, 6);
        StyleList list = STYLE_VALUE_FACTORY.getList(Arrays.asList(
            new StyleValue[]{integer}));

        final String input = "<root/>";
        final String expected = "<root>6</root>";

View Full Code Here

                StyleKeyword styleKeyword = (StyleKeyword) styleValue;
               
                result = (styleKeyword == keyword);
               
            } else if (styleValue instanceof StyleList) {
                StyleList styleList = (StyleList) styleValue;
               
                result = styleList.getList().contains(keyword);
            }
        }
       
        return result;
    }
View Full Code Here

     * get the value of the fontFamily property.
     *
     * @return the value of the fontFamily property.
     */
    private String getFontFamily() {
        StyleList listValue = (StyleList) styles
                .getStyleValue(StylePropertyDetails.FONT_FAMILY);
        if (listValue != null && listValue.getList() != null) {
            Iterator i = listValue.getList().iterator();
            ReusableStringBuffer buffer = new ReusableStringBuffer();
            while (i.hasNext()) {
                StyleValue value = (StyleValue) i.next();
                context.setKeywordMapper(getFontFamilyKeywordMapper());
                if (buffer.length() == 0) {
View Full Code Here

        privateSetUp();
        Element element = domFactory.createElement();
        ArrayList fonts = new ArrayList();
        StyleKeyword keyword = FontFamilyKeywords.SANS_SERIF;
        fonts.add(keyword);
        StyleList list = styleValueFactory.getList(fonts);           
        properties.setComputedValue(StylePropertyDetails.FONT_FAMILY, list);
        style.addFontFamily(element, "font", true);
        assertTrue("Font must be sans-serif and not "+
                    element.getAttributeValue("font"),
                    element.getAttributeValue("font").equals("sans-serif"));
View Full Code Here

     */
    private StyleValue getSingleStyleValue(StyleValue content)
            throws ProtocolException {

        if (content instanceof StyleList) {
            StyleList contentList = (StyleList) content;
            if (contentList.getList().isEmpty()) {
                throw new ProtocolException(exceptionLocalizer
                        .format("widget-tab-label-empty-content"));
            }
            return (StyleValue) contentList.getList().get(0);
        } else {
            return content;
        }
    }
View Full Code Here

                new MutablePropertyValuesMock("mutablePropertyValuesMock",
                                              expectations);

        List styles = new ArrayList();
        styles.add(STYLE_VALUE_FACTORY.getString(null, "testvalue"));
        StyleList styleList = STYLE_VALUE_FACTORY.getList(styles);

        // setup expectations
        elementMock.expects.findNestedStyles(PseudoElements.MCS_SHORTCUT).
                returns(shortcutMock);
        shortcutMock.expects.findNestedStyles(PseudoElements.AFTER).
View Full Code Here

TOP

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

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.