Package com.volantis.mcs.css.version

Examples of com.volantis.mcs.css.version.DefaultCSSVersion


        InputPropertiesOptimizer propertiesOptimizer =
                new PropertiesOptimizer(detailsSet,
                        contextMock, supportedShorthands);

        ExtractorContext context = new ExtractorContext() {
            DefaultCSSVersion cssVersion = new DefaultCSSVersion("test"); {
                cssVersion.addPseudoSelectorId(new String[] {
                        PseudoClassTypeEnum.HOVER.getType()
                    });
                cssVersion.markImmutable();
            }

            public AssetResolver getAssetResolver() {
                return null;
            }
View Full Code Here


        if (logger.isDebugEnabled()) {
            logger.debug("Configuring CSS for device '" +
                    device.getName() + "'");
        }

        final DefaultCSSVersion cssVersion;
        // Initialise the CSS version from the device.
        String styleSheetVersion = device.getStyleSheetVersion();
        // If the device has a style sheet version.
        if (styleSheetVersion != null) {
            // Then use it.

            // Find the ancestor devices which share the same style sheet
            // version. These are the ones that we may inherit individual
            // property definitions from.
            calculateAncestors(device, styleSheetVersion);

            if (DevicePolicyConstants.CSS_MOBILE_PROFILE1.equals(
                    styleSheetVersion)) {
                cssVersion =
                        new ManualCSSMobileVersionFactory().createCSSVersion();
            } else if (DevicePolicyConstants.CSS1.equals(
                    styleSheetVersion)) {
                cssVersion =
                        new ManualCSS1VersionFactory().createCSSVersion();
            } else if (DevicePolicyConstants.CSS_WAP.equals(styleSheetVersion)) {
                cssVersion =
                        new ManualCSSWAPVersionFactory().createCSSVersion();
            } else if (DevicePolicyConstants.CSS2.equals(styleSheetVersion)) {
                cssVersion =
                        new ManualCSS2VersionFactory().createCSSVersion();
            } else {
                // Should never happen, as getStyleSheetVersion constrains the
                // results to ones that we know about.
                throw new IllegalStateException("Unexpected device style " +
                        "sheet version '" + styleSheetVersion + "'");
            }
            if (logger.isDebugEnabled()) {
                logger.debug("Using style sheet version '" +
                        styleSheetVersion + "'");
            }

            initialiseStyleProperties(device, cssVersion);

            initialiseStyleShorthands(device, cssVersion);

            initialiseAliases(device, cssVersion);

            initialiseStyleSyntaxes(device, cssVersion);

            initialiseStylePseudoSelectors(device, cssVersion);

            CSSSupportConfigurator cssSupport =
                    new CSSSupportConfigurator(device);
            cssVersion.setRemappableElements(
                    cssSupport.getFallbackAttributeExpressions());

            cssVersion.markImmutable();
            configuration.setCssVersion(cssVersion);
        }
        // else the device had no style sheet version set, or had it set to
        // "None". We can just leave the css version as null in this case,
        // as it only affects rendering at this stage, which we assume will
View Full Code Here

        // null, which is very tedious. Instead we sub in a testing CSS version
        // which prevents us having to do this.
        if (config.getCssVersion() == null) {

            // assume the most common case for test cases for now.
            DefaultCSSVersion cssVersion =
                    new ManualCSS2VersionFactory().createCSSVersion();
            cssVersion.markImmutable();
            config.setCssVersion(cssVersion);

            if (logger.isDebugEnabled()) {
                logger.debug("Using testing base CSS Version: " +
                        configuration.getCssVersion());
View Full Code Here

    protected RendererContext context;

    protected void setUp() throws Exception {
        writer = new StringWriter();
        DefaultCSSVersion cssVersion = new DefaultCSSVersion("WapCSS");
        cssVersion.markImmutable();
       
        context = new RuntimeRendererContext(writer,
                new RuntimeCSSStyleSheetRenderer(),
                new RuntimeRendererProtocolConfiguration() {
                    public ValidationHelper getValidationHelper() {
View Full Code Here

            }
            public boolean generateTypeRules() {
                return true;
            }
            public CSSVersion getCSSVersion() {
                DefaultCSSVersion cssVersion =
                        new DefaultCSSVersion("testVersion");
                cssVersion.markImmutable();
                return cssVersion;
            }
        };

        StylePropertyDefinitions definitions =
View Full Code Here

                .returns(referenceResolverMock).any();

        marinerPageContextMock.expects.getTranscodableUrlResolver().returns(
            new TranscodableUrlResolver(requestContextMock)).any();

        DefaultCSSVersion cssVersion = new DefaultCSSVersion("testVersion");
        cssVersion.markImmutable();

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

        StylingEngine stylingEngine = createStyling();
View Full Code Here

TOP

Related Classes of com.volantis.mcs.css.version.DefaultCSSVersion

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.