Package org.apache.tapestry.spec

Examples of org.apache.tapestry.spec.IContainedComponent


    public void testComponentInjectProperty() throws Exception
    {
        IComponentSpecification cs = parseComponent("ComponentInjectProperty.jwc");

        IContainedComponent cc = cs.getComponent("body");

        assertEquals("myProperty", cc.getPropertyName());

        cc = cs.getComponent("fred");

        assertNull(cc.getPropertyName());
    }
View Full Code Here


    public void testComponentCopyOf() throws Exception
    {
        IComponentSpecification cs = parseComponent("ComponentCopyOf.jwc");

        IContainedComponent source = cs.getComponent("source");
        IContainedComponent copy = cs.getComponent("copy");
        IContainedComponent override = cs.getComponent("override");

        assertEquals("Insert", source.getType());
        assertEquals("Insert", copy.getType());
        assertEquals("Insert", override.getType());

        IBindingSpecification b = source.getBinding("value");

        assertEquals(BindingType.PREFIXED, b.getType());
        assertEquals("ognl:date", b.getValue());

        assertSame(b, copy.getBinding("value"));

        IBindingSpecification b2 = override.getBinding("value");
        assertEquals("ognl:tomorrow", b2.getValue());

        b = copy.getBinding("foo");

        assertSame(b, override.getBinding("foo"));

        b = copy.getBinding("formatter");

        assertSame(b, override.getBinding("formatter"));
    }
View Full Code Here

    public void testContainedComponent()
    {
        Creator creator = new Creator();

        IContainedComponent cc = newContainedComponent();

        replayControls();

        IComponent component = (IComponent) creator.newInstance(BaseComponent.class);
View Full Code Here

    public void testContainedComponentConflict()
    {
        Creator creator = new Creator();

        IContainedComponent cc1 = newContainedComponent();
        IContainedComponent cc2 = newContainedComponent();

        IPage page = newPage("Fred");

        trainGetIdPath(page, null);
View Full Code Here

public class TestInjectComponentWorker extends HiveMindTestCase
{
    private IComponentSpecification newSpec(String componentId, String propertyName,
            Location location)
    {
        IContainedComponent cc = new ContainedComponent();
        cc.setPropertyName(propertyName);
        cc.setLocation(location);

        MockControl control = newControl(IComponentSpecification.class);
        IComponentSpecification spec = (IComponentSpecification) control.getMock();

        spec.getComponentIds();
View Full Code Here

                String id = (String) ids.get(i);

                // Get the sub-component specification from the
                // container's specification.

                IContainedComponent contained = containerSpec.getComponent(id);

                String type = contained.getType();
                Location location = contained.getLocation();

                _componentResolver.resolve(cycle, namespace, type, location);

                IComponentSpecification componentSpecification = _componentResolver
                        .getSpecification();
View Full Code Here

        _componentResolver.resolve(cycle, container.getNamespace(), componentType, location);

        INamespace componentNamespace = _componentResolver.getNamespace();
        IComponentSpecification spec = _componentResolver.getSpecification();

        IContainedComponent contained = new ContainedComponent();
        contained.setLocation(location);
        contained.setType(componentType);

        IComponent result = instantiateComponent(
                page,
                container,
                componentId,
View Full Code Here

        IComponent container = getCurrentComponent().getContainer();

        IComponentSpecification containerSpecification = container.getSpecification();

        String id = getCurrentComponent().getId();
        IContainedComponent contained = containerSpecification.getComponent(id);

        // Temporary: An implicit component will not be in the containing
        // component's specification as a ContainedComponent.

        if (contained == null)
            return null;

        return contained.getType();
    }
View Full Code Here

        IComponent container = _component.getContainer();

        IComponentSpecification containerSpecification = container.getSpecification();

        String id = _component.getId();
        IContainedComponent contained = containerSpecification.getComponent(id);

        // Temporary:  An implicit component will not be in the containing
        // component's specification as a ContainedComponent.

        if (contained == null)
            return null;

        return contained.getType();
    }
View Full Code Here

                String id = (String) ids.get(i);

                // Get the sub-component specification from the
                // container's specification.

                IContainedComponent contained = containerSpec.getComponent(id);

                String type = contained.getType();
                Location location = contained.getLocation();

                _componentResolver.resolve(cycle, namespace, type, location);

                IComponentSpecification componentSpecification = _componentResolver
                        .getSpecification();
View Full Code Here

TOP

Related Classes of org.apache.tapestry.spec.IContainedComponent

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.