Examples of RenderCommand


Examples of org.apache.tapestry5.runtime.RenderCommand

        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 processInbound, 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)
        {
            String message = ServicesMessages.renderQueueError(command, ex);
View Full Code Here

Examples of org.apache.tapestry5.runtime.RenderCommand

    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

Examples of org.apache.tapestry5.runtime.RenderCommand

    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

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

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

Examples of org.apache.tapestry5.runtime.RenderCommand

    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

Examples of org.apache.tapestry5.runtime.RenderCommand

        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

Examples of org.apache.tapestry5.runtime.RenderCommand

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

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

                pageAssembly.addRenderCommand(command);
            }
        });
    }
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
View Full Code Here

Examples of org.apache.tapestry5.runtime.RenderCommand

            // 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
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.