Package com.volantis.mcs.css.renderer

Examples of com.volantis.mcs.css.renderer.StyleSheetRenderer


                PropertyRenderer renderer, String inputCSS,
                String expectedCSS)
                throws Exception {

            StringWriter writer = new StringWriter();
            StyleSheetRenderer styleSheetRenderer = CSSStyleSheetRenderer.getSingleton();
            RendererContext context = new RendererContext(writer,
                    styleSheetRenderer);

            final StyleValuesMock parentValuesMock =
                    new StyleValuesMock("parentValuesMock", expectations);
View Full Code Here


            StringWriter writer = new StringWriter();
            String rendered = "";
            RendererContext context = new RendererContext(
                    writer, CSSStyleSheetRenderer.getSingleton());
            StyleSheetRenderer renderer = CSSStyleSheetRenderer.getSingleton();
            try {
                MutableStyleProperties properties =
                    ThemeFactory.getDefaultInstance().createMutableStyleProperties();
                properties.setStyleValue(property, value);
                renderer.renderStyleProperties(properties, context);
                context.flushStyleSheet();
                rendered = writer.toString();
                int firstColon = rendered.indexOf(':');
                if (firstColon > 0) {
                    rendered = rendered.substring(firstColon + 1);
View Full Code Here

        private String selectorToString(List selectors) {
            StringWriter writer = new StringWriter();
            String rendered = "";
            RendererContext context = new RendererContext(
                    writer, CSSStyleSheetRenderer.getSingleton());
            StyleSheetRenderer renderer = CSSStyleSheetRenderer.getSingleton();
            try {
                renderer.renderStyleSelectors(selectors, context);
                context.flushStyleSheet();
                rendered = writer.toString();
            } catch (IOException ioe) {
            }
            return rendered;
View Full Code Here

     * @return
     * @throws IOException
     */
    private String renderProperties(
            StyleProperties properties) throws IOException {
        StyleSheetRenderer renderer = CSSStyleSheetRenderer.getSingleton();
        StringWriter writer = new StringWriter();
        RendererContext context = new RendererContext(writer, renderer);
        renderer.renderStyleProperties(properties, context);
        context.flushStyleSheet();
        return writer.getBuffer().toString();
    }
View Full Code Here

     * @param value the value that is to be renderered in an
     * appropriate manner.
     */
    public String render(StyleValue value) {
        StringWriter writer = new StringWriter();
        StyleSheetRenderer styleSheetRenderer =
                CSSStyleSheetRenderer.getSingleton();
        RendererContext context =
                new RendererContext(writer, styleSheetRenderer);

        // Don't forget to setup the css keyword mapper
View Full Code Here

            StyledDOMThemeExtractor extractor =
                    factory.createExtractor(configuration, extractorContext);
            StyleSheet styleSheet = extractor.extract(document);

            StringWriter cssStringWriter = new StringWriter();
            StyleSheetRenderer renderer = getStyleSheetRenderer();
            MarinerPageContext marinerPageContext = getMarinerPageContext();

            // todo better detect empty style sheet here and avoid rendering,
            // and also remove dubious check for empty in renderStyleSheet?
            MarinerRequestContext requestContext =
                marinerPageContext.getRequestContext();
            com.volantis.mcs.css.renderer.RendererContext runtimeCSSRendererContext =
                    new RuntimeRendererContext(cssStringWriter,
                            renderer, this,
                            getProtocolConfiguration().getCssVersion());
            renderer.renderStyleSheet(styleSheet,
                                      runtimeCSSRendererContext);
            final String css = cssStringWriter.getBuffer().toString();
            if (logger.isDebugEnabled()) {
                logger.debug("Generated CSS is");
                logger.debug("====");
View Full Code Here

TOP

Related Classes of com.volantis.mcs.css.renderer.StyleSheetRenderer

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.