Examples of IContainedComponent


Examples of org.apache.tapestry.spec.IContainedComponent

    }

    public void test_With_Bindings()
    {
        Location l = newLocation();
        IContainedComponent cc = run("componentWithBindings", "getComponentWithBindings", l);

        IBindingSpecification bs1 = cc.getBinding("condition");
        assertSame(l, bs1.getLocation());
        assertEquals(BindingType.PREFIXED, bs1.getType());
        assertEquals("message", bs1.getValue());

        IBindingSpecification bs2 = cc.getBinding("element");
        assertEquals("div", bs2.getValue());
    }
View Full Code Here

Examples of org.apache.tapestry.spec.IContainedComponent

    public void test_Binding_Whitespace_Trimmed()
    {
        Location l = newLocation();

        IContainedComponent cc = run("whitespace", "getWhitespace", l);

        IBindingSpecification bs1 = cc.getBinding("value");
        assertSame(l, bs1.getLocation());
        assertEquals(BindingType.PREFIXED, bs1.getType());
        assertEquals("email", bs1.getValue());

        IBindingSpecification bs2 = cc.getBinding("displayName");
        assertEquals("message:email-label", bs2.getValue());
    }
View Full Code Here

Examples of org.apache.tapestry.spec.IContainedComponent

    public void test_CopyOf()
    {
        Location l = newLocation();
        IComponentSpecification spec = new ComponentSpecification();
        run(spec, "componentWithBindings", "getComponentWithBindings", l);
        IContainedComponent cc = run(spec, "aComponentCopy", "getComponentWithBindingsCopy", l);
       
        IBindingSpecification bs1 = cc.getBinding("condition");
        assertSame(l, bs1.getLocation());
        assertEquals(BindingType.PREFIXED, bs1.getType());
        assertEquals("message", bs1.getValue());

        IBindingSpecification bs2 = cc.getBinding("element");
        assertEquals("div", bs2.getValue());
    }    
View Full Code Here

Examples of org.apache.tapestry.spec.IContainedComponent

        while (i.hasNext())
        {
            String id = (String) i.next();

            IContainedComponent cc = spec.getComponent(id);

            String propertyName = cc.getPropertyName();

            if (propertyName != null)
            {
                try
                {
                    injectComponent(op, id, propertyName);
                }
                catch (Exception ex)
                {
                    _errorLog.error(EnhanceMessages.errorAddingProperty(propertyName, op
                            .getBaseClass(), ex), cc.getLocation(), ex);
                }
            }
        }
    }
View Full Code Here

Examples of org.apache.tapestry.spec.IContainedComponent

    private void checkForDuplicateId(String id, Location location)
    {
        if (id == null)
            return;

        IContainedComponent cc = _loadComponent.getSpecification().getComponent(id);

        if (cc != null)
            throw new ApplicationRuntimeException(ImplMessages.dupeComponentId(id, cc),
                    _loadComponent, location, null);
    }
View Full Code Here

Examples of org.apache.tapestry.spec.IContainedComponent

                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

Examples of org.apache.tapestry.spec.IContainedComponent

                type = resolveComponentType(retTypeClazz);
            }
            copyOf = null;
        }
       
        IContainedComponent cc = new ContainedComponent();

        cc.setInheritInformalParameters(component.inheritInformalParameters());
        cc.setType(type);
        cc.setCopyOf(copyOf);
        cc.setPropertyName(propertyName);
        cc.setLocation(location);

        for (String binding : component.bindings())
        {
            addBinding(cc, binding, location);
        }

        String id = component.id();

        if (id.equals(""))
            id = propertyName;
       
        spec.addComponent(id, cc);
       
        if (hasCopyOf)
        {
            IContainedComponent source = spec.getComponent(copyOf);
            if (source != null)               
                AnnotationUtils.copyBindings(source, cc);
        }
    }
View Full Code Here

Examples of org.apache.tapestry.spec.IContainedComponent

    }

    public void testComponentProperty() throws Exception
    {
        IComponentSpecification s = parseComponent("ComponentProperty.jwc");
        IContainedComponent c = s.getComponent("barney");

        checkList("propertyNames", new String[]
        { "apple", "chocolate", "frozen" }, c.getPropertyNames());

        checkProperty(c, "apple", "pie");
        checkProperty(c, "chocolate", "cake");
        checkProperty(c, "frozen", "yogurt");
View Full Code Here

Examples of org.apache.tapestry.spec.IContainedComponent

    }

    private void copyBindings(String sourceComponentId, IComponentSpecification cs,
            IContainedComponent target)
    {
        IContainedComponent source = cs.getComponent(sourceComponentId);
        if (source == null)
            throw new DocumentParseException(ParseMessages.unableToCopy(sourceComponentId),
                    getLocation(), null);

        Iterator i = source.getBindingNames().iterator();
        while (i.hasNext())
        {
            String bindingName = (String) i.next();
            IBindingSpecification binding = source.getBinding(bindingName);
            target.setBinding(bindingName, binding);
        }

        target.setType(source.getType());
    }
View Full Code Here

Examples of org.apache.tapestry.spec.IContainedComponent

                "name",
                PARAMETER_NAME_PATTERN,
                "invalid-parameter-name");
        String value = getAttribute("value");

        IContainedComponent cc = (IContainedComponent) peekObject();

        BindingSetter bs = new BindingSetter(cc, name, value);

        push(_elementName, bs, STATE_BINDING, 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.