Package com.volantis.mcs.dom2theme.extractor

Examples of com.volantis.mcs.dom2theme.extractor.ExtractorConfigurationBuilder


        // possible as processing each style property is *very* processor
        // intensive. For example, there is not much use extracing most of
        // the mcs-* properties as they are not understood by any device.
        cssVersion.iterate(this);

        ExtractorConfigurationBuilder configurationBuilder =
                factory.createConfigurationBuilder();

        // Populate the set of supported shorthands.
        MutableShorthandSet supportedShorthands = new MutableShorthandSet();

        Iterator i = StyleShorthands.getDefinitions().iterator();
        while (i.hasNext()) {
            StyleShorthand shorthand = (StyleShorthand) i.next();
            if (cssVersion.supportsShorthand(shorthand)) {
                supportedShorthands.add(shorthand);
            }
        }
       
        String internalShorthand = BorderRadiusHelper.supportShorthand(cssVersion);       
        if(internalShorthand != null) {
            supportedShorthands.add(StyleShorthands.getDefinitions().getShorthand("mcs-border-radius"));           
        }

        configurationBuilder.setSupportedShorthands(supportedShorthands);

        PropertyDetailsSet detailsSet = detailsSetBuilder.getDetailsSet();

        String defaultCSS = device.getPolicyValue(
                DevicePolicyConstants.DEFAULT_CSS);
        if (defaultCSS == null) {
            defaultCSS = "";
        }
       
        String sourceLocation = device.getName() + "/" +
                DevicePolicyConstants.DEFAULT_CSS;

        CompiledStyleSheet compiledStyleSheet = compileDeviceStyleSheet(
                defaultCSS, sourceLocation);

        configurationBuilder.setDeviceStyleSheet(compiledStyleSheet);

        configurationBuilder.setDetailsSet(detailsSet);

        return configurationBuilder.buildConfiguration();
    }
View Full Code Here


        PropertyDetailsSet detailsSet =
                PropertyDetailsSetHelper.getDetailsSet(standardProperties);

        ShorthandSet supportedShorthands = new MutableShorthandSet();

        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();

        optimizer = extractorFactory.createOptimizer(configuration, context);
    }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.dom2theme.extractor.ExtractorConfigurationBuilder

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.