Package com.volantis.mcs.dom2theme.impl.model

Examples of com.volantis.mcs.dom2theme.impl.model.OutputStyledElementList


    /**
     * Test that the iterate method rejects null iteratees.
     */
    public void testNullIteratee() {

        OutputStyledElementList elementList = new OutputStyledElementList();

        try {
            elementList.iterate(null);
            fail("iteratee may not be null");
        } catch (IllegalArgumentException e) {
            // expected
        }
    }
View Full Code Here


                new DefaultStyledDOMOptimizer(propertiesOptimizer,
                        detailsSet.getRootStyleValues(),
                        deviceStyleSheet,
                        context);

        OutputStyledElementList elementList = normalizer.optimize(actualXml);
        String actualStyledElements = renderStyledElements(elementList);
        System.out.println(actualStyledElements);

        assertEquals("", expectedStyledElements, actualStyledElements);
    }
View Full Code Here

        Document actualXml = StyledDOMTester.createStyledDom(inputXml);

        OutputStyledElementsFactory factory = new OutputStyledElementsFactory();

        OutputStyledElementList outputElementList =
                factory.createOutputStyledElements(actualXml);

        StyleSheet actualStyleSheet = generator.generateStyleSheetFor(outputElementList);

        StyleSheetTester.assertStyleSheetEquals(testName, expectedTheme, actualStyleSheet);
View Full Code Here

public class OutputStyledElementsFactory {

    public OutputStyledElementList createOutputStyledElements(Document dom) {

        final OutputStyledElementList outputElementList =
                new OutputStyledElementList();

        // iterate over the dom, extracting all the elements into a list
        final OutputStylesFactory factory = new OutputStylesFactory();
        WalkingDOMVisitor visitor = new WalkingDOMVisitorStub() {
            public void visit(Element element) {
                OutputStyles outputStyles = null;
                Styles styles = element.getStyles();
                if (styles != null) {
                    outputStyles = factory.create(element.getName(), styles);
                }
                OutputStyledElement outputElement =
                        new OutputStyledElement(element, outputStyles);
                outputElementList.add(outputElement);
            }
        };
        DOMWalker walker = new DOMWalker(visitor);
        walker.walk(dom);
        return outputElementList;
View Full Code Here

        // ==================================================================
        // Do the test.
        // ==================================================================

        OutputStyledElementList elementList = new OutputStyledElementList();

        elementList.add(outputElementMock1);
        elementList.add(outputElementMock2);

        elementList.iterate(iterateeMock);
    }
View Full Code Here

        // ==================================================================
        // Do the test.
        // ==================================================================

        OutputStyledElementList elementList = new OutputStyledElementList();

        elementList.add(outputElementMock1);
        elementList.add(outputElementMock2);

        elementList.iterate(iterateeMock);
    }
View Full Code Here

    /**
     * Test that the add method rejects null elements.
     */
    public void testNullElement() {

        OutputStyledElementList elementList = new OutputStyledElementList();

        try {
            elementList.add(null);
            fail("element may not be null");
        } catch (IllegalArgumentException e) {
            // expected
        }
    }
View Full Code Here

    }

    // Javadoc inherited.
    public OutputStyledElementList optimize(Document dom) {

        elementList = new OutputStyledElementList();

        this.parentValues = rootStyles;

        dom.forEachChild(this);
View Full Code Here

            String inputXml, String expectedXml)
            throws IOException, SAXException, ParserConfigurationException {

        Document styledDom = StyledDOMTester.createStyledDom(inputXml);
        OutputStyledElementsFactory factory = new OutputStyledElementsFactory();
        OutputStyledElementList outputElementList =
                factory.createOutputStyledElements(styledDom);
        OutputStyledElementIteratee iteratee = new
            DOMStyleAttributeRewriter();
        outputElementList.iterate(iteratee);
        checkXmlEquals(testName, expectedXml, styledDom);
    }
View Full Code Here

        // Create a styled dom from the input XML.
        Document actualXml = StyledDOMTester.createStyledDom(inputXml);

        // Extract the elements from the styled dom.
        final OutputStyledElementList outputElementList =
                new OutputStyledElementsFactory().createOutputStyledElements(
                        actualXml);

        // Test the extraction of selectors from those elements.
        // todo: deal with null return
View Full Code Here

TOP

Related Classes of com.volantis.mcs.dom2theme.impl.model.OutputStyledElementList

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.