Package org.apache.tapestry5.runtime

Examples of org.apache.tapestry5.runtime.RenderCommand


        // text or comment content "inside" the BODY.
    }

    private void comment(CommentToken token)
    {
        RenderCommand commentElement = new CommentPageElement(token.getComment());

        addComposableCommand(commentElement);
    }
View Full Code Here


        command.run();
    }

    private void expansion(ExpansionToken token)
    {
        RenderCommand element = pageElementFactory.newExpansionElement(loadingElement
                .getComponentResources(), token);

        addComposableCommand(element);
    }
View Full Code Here

        return result;
    }

    private void cdata(final CDATAToken token)
    {
        RenderCommand element = new RenderCommand()
        {
            public void render(MarkupWriter writer, RenderQueue queue)
            {
                writer.cdata(token.getContent());
            }
View Full Code Here

        addComposableCommand(element);
    }

    private void defineNamespacePrefix(final DefineNamespacePrefixToken token)
    {
        RenderCommand element = new RenderCommand()
        {
            public void render(MarkupWriter writer, RenderQueue queue)
            {
                writer.defineNamespace(token.getNamespaceURI(), token.getNamespacePrefix());
            }
View Full Code Here

        }
    }

    private void startElement(StartElementToken token)
    {
        RenderCommand element = new StartElementPageElement(token.getNamespaceURI(), token.getName());

        addComposableCommand(element);

        // Controls how attributes are interpretted.
        addAttributesAsComponentBindings = false;
View Full Code Here

        configureEnd(false, NO_OP);
    }

    private void text(TextToken token)
    {
        RenderCommand element = new TextPageElement(token.getText());

        addComposableCommand(element);
    }
View Full Code Here

    private void dtd(DTDToken token)
    {
        // first DTD encountered wins.
        if (dtdAdded) return;

        RenderCommand element = new DTDPageElement(token.getName(), token.getPublicId(), token.getSystemId());
        // since rendering via the markup writer is to the document tree,
        // we don't really care where this gets placed in the tree; the
        // DTDPageElement will set the dtd of the document directly, rather than
        // writing anything to the markup writer
        page.getRootElement().addToTemplate(element);
View Full Code Here

        queue.push(command);
    }

    public void run(MarkupWriter writer)
    {
        RenderCommand command = null;

        boolean traceEnabled = logger.isTraceEnabled(TapestryMarkers.RENDER_COMMANDS);

        long startNanos = System.nanoTime();
        int commandCount = 0;
        int maxDepth = 0;

        // Seems to make sense to use one try/finally around the whole process, rather than
        // around each call to render() since the end result (in a failure scenario) is the same.

        try
        {
            while (!queue.isEmpty())
            {
                maxDepth = Math.max(maxDepth, queue.getDepth());

                command = queue.pop();

                commandCount++;

                if (traceEnabled) logger.trace(TapestryMarkers.RENDER_COMMANDS, "Executing: {}", command);

                command.render(writer, this);
            }
        }
        catch (RuntimeException ex)
        {
            // This will likely leave the page in a dirty state, and it will not go back into the
View Full Code Here

    private void cdata(AssemblerContext context)
    {
        final CDATAToken token = context.next(CDATAToken.class);

        RenderCommand command = new RenderCommand()
        {
            public void render(MarkupWriter writer, RenderQueue queue)
            {
                writer.cdata(token.getContent());
            }
View Full Code Here

    private void defineNamespacePrefix(AssemblerContext context)
    {
        final DefineNamespacePrefixToken token = context.next(DefineNamespacePrefixToken.class);

        RenderCommand command = new RenderCommand()
        {
            public void render(MarkupWriter writer, RenderQueue queue)
            {
                writer.defineNamespace(token.getNamespaceURI(), token.getNamespacePrefix());
            }
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.runtime.RenderCommand

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.