Package org.apache.tapestry5.runtime

Examples of org.apache.tapestry5.runtime.RenderCommand


    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

        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
View Full Code Here

            // The AjaxResponseRenderer will convert the object to a RenderCommand, but does nothing special if there's a failure
            // (because the stack trace will clearly identify what's going on). We do the conversion here so that we can relate
            // a failure to a zone id. It will just be a pass-thru on the second type coercion.

            RenderCommand zoneRenderCommand = toRenderer(zoneId, provided);

            ajaxResponseRenderer.addRender(zoneId, zoneRenderCommand);
        }

        partialRenderer.renderPartialPageMarkup();
View Full Code Here

        {
            public RenderCommand createRenderCommand(final DynamicDelegate delegate)
            {
                final Mapper<DynamicTemplateElement, RenderCommand> toRenderCommand = createToRenderCommandMapper(delegate);

                return new RenderCommand()
                {
                    public void render(MarkupWriter writer, RenderQueue queue)
                    {
                        Worker<RenderCommand> pushOnQueue = createQueueRenderCommand(queue);
View Full Code Here

        };
    }

    private static RenderCommand toRenderCommand(final DynamicTemplateElement value, final DynamicDelegate delegate)
    {
        return new RenderCommand()
        {
            public void render(MarkupWriter writer, RenderQueue queue)
            {
                value.render(writer, queue, delegate);
            }
View Full Code Here

    public AjaxResponseRenderer addRender(String clientId, Object renderer)
    {
        assert InternalUtils.isNonBlank(clientId);
        assert renderer != null;

        RenderCommand command = typeCoercer.coerce(renderer, RenderCommand.class);

        addFilter(new SingleZonePartialRendererFilter(clientId, command, queue, ajaxFormUpdateController));

        return this;
    }
View Full Code Here

     * @param isLast if true, add "t-last" attribute to the LI element
     * @return command to render the node
     */
    private RenderCommand toRenderCommand(final TreeNode node, final boolean isLast)
    {
        return new RenderCommand()
        {
            public void render(MarkupWriter writer, RenderQueue queue)
            {
                // Inform the component's container about what value is being rendered
                // (this may be necessary to generate the correct label for the node).
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.