Package com.volantis.mcs.themes

Examples of com.volantis.mcs.themes.StyleSheet


        OutputStyledElementsFactory factory = new OutputStyledElementsFactory();

        OutputStyledElementList outputElementList =
                factory.createOutputStyledElements(actualXml);

        StyleSheet actualStyleSheet = generator.generateStyleSheetFor(outputElementList);

        StyleSheetTester.assertStyleSheetEquals(testName, expectedTheme, actualStyleSheet);

        checkXmlEquals(testName, expectedXml, actualXml);
    }
View Full Code Here


    }

    private StylingEngine createStylingEngine(String css) {
        CSSParser parser =
                CSSParserFactory.getDefaultInstance().createStrictParser();
        StyleSheet styleSheet = parser.parseStyleSheet(new StringReader(css),
                null);

        StylingFactory factory = StylingFactory.getDefaultInstance();

        CompilerConfiguration configuration = factory.createCompilerConfiguration();
View Full Code Here

                        ContentBuilder variantContent =
                                builder.getContentBuilder();
                        InternalThemeContentBuilder themeContent =
                                (InternalThemeContentBuilder) variantContent;
                        if (themeContent.getStyleSheet() instanceof CSSStyleSheet) {
                            StyleSheet parsedStyleSheet =
                                    STYLE_SHEET_FACTORY.createStyleSheet(
                                            (CSSStyleSheet)
                                                  themeContent.getStyleSheet());
                            parsedStyleSheet.setSourceFormat(
                                    StyleSheetSourceFormat.CSS);
                            themeContent.setStyleSheet(parsedStyleSheet);
                            containsCSS = true;
                        }
                    }
View Full Code Here

            Reader reader,
            final FunctionResolver functionResolverMock) {

        CSSParserFactory factory = CSSParserFactory.getDefaultInstance();
        CSSParser parser = factory.createStrictParser();
        StyleSheet styleSheet = parser.parseStyleSheet(reader, null);

        StylingFactory stylingFactory = StylingFactory.getDefaultInstance();
        CompilerConfiguration configuration =
                stylingFactory.createCompilerConfiguration();
        configuration.setSource(StyleSheetSource.THEME);
View Full Code Here

            CSSParser parser,
            String styleSheetString, boolean specified) {

        // Parse the style sheet.

        final StyleSheet styleSheet = parser.parseStyleSheet(
                new StringReader(styleSheetString), null);

        Visitor visitor = new Visitor(specified);

        // Iterate over the rules.
        List rules = styleSheet.getRules();
        for (int i=0; i< rules.size(); i++) {
            // Extract each rule.
            Rule rule = (Rule) rules.get(i);

            Selector selector = (Selector) rule.getSelectors().get(0);
View Full Code Here

        ruleExtractorList.add(ruleExtractor);
    }

    public StyleSheet generateStyleSheetFor(OutputStyledElementList elementList) {

        StyleSheet styleSheet = styleSheetFactory.createStyleSheet();

        Iterator ruleExtractors = ruleExtractorList.iterator();
        while (ruleExtractors.hasNext()) {
            RuleExtractor extractor = (RuleExtractor) ruleExtractors.next();
            styleSheet = extractor.extractRules(elementList, styleSheet);
View Full Code Here

        InlineStyleSelector styleSelector =
                StyleSheetFactory.getDefaultInstance().
                        createInlineStyleSelector(styleSheetStack.depth());

        //Using the parser, process the style attribute into a Style Sheet.
        StyleSheet styleSheet =
                inlineStyleAttributeParser.parseInlineStyleAttribute(
                inlineStyleValue, null, styleSelector);

        StyleSheetCompiler styleSheetCompiler =
                styleSheetCompilerFactory.
View Full Code Here

        compiler = new DeviceStyleSheetCompiler(outlook);
    }

    // Javadoc inherited.
    public CompiledStyleSheet compile(Reader input, String url) {
        StyleSheet sheet = parser.parseStyleSheet(input, url);

        return compiler.compileStyleSheet(sheet);
    }
View Full Code Here

    protected FormatStylingEngine createFormatStylingEngine(
            Layout layout) throws IOException {

        LayoutStyleSheetBuilder builder = new LayoutStyleSheetBuilderImpl();
        StyleSheet styleSheet = builder.build(layout);

//        String css = StyleSheetTester.renderStyleSheet(styleSheet);
//        System.out.println("CSS\n" + css);

        StylingFactory stylingFactory = StylingFactory.getDefaultInstance();
View Full Code Here

            ActivatedVariablePolicy policy, Variant variant,
            InternalDevice device) {

        ActivatedThemeContent content =
                (ActivatedThemeContent) variant.getContent();
        StyleSheet styleSheet = content.getStyleSheet();

        // Create a new style sheet.
        StyleSheet compositeStyleSheet;

        // If importing the parent theme then find a theme that is
        // explicitly targeted at the parent device.
        if (content.getImportParent()) {

            // Create a style sheet to contain all the rules.
            compositeStyleSheet = styleSheetFactory.createStyleSheet();
            List rules = compositeStyleSheet.getRules();

            // Add the rules from the parent style sheet first.
            addParentRules(policy, device, rules);

            // Add the style sheet rules for this after the parent's
View Full Code Here

TOP

Related Classes of com.volantis.mcs.themes.StyleSheet

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.