Package org.apache.tapestry5.runtime

Examples of org.apache.tapestry5.runtime.RenderCommand


        {
            public void execute(PageAssembly pageAssembly)
            {
                if (!pageAssembly.checkAndSetFlag("dtd-page-element-added"))
                {
                    RenderCommand command = new DTDPageElement(token.getName(), token.getPublicId(), token
                            .getSystemId());

                    // It doesn't really matter where this ends up in the tree as long as its inside
                    // a portion that always renders.
View Full Code Here


    private void comment(AssemblerContext context)
    {
        CommentToken token = context.next(CommentToken.class);

        RenderCommand commentElement = new CommentPageElement(token.getComment());

        context.addComposable(commentElement);
    }
View Full Code Here

    private void element(AssemblerContext context)
    {
        StartElementToken token = context.next(StartElementToken.class);

        RenderCommand element = new StartElementPageElement(token.getNamespaceURI(), token.getName());

        context.addComposable(element);

        while (true)
        {
View Full Code Here

        String value = token.getValue();

        // No expansion makes this easier, more efficient.
        if (value.indexOf(InternalConstants.EXPANSION_START) < 0)
        {
            RenderCommand command = new RenderAttribute(token);

            context.addComposable(command);

            return;
        }

        context.add(new PageAssemblyAction()
        {
            public void execute(PageAssembly pageAssembly)
            {
                InternalComponentResources resources = pageAssembly.activeElement.peek().getComponentResources();

                RenderCommand command = elementFactory.newAttributeElement(resources, token);

                pageAssembly.addRenderCommand(command);
            }
        });
    }
View Full Code Here

        {
            public void execute(PageAssembly pageAssembly)
            {
                ComponentResources resources = pageAssembly.activeElement.peek().getComponentResources();

                RenderCommand command = elementFactory.newExpansionElement(resources, token);

                pageAssembly.addRenderCommand(command);
            }
        });
    }
View Full Code Here

        Page page = cache.get(pageName);

        String nestedId = resources.getNestedId();

        RenderCommand command = page.getComponentElementByNestedId(nestedId);

        masterProcessor.processResultValue(command);
    }
View Full Code Here

        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

            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

        if (!handled.contains(BeforeRenderTemplate.class))
            beforeRenderTemplatePhase = new RenderTemplatePhase();

        if (!handled.contains(BeginRender.class))
        {
            RenderCommand replacement = afterRenderPhase != null ? new OptimizedBeginRenderPhase()
                    : beforeRenderTemplatePhase;

            beginRenderPhase = replacement;
        }
View Full Code Here

        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(mergeRenderCommands(existing, forZone));

        renderer.renderMarkup(writer, reply);
    }
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.