Package com.volantis.mcs.runtime.styling

Examples of com.volantis.mcs.runtime.styling.CompiledStyleSheetCollection


            pageContext.setBrandName(brandName, inclusion);

            // Create the list of theme style sheets that apply for this page
            // and add the single canvas theme into it (for now). More can
            // be added later by the <style> element.
            themeStyleSheets = new CompiledStyleSheetCollection();
            if (themeName != null) {
                CompiledStyleSheet compiledStyleSheet =
                        pageContext.retrieveThemeStyleSheet(themeName);
                if (compiledStyleSheet != null) {
                    themeStyleSheets.addStyleSheet(compiledStyleSheet);
View Full Code Here


        FormatStylingEngine formatStylingEngine =
                formatRendererContext.getFormatStylingEngine();
        // First add the layout style sheet into the styling engine.
        formatStylingEngine.pushStyleSheet(layoutStyleSheet);
        // Then add the theme style sheet(s) into the styling engine.
        CompiledStyleSheetCollection themeStyleSheets =
                context.getThemeStyleSheets();
        if (themeStyleSheets != null) {
            themeStyleSheets.pushAll(formatStylingEngine);
        }
        // else, allow tests to run without doing the above. Dodgy.

        // Process a nested inclusion, this is done after the page context has been
        // updated in order to make sure that the nesting depth is correct.
        boolean inclusion = (context.getIncludingDeviceLayoutContext() != null);

        if (inclusion) {
            module.beginNestedInclusion();
        }

        module.writeOpenLayout(attributes);

        Fragment fragment = formatRendererContext.getCurrentFragment();
        if (fragment == null) {
            if (logger.isDebugEnabled()) {
                String name =
                        deviceLayout != null ? deviceLayout.getName():null;
                logger.debug("Writing out the Layout named "
                             + name + " to the page");

                // Write the format tree

            }
            Format root = deviceLayout.getRootFormat();
            if (root != null) {
                FormatInstance rootInstance =
                        formatRendererContext.getFormatInstance(
                                root, index);
                formatRendererContext.renderFormat(rootInstance);
            } else {
                if (logger.isDebugEnabled()) {
                    logger.debug("Empty layout");
                }
            }

        } else {
            if (logger.isDebugEnabled()) {
                logger.debug("Writing out the fragment named "
                             + fragment.getName() + " to the page");
            }
            // Write out the fragment and the fragment link list which contains
            // links to the fragment's parent and peer fragments.
            if (!module.getSupportsFragmentLinkListTargetting()) {
                // Write out parent/peer fragment link list *after* the fragment.
                // This is necessary as the fragment link list is being appended to
                // the existing content and must therefore come after it.

                // First, write out the fragment itself
                FormatInstance fragmentInstance =
                        formatRendererContext.getFormatInstance(
                                fragment, index);
                formatRendererContext.renderFormat(fragmentInstance);

                // Then, write out the parent/peer fragment link list.
                writeFragmentLinkList(fragment, formatRendererContext);
            } else {
                // Write out parent/peer fragment link list *before* the fragment.
                // This is necessary as the fragment link list is going into it's
                // own pane which would be empty if we tried to render it before
                // creating them.

                // First, write out parent/peer fragment link list.
                writeFragmentLinkList(fragment, formatRendererContext);
                // Then, write out the fragment itself.
                FormatInstance fragmentInstance =
                        formatRendererContext.getFormatInstance(
                                fragment, index);

                formatRendererContext.renderFormat(fragmentInstance);
            }

        }

        // Write the link to the default segment if necessary.
        SegmentLinkWriter segmentLinkWriter =
                formatRendererContext.getSegmentLinkWriter();
        segmentLinkWriter.writeDefaultSegmentLink();

        module.writeCloseLayout(attributes);

        // Finish processing the nested inclusion.
        if (inclusion) {
            module.endNestedInclusion();
        }

        // Clean up the styling information we added to the styling engine.
        // This should be done in reverse order.
        // First we remove the theme style sheet(s).
        if (themeStyleSheets != null) {
            themeStyleSheets.popAll(formatStylingEngine);
        }
        // else, allow tests to run without the above. Dodgy.

        // Then we remove the layout style sheet.
        formatStylingEngine.popStyleSheet(layoutStyleSheet);
View Full Code Here

        final CompiledStyleSheetMock themeCompiledStyleSheetMock =
                new CompiledStyleSheetMock("themeCompiledStyleSheetMock",
                                           expectations);

        final CompiledStyleSheetCollection compiledStyleSheets =
                new CompiledStyleSheetCollection();

        compiledStyleSheets.addStyleSheet(themeCompiledStyleSheetMock);

        deviceLayoutContextMock.expects.getDeviceLayout()
                .returns(runtimeDeviceLayoutMock).any();
        runtimeDeviceLayoutMock.expects.getCompiledStyleSheet()
                .returns(layoutCompiledStyleSheetMock).any();
View Full Code Here

TOP

Related Classes of com.volantis.mcs.runtime.styling.CompiledStyleSheetCollection

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.