Examples of RenderCommand


Examples of com.example.helloworld.cli.RenderCommand

        return "hello-world";
    }

    @Override
    public void initialize(Bootstrap<HelloWorldConfiguration> bootstrap) {
        bootstrap.addCommand(new RenderCommand());
        bootstrap.addBundle(new AssetsBundle());
        bootstrap.addBundle(new MigrationsBundle<HelloWorldConfiguration>() {
            @Override
            public DataSourceFactory getDataSourceFactory(HelloWorldConfiguration configuration) {
                return configuration.getDataSourceFactory();
View Full Code Here

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

Examples of org.apache.tapestry.runtime.RenderCommand

    @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

Examples of org.apache.tapestry.runtime.RenderCommand

                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

Examples of org.apache.tapestry5.runtime.RenderCommand

        this.ajaxFormUpdateController = ajaxFormUpdateController;
    }

    public void renderMarkup(MarkupWriter writer, final JSONObject reply, PartialMarkupRenderer renderer)
    {
        RenderCommand forZone = new RenderCommand()
        {
            public void render(MarkupWriter writer, RenderQueue queue)
            {
                // Create an element to contain the content for the zone. We give it a mnemonic
                // element name and attribute just to help with debugging (the element itself is discarded).

                final Element zoneContainer = writer.element("zone-update", "zoneId", zoneId);

                ajaxFormUpdateController.setupBeforePartialZoneRender(writer);

                queue.push(new RenderCommand()
                {
                    public void render(MarkupWriter writer, RenderQueue queue)
                    {
                        writer.end(); // the zoneContainer element

                        // Need to do this Ajax Form-related cleanup here, before we extract the zone content.

                        ajaxFormUpdateController.cleanupAfterPartialZoneRender();

                        String zoneUpdateContent = zoneContainer.getChildMarkup();

                        zoneContainer.remove();

                        reply.getJSONObject("zones").put(zoneId, zoneUpdateContent);
                    }
                });

                // Make sure the zone's actual rendering command is processed first, then the inline
                // RenderCommand just above.

                queue.push(zoneRenderCommand);
            }
        };

        RenderCommand existing = queue.getRootRenderCommand();

        queue.initializeForPartialPageRender(new CombinedRenderCommand(existing, forZone));

        renderer.renderMarkup(writer, reply);
    }
View Full Code Here

Examples of org.apache.tapestry5.runtime.RenderCommand

    }

    public void processResultValue(final MultiZoneUpdate value) throws IOException
    {
        // There has to be at least a single command in the queue to force a render.
        queue.initializeForPartialPageRender(new RenderCommand()
        {
            public void render(MarkupWriter writer, RenderQueue queue)
            {
            }
        });

        queue.addPartialMarkupRendererFilter(new SetupZonesFilter());

        Map<String, Object> map = value.getZoneToRenderMap();

        for (String zoneId : map.keySet())
        {
            Object provided = map.get(zoneId);

            RenderCommand zoneRenderCommand = toRenderer(zoneId, provided);

            queue.addPartialMarkupRendererFilter(new SingleZonePartialRendererFilter(zoneId, zoneRenderCommand, queue,
                    ajaxFormUpdateController));
        }
    }
View Full Code Here

Examples of org.apache.tapestry5.runtime.RenderCommand

        this.ajaxFormUpdateController = ajaxFormUpdateController;
    }

    public void processResultValue(final RenderCommand value) throws IOException
    {
        RenderCommand wrapper = new RenderCommand()
        {
            public void render(MarkupWriter writer, RenderQueue queue)
            {
                queue.push(cleanup);
                queue.push(value);
View Full Code Here

Examples of org.apache.tapestry5.runtime.RenderCommand

        configuration.add(CoercionTuple.create(Renderable.class, RenderCommand.class,
                new Coercion<Renderable, RenderCommand>()
                {
                    public RenderCommand coerce(final Renderable input)
                    {
                        return new RenderCommand()
                        {
                            public void render(MarkupWriter writer, RenderQueue queue)
                            {
                                input.render(writer);
                            }
View Full Code Here

Examples of org.apache.tapestry5.runtime.RenderCommand

        configuration.add(CoercionTuple.create(Renderable.class, RenderCommand.class,
                new Coercion<Renderable, RenderCommand>()
                {
                    public RenderCommand coerce(final Renderable input)
                    {
                        return new RenderCommand()
                        {
                            public void render(MarkupWriter writer, RenderQueue queue)
                            {
                                input.render(writer);
                            }
View Full Code Here

Examples of org.apache.tapestry5.runtime.RenderCommand

        if (!callback.isAborted()) return;

        // Here's where it gets very, very tricky.

        final RenderCommand rootRenderCommand = pageRenderQueue.getRootRenderCommand();

        final String formId = request.getParameter(FORMID_PARAMETER);

        if (InternalUtils.isBlank(formId))
            throw new RuntimeException(String.format(
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.