Examples of StyledDOMThemeExtractorFactory


Examples of com.volantis.mcs.dom2theme.StyledDOMThemeExtractorFactory

        DeferredInheritTransformer transformer =
                new DeferredInheritTransformer();
        document = transformer.transform(this, document);

        StyledDOMThemeExtractorFactory factory =
            StyledDOMThemeExtractorFactory.getDefaultInstance();

        final ExtractorConfiguration configuration =
            protocolConfiguration.getExtractorConfiguration();

        StyledDOMStyleAttributeRenderer rewriter =
            factory.createRenderer(configuration,getExtractorContext());

        rewriter.renderStyleAttributes(document);
    }
View Full Code Here

Examples of com.volantis.mcs.dom2theme.StyledDOMThemeExtractorFactory

    public StrictStyledDOMHelper(EntityResolver resolver,
                                 String styleAttributeName) {
        this.resolver = resolver;
        this.styleAttributeName = styleAttributeName;

        StyledDOMThemeExtractorFactory extractorFactory =
                StyledDOMThemeExtractorFactory.getDefaultInstance();

        final AssetResolver assetResolver = new AssetResolver() {

            // javadoc inherited
            public PolicyReference evaluateExpression(PolicyExpression expression) {
                return null;
            }

            // javadoc inherited
            public String resolveImage(PolicyReference reference) {
                return null;
            }

            // javadoc inherited
            public String resolveTranscodableImage(String transcodableUrl) {
                return null;
            }

            // javadoc inherited
            public String resolveVideo(PolicyReference reference) {
                return null;
            }

            // Javadoc inherited.
            public String resolveText(
                    PolicyReference reference,
                    EncodingCollection requiredEncodings) {
                return null;
            }
        };

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

        StylePropertyDefinitions definitions =
                StylePropertyDetails.getDefinitions();
        final List standardProperties = new ArrayList();
        definitions.iterateStyleProperties(new StylePropertyIteratee() {
            public IterationAction next(StyleProperty property) {
                String name = property.getName();

                // Ignore all the mcs specific properties as they will not be
                // written out in the final output. The exception to this is
                // the mcs-input-format property as that may be written out as
                // -wap-input-... properties.
                if (property == StylePropertyDetails.MCS_INPUT_FORMAT ||
                        !name.startsWith("mcs-")) {
                    standardProperties.add(property);
                }
                return IterationAction.CONTINUE;
            }
        });

        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

Examples of com.volantis.mcs.dom2theme.StyledDOMThemeExtractorFactory

    }

    protected void generateCSS() throws IOException {
        if (cssReference != null) {
            // After transformation create a theme for the DOM.
            StyledDOMThemeExtractorFactory factory =
                StyledDOMThemeExtractorFactory.getDefaultInstance();

            final ExtractorConfiguration configuration =
                    protocolConfiguration.getExtractorConfiguration();

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

            StringWriter cssStringWriter = new StringWriter();
            StyleSheetRenderer renderer = getStyleSheetRenderer();
            MarinerPageContext marinerPageContext = getMarinerPageContext();
View Full Code Here

Examples of com.volantis.mcs.dom2theme.StyledDOMThemeExtractorFactory

        createDocument(false);

        transformDOM();

        // After transformation write styles as attribute 'style' value
        StyledDOMThemeExtractorFactory factory =
            StyledDOMThemeExtractorFactory.getDefaultInstance();

        final ExtractorConfiguration configuration =
            protocolConfiguration.getExtractorConfiguration();

        StyledDOMStyleAttributeRenderer rewriter =
            factory.createRenderer(configuration,extractorContext);

        rewriter.renderStyleAttributes(document);

        // Convert marked element nodes to text nodes just before document is written out.
        transformMarkedElementsToText();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.