Examples of OutputStyles


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

        final StringBuffer buffer = new StringBuffer();
        buffer.append("[");
        buffer.append(element.getName());
        buffer.append(",");
        final OutputStyles styles = element.getStyles();
        if (styles != null) {
            styles.iterate(new PseudoStylePathIteratee() {
                public void next(PseudoStylePath pseudoPath) {
                    buffer.append(pseudoPath);
                    buffer.append("{");
                    StyleProperties properties =
                            styles.getPathProperties(pseudoPath);
                    buffer.append(properties.getStandardCSS());
                    buffer.append("},");
                }
            });
//        } else {
View Full Code Here

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

        // 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 =
View Full Code Here

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

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

        OutputStyles outputStyles = new OutputStyles();

        outputStyles.addPathProperties(pseudoStylePathMock1,
                stylePropertiesMock1);
        outputStyles.addPathProperties(pseudoStylePathMock2,
                stylePropertiesMock2);

        assertSame(stylePropertiesMock1,
                outputStyles.getPathProperties(pseudoStylePathMock1));
        assertSame(stylePropertiesMock2,
                outputStyles.getPathProperties(pseudoStylePathMock2));
    }
View Full Code Here

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

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

        OutputStyles outputStyles = new OutputStyles();

        assertTrue("", outputStyles.isEmpty());

        outputStyles.addPathProperties(pseudoStylePathMock1,
                stylePropertiesMock1);

        assertFalse("", outputStyles.isEmpty());

        outputStyles.removePathProperties(pseudoStylePathMock1);

        assertTrue("", outputStyles.isEmpty());
    }
View Full Code Here

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

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

        OutputStyles outputStyles = new OutputStyles();

        outputStyles.addPathProperties(pseudoStylePathMock1,
                stylePropertiesMock1);
        outputStyles.addPathProperties(pseudoStylePathMock2,
                stylePropertiesMock2);

        outputStyles.iterate(pathIterateeMock);
    }
View Full Code Here

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

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

        OutputStyles outputStyles = stylesOptimizer.calculateOutputStyles(
                name, styles, parentValues, DEVICE_STYLES);

        return outputStyles;
    }
View Full Code Here

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

            // Then extract the appropriate properties from the styles.

            MutableStyleProperties properties = null;
            PseudoStylePath pseudoPath = selectorSequence.getPath();
            // If the element has styles
            OutputStyles styles = element.getStyles();
            if (styles != null) {
                // Then we might have some style properties.
                properties = styles.getPathProperties(pseudoPath);
            }
            // else, no styles. This means the properties are empty.

            action = filtered.next(properties);

            // the filtered may remove property values, so we need to check
            // to see if the containing objects are still required.
            if (properties != null && properties.isEmpty()) {
                // if the properties is now empty, remove it.
                styles.removePathProperties(pseudoPath);
                if (styles.isEmpty()) {
                    element.clearStyles();
                }
            }
        }
View Full Code Here

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

        // Reset the parent values.
        parentValues = oldParentValues;

        if (!internalElement) {
            // Normalize the input styles.
            OutputStyles outputStyles;
            if (inputStyles == null) {
                outputStyles = null;
            } else {
                outputStyles = optimizer.calculateOutputStyles(localName,
                        inputStyles, parentValues, deviceStyles);
View Full Code Here

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

    /**
     * Rewrites styleProperties from element as 'style' attribute of element
     * @param element
     */
    public IterationAction next(OutputStyledElement element) {
        OutputStyles styles = element.getStyles();
        if (styles != null && !styles.isEmpty()) {
            StyleProperties properties =
                styles.getPathProperties(PseudoStylePath.EMPTY_PATH);
            try {
                element.getElement().setAttribute("style",
                        renderProperties(properties));
            } catch (IOException e){
                // this is not critical exception style attriubte cannot be rendered
View Full Code Here

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

        for (int i = 0; i < flattened.size(); i++) {
            OutputValues values = (OutputValues) flattened.get(i);
            if (values != null) {
                if (outputStyles == null) {
                    outputStyles = new OutputStyles();
                }
                outputStyles.addPathProperties(values.getPath(),
                        values.getProperties());
            }
        }
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.