Examples of BlockToken


Examples of org.apache.tapestry.internal.parser.BlockToken

    @Test
    public void block_element()
    {
        List<TemplateToken> tokens = tokens("block_element.html");

        BlockToken token2 = get(tokens, 2);
        assertEquals(token2.getId(), "block0");

        CommentToken token4 = get(tokens, 4);
        assertEquals(token4.getComment(), "block0 content");

        BlockToken token8 = get(tokens, 8);
        assertNull(token8.getId());

        CommentToken token10 = get(tokens, 10);
        assertEquals(token10.getComment(), "anon block content");
    }
View Full Code Here

Examples of org.apache.tapestry.internal.parser.BlockToken

    @Test
    public void block_element()
    {
        List<TemplateToken> tokens = tokens("block_element.tml");

        BlockToken token2 = get(tokens, 2);
        assertEquals(token2.getId(), "block0");

        CommentToken token4 = get(tokens, 4);
        assertEquals(token4.getComment(), "block0 content");

        BlockToken token8 = get(tokens, 8);
        assertNull(token8.getId());

        CommentToken token10 = get(tokens, 10);
        assertEquals(token10.getComment(), "anon block content");
    }
View Full Code Here

Examples of org.apache.tapestry.internal.parser.BlockToken

    {
        String blockId = findSingleParameter("block", "id", attributes);

        // null is ok for blockId

        _tokens.add(new BlockToken(blockId, getCurrentLocation()));
    }
View Full Code Here

Examples of org.apache.tapestry.internal.parser.BlockToken

    {
        String blockId = findSingleParameter("block", "id", attributes);

        // null is ok for blockId

        _tokens.add(new BlockToken(blockId, getCurrentLocation()));
    }
View Full Code Here

Examples of org.apache.tapestry.internal.parser.BlockToken

    @Test
    public void block_element()
    {
        List<TemplateToken> tokens = tokens("block_element.html");

        BlockToken token2 = get(tokens, 2);
        assertEquals(token2.getId(), "block0");

        CommentToken token4 = get(tokens, 4);
        assertEquals(token4.getComment(), "block0 content");

        BlockToken token8 = get(tokens, 8);
        assertNull(token8.getId());

        CommentToken token10 = get(tokens, 10);
        assertEquals(token10.getComment(), "anon block content");
    }
View Full Code Here

Examples of org.apache.tapestry.internal.parser.BlockToken

    {
        String blockId = findSingleParameter("block", "id", attributes);

        // null is ok for blockId

        _tokens.add(new BlockToken(blockId, getCurrentLocation()));
    }
View Full Code Here

Examples of org.apache.tapestry.internal.parser.BlockToken

    @Test
    public void block_element()
    {
        List<TemplateToken> tokens = tokens("block_element.html");

        BlockToken token2 = get(tokens, 2);
        assertEquals(token2.getId(), "block0");

        CommentToken token4 = get(tokens, 4);
        assertEquals(token4.getComment(), "block0 content");

        BlockToken token8 = get(tokens, 8);
        assertNull(token8.getId());

        CommentToken token10 = get(tokens, 10);
        assertEquals(token10.getComment(), "anon block content");
    }
View Full Code Here

Examples of org.apache.tapestry.internal.parser.BlockToken

    {
        String blockId = findSingleParameter("block", "id", attributes);

        // null is ok for blockId

        _tokens.add(new BlockToken(blockId, getCurrentLocation()));
        _endTagHandlerStack.push(_addEndElementToken);
    }
View Full Code Here

Examples of org.apache.tapestry5.internal.parser.BlockToken

        consumeToEndElementAndPopBodyElement(context);
    }

    private void block(AssemblerContext context)
    {
        final BlockToken token = context.next(BlockToken.class);

        context.add(new PageAssemblyAction()
        {
            public void execute(PageAssembly pageAssembly)
            {
                String blockId = token.getId();

                ComponentPageElement element = pageAssembly.activeElement.peek();

                String description = blockId == null ? interner.format("Anonymous within %s", element.getCompleteId())
                        : interner.format("%s within %s", blockId, element.getCompleteId());

                BlockImpl block = new BlockImpl(token.getLocation(), description);

                if (blockId != null)
                    element.addBlock(blockId, block);

                // Start directing template content into the Block
View Full Code Here

Examples of org.apache.tapestry5.internal.parser.BlockToken

    {
        String blockId = getSingleParameter("id");

        validateId(blockId, "invalid-block-id");

        tokenAccumulator.add(new BlockToken(blockId, getLocation()));

        processBody(state.insideComponent(false));
    }
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.