Package com.volantis.styling.engine

Examples of com.volantis.styling.engine.StylingEngine


        cssVersion.markImmutable();

        ExtractorContext returnValue = new RuntimeExtractorContext(
                referenceResolverMock, assetResolverMock, null, cssVersion);

        StylingEngine stylingEngine = createStyling();

        /*
         * Layout objects
         */
        CanvasLayout canvasLayout =
View Full Code Here


        StylingFactory stylingFactory = StylingFactory.getDefaultInstance();

        StyleSheetCompilerFactory inlineCompilerFactory =
                new InlineStyleSheetCompilerFactory(null);

        StylingEngine stylingEngine = stylingFactory.createStylingEngine(inlineCompilerFactory);

        // Create a CSS compiler.
        CSSCompilerBuilder builder = new CSSCompilerBuilder();
        builder.setStyleSheetCompilerFactory(
                DefaultStyleSheetCompilerFactory.getDefaultInstance());
        CSSCompiler cssCompiler = builder.getCSSCompiler();

        // Compile and push the system default style sheet into the styling
        // engine.
        CompiledStyleSheet defaultCompiledStyleSheet;
        try {
            URL url = getClass().getResource("/com/volantis/mcs/runtime/default.css");
            InputStream stream = url.openStream();
            defaultCompiledStyleSheet = cssCompiler.compile(
                    new InputStreamReader(stream), null);
        } catch (IOException e) {
            throw new ExtendedRuntimeException(e);
        }
        stylingEngine.pushStyleSheet(defaultCompiledStyleSheet);

        if (protocol != null &&
            protocol.getCompiledDefaultStyleSheet() != null) {
            // merge the default style sheet and the current one
            stylingEngine.pushStyleSheet(
                protocol.getCompiledDefaultStyleSheet());
        }
        return stylingEngine;
    }
View Full Code Here

            CompiledStyleSheet compiledStyleSheet =
                    cssCompiler.compile(new StringReader(css), null);

            // adding style sheet to the list of style sheets
            // that should be stored for current element
            StylingEngine stylingEngine = pageContext.getStylingEngine();
            stylingEngine.addNestedStyleSheet(compiledStyleSheet);
        }

        return CONTINUE_PROCESSING;
    }
View Full Code Here

TOP

Related Classes of com.volantis.styling.engine.StylingEngine

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.