Package com.volantis.styling.compiler

Examples of com.volantis.styling.compiler.CSSCompiler


    private void checkNormalization(
            Document actualXml, String expectedStyledElements,
            List indexedProperties,
            final String deviceCSS) {
        CSSCompiler compiler = StylingFactory.getDefaultInstance()
                .createDeviceCSSCompiler(DeviceOutlook.OPTIMISTIC);
        CompiledStyleSheet deviceStyleSheet = compiler.compile(
                new StringReader(deviceCSS), null);

        PropertyDetailsSet detailsSet =
                PropertyDetailsSetHelper.getDetailsSet(indexedProperties);
View Full Code Here


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

        final CompiledStyleSheet compiledStyleSheet =
            cssCompiler.compile(reader, null);

        pageContext.getStylingEngine().pushStyleSheet(compiledStyleSheet);
    }
View Full Code Here

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

            // convert the css into StyleSheet
            final InputStreamReader reader = new InputStreamReader(
                    cssInputResourceStream);
            compiledStyleSheet = cssCompiler.compile(reader, null);

        } catch (ExceptionInInitializerError e) {
        }

        return compiledStyleSheet;
View Full Code Here

        ExtractorConfigurationBuilder extractorBuilder =
                extractorFactory.createConfigurationBuilder();
        extractorBuilder.setDetailsSet(detailsSet);
        extractorBuilder.setSupportedShorthands(supportedShorthands);

        CSSCompiler compiler = StylingFactory.getDefaultInstance()
                .createDeviceCSSCompiler(DeviceOutlook.OPTIMISTIC);
        CompiledStyleSheet deviceStyleSheet = compiler.compile(
                new StringReader(DevicePolicyConstants.DEFAULT_DISPLAY_CSS), null);
        extractorBuilder.setDeviceStyleSheet(deviceStyleSheet);

        ExtractorConfiguration configuration =
                extractorBuilder.buildConfiguration();
View Full Code Here

        // Create a CSS compiler.
        CSSCompilerBuilder compilerBuilder = new CSSCompilerBuilder();
        StyleSheetCompilerFactory compilerFactory =
                getStyleSheetCompilerFactory();
        compilerBuilder.setStyleSheetCompilerFactory(compilerFactory);
        CSSCompiler cssCompiler = compilerBuilder.getCSSCompiler();

        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);
        }
View Full Code Here

        // The default display values used by the device.
        defaultCSS = DevicePolicyConstants.DEFAULT_DISPLAY_CSS + defaultCSS;

        StylingFactory factory = StylingFactory.getDefaultInstance();
        CSSCompiler compiler = factory.createDeviceCSSCompiler(
                DeviceOutlook.REALISTIC);

        return compiler.compile(new StringReader(defaultCSS), sourceDescription);
    }
View Full Code Here

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

        CSSCompiler compiler = factory.createDeviceCSSCompiler(DeviceOutlook.REALISTIC);
        CompiledStyleSheet compiledSheet = compiler.compile(new StringReader(
                "* {text-align: left}" +
                "a {font-family: <not-set>}" +
                "a:link {font-size: <unknown> !-medium}" +
                "a:link:hover {color: <default>}" +
                "a:first-letter:link {color: green}"),
View Full Code Here

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

            builder.setProject(pageContext.getCurrentProject());
            builder.setBaseURL(pageContext.getBaseURL());
            builder.setStyleSheetCompilerFactory(
                    ThemeStyleSheetCompilerFactory.getDefaultInstance());
            builder.setParserMode(CSSParserMode.LAX);
            CSSCompiler cssCompiler = builder.getCSSCompiler();

            // Parse and compile the style sheet.
            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);
View Full Code Here

            builder.setProject(pageContext.getCurrentProject());
            builder.setBaseURL(pageContext.getBaseURL());
            builder.setStyleSheetCompilerFactory(
                    ThemeStyleSheetCompilerFactory.getDefaultInstance());
            builder.setParserMode(CSSParserMode.LAX);
            CSSCompiler cssCompiler = builder.getCSSCompiler();

            // Parse and then compile the css into compiled style sheet.
            CompiledStyleSheet compiledStyleSheet =
                    cssCompiler.compile(new StringReader(css), null);

            // Add the compiled style sheet into the html element to be
            // processed later.
            htmlElement.addInlineStyleSheet(compiledStyleSheet);
        }
View Full Code Here

TOP

Related Classes of com.volantis.styling.compiler.CSSCompiler

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.