Package org.apache.tapestry.parse

Examples of org.apache.tapestry.parse.ComponentTemplate


    private ComponentTemplate getOrParseTemplate(IRequestCycle cycle, Resource resource,
            IComponent component)
    {

        ComponentTemplate result = (ComponentTemplate) _templates.get(resource);
        if (result != null)
            return result;

        // Ok, see if it exists.
View Full Code Here


        }

        if (_log.isDebugEnabled())
            _log.debug("Parsed " + tokens.length + " tokens from template");

        return new ComponentTemplate(templateData, tokens);
    }
View Full Code Here

     */

    private void writeTemplate(IMarkupWriter writer, IRequestCycle cycle)
    {
        IComponent inspectedComponent = getInspectedComponent();
        ComponentTemplate template = null;

        try
        {
            template = getTemplateSource().getTemplate(cycle, inspectedComponent);
        }
        catch (Exception ex)
        {
            return;
        }

        writer.begin("pre");

        int count = template.getTokenCount();

        for (int i = 0; i < count; i++)
        {
            TemplateToken token = template.getToken(i);
            TokenType type = token.getType();

            if (type == TokenType.TEXT)
            {
                write(writer, (TextToken) token);
                continue;
            }

            if (type == TokenType.CLOSE)
            {
                write(writer, (CloseToken) token);

                continue;
            }

            if (token.getType() == TokenType.LOCALIZATION)
            {

                write(writer, (LocalizationToken) token);
                continue;
            }

            if (token.getType() == TokenType.OPEN)
            {
                boolean nextIsClose = (i + 1 < count)
                        && (template.getToken(i + 1).getType() == TokenType.CLOSE);

                write(writer, nextIsClose, (OpenToken) token);

                if (nextIsClose)
                    i++;
View Full Code Here

    private BindingSource _bindingSource;

    public void loadTemplate(IRequestCycle requestCycle, ITemplateComponent loadComponent)
    {try { __CLOVER_306_0.M[1465]++;
        __CLOVER_306_0.S[7117]++;ComponentTemplate template = _templateSource.getTemplate(requestCycle, loadComponent);

        __CLOVER_306_0.S[7118]++;ComponentTemplateLoaderLogic logic = new ComponentTemplateLoaderLogic(_log, _pageLoader, _bindingSource);

        __CLOVER_306_0.S[7119]++;logic.loadTemplate(requestCycle, loadComponent, template);
    } finally { }}
View Full Code Here

        __CLOVER_338_0.S[7569]++;Locale locale = component.getPage().getLocale();

        __CLOVER_338_0.S[7570]++;Object key = new MultiKey(new Object[] { resource, locale }, false);

        __CLOVER_338_0.S[7571]++;ComponentTemplate result = searchCache(key);
        __CLOVER_338_0.S[7572]++;if ((((result != null) && (++__CLOVER_338_0.CT[1304] != 0)) || (++__CLOVER_338_0.CF[1304] == 0))){
            __CLOVER_338_0.S[7573]++;return result;}

        __CLOVER_338_0.S[7574]++;result = findTemplate(cycle, resource, component, locale);
View Full Code Here

        __CLOVER_338_0.S[7588]++;String name = resource.getName();
        __CLOVER_338_0.S[7589]++;int dotx = name.lastIndexOf('.');
        __CLOVER_338_0.S[7590]++;String templateBaseName = name.substring(0, dotx + 1) + getTemplateExtension(component);

        __CLOVER_338_0.S[7591]++;ComponentTemplate result =
            findStandardTemplate(cycle, resource, component, templateBaseName, locale);

        __CLOVER_338_0.S[7592]++;if ((((result == null
            && component.getSpecification().isPageSpecification()
            && component.getNamespace().isApplicationNamespace()) && (++__CLOVER_338_0.CT[1309] != 0)) || (++__CLOVER_338_0.CF[1309] == 0))){
View Full Code Here

        IRequestCycle cycle,
        Resource resource,
        IComponent component)
    {try { __CLOVER_338_0.M[1651]++;

        __CLOVER_338_0.S[7618]++;ComponentTemplate result = (ComponentTemplate) _templates.get(resource);
        __CLOVER_338_0.S[7619]++;if ((((result != null) && (++__CLOVER_338_0.CT[1314] != 0)) || (++__CLOVER_338_0.CF[1314] == 0))){
            __CLOVER_338_0.S[7620]++;return result;}

        // Ok, see if it exists.
View Full Code Here

        }

        __CLOVER_338_0.S[7635]++;if ((((_log.isDebugEnabled()) && (++__CLOVER_338_0.CT[1317] != 0)) || (++__CLOVER_338_0.CF[1317] == 0))){
            __CLOVER_338_0.S[7636]++;_log.debug("Parsed " + tokens.length + " tokens from template");}

        __CLOVER_338_0.S[7637]++;return new ComponentTemplate(templateData, tokens);
    } finally { }}
View Full Code Here

        Locale locale = component.getPage().getLocale();

        Object key = new MultiKey(new Object[] { specificationLocation, locale }, false);

        ComponentTemplate result = searchCache(key);
        if (result != null)
            return result;

        result = findTemplate(cycle, specificationLocation, component, locale);
View Full Code Here

        String name = location.getName();
        int dotx = name.lastIndexOf('.');
        String templateBaseName = name.substring(0, dotx + 1) + getTemplateExtension(component);

        ComponentTemplate result =
            findStandardTemplate(cycle, location, component, templateBaseName, locale);

        if (result == null
            && component.getSpecification().isPageSpecification()
            && component.getNamespace().isApplicationNamespace())
View Full Code Here

TOP

Related Classes of org.apache.tapestry.parse.ComponentTemplate

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.