Package org.apache.tapestry.runtime

Examples of org.apache.tapestry.runtime.RenderCommand


public class RenderQueueImplTest extends InternalBaseTestCase
{
    @Test
    public void run_commands()
    {
        final RenderCommand command2 = newMock(RenderCommand.class);
        RenderCommand command1 = new RenderCommand()
        {
            public void render(MarkupWriter writer, RenderQueue queue)
            {
                queue.push(command2);
            }
View Full Code Here


    @Test
    public void command_failed()
    {
        final RuntimeException t = new RuntimeException("Oops.");

        RenderCommand rc = new RenderCommand()
        {

            public void render(MarkupWriter writer, RenderQueue queue)
            {
                throw t;
View Full Code Here

                return true; // abort other handler methods
            }

            if (result instanceof RenderCommand)
            {
                RenderCommand command = (RenderCommand) result;

                add(command);

                return false; // do not abort!
            }
View Full Code Here

                return true; // abort other handler methods
            }

            if (result instanceof RenderCommand)
            {
                RenderCommand command = (RenderCommand) result;

                add(command);

                return false; // do not abort!
            }

            if (result instanceof Renderable)
            {
                final Renderable renderable = (Renderable) result;

                RenderCommand wrapper = new RenderCommand()
                {
                    public void render(MarkupWriter writer, RenderQueue queue)
                    {
                        renderable.render(writer);
                    }
View Full Code Here

        _queue.push(command);
    }

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

        // 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())
            {
                command = _queue.pop();

                if (_log.isDebugEnabled())
                    _log.debug(String.format("Executing: %s", 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

        _queue.push(command);
    }

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

        boolean traceEnabled = _logger.isTraceEnabled();

        // 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())
            {
                command = _queue.pop();

                if (traceEnabled) _logger.trace(String.format("Executing: %s", 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

        String nestedId = resources.getNestedId();

        // The user may return a complete page instance, which isn't really a partial render, I guess.
        // Depends on the structure of the page returned.

        RenderCommand command = nestedId == null ? page.getRootElement() : page.getComponentElementByNestedId(nestedId);

        _renderer.renderPartialPageMarkup(command);
    }
View Full Code Here

public class RenderQueueImplTest extends InternalBaseTestCase
{
    @Test
    public void run_commands()
    {
        final RenderCommand command2 = newMock(RenderCommand.class);
        RenderCommand command1 = new RenderCommand()
        {
            public void render(MarkupWriter writer, RenderQueue queue)
            {
                queue.push(command2);
            }
View Full Code Here

        ComponentResources bar = mockInternalComponentResources();
        ComponentResources baz = mockInternalComponentResources();

        final RuntimeException t = new RuntimeException("Oops.");

        RenderCommand rc = new RenderCommand()
        {

            public void render(MarkupWriter writer, RenderQueue queue)
            {
                throw t;
View Full Code Here

public class RenderQueueImplTest extends InternalBaseTestCase
{
    @Test
    public void run_commands()
    {
        final RenderCommand command2 = newMock(RenderCommand.class);
        RenderCommand command1 = new RenderCommand()
        {
            public void render(MarkupWriter writer, RenderQueue queue)
            {
                queue.push(command2);
            }
View Full Code Here

TOP

Related Classes of org.apache.tapestry.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.