Package org.apache.tapestry5.model

Examples of org.apache.tapestry5.model.ComponentModel


    @Test
    public void get_mixin_by_class_name()
    {
        Page page = newPage(PAGE_NAME);
        Component component = mockComponent();
        ComponentModel model = mockComponentModel();
        final String mixinClassName = "foo.Bar";
        Component mixin = mockComponent();
        ComponentModel mixinModel = mockComponentModel();
        Logger logger = mockLogger();
        Logger eventLogger = mockLogger();
        PageResources pr = mockPageResources(logger, eventLogger);

        train_getLogger(model, logger);
View Full Code Here


    @Test
    public void get_mixin_by_unknown_class_name()
    {
        Page page = newPage(PAGE_NAME);
        Component component = mockComponent();
        ComponentModel model = mockComponentModel();
        Component mixin = mockComponent();
        ComponentModel mixinModel = mockComponentModel();
        Logger logger = mockLogger();
        Logger eventLogger = mockLogger();
        PageResources pr = mockPageResources(logger, eventLogger);

        train_getLogger(model, logger);
View Full Code Here

    @Test
    public void set_explicit_parameter_of_unknown_mixin()
    {
        Page page = newPage(PAGE_NAME);
        Component component = mockComponent();
        ComponentModel model = mockComponentModel();
        ComponentModel mixinModel = mockComponentModel();
        Component mixin = mockComponent();
        Binding binding = mockBinding();
        Logger logger = mockLogger();
        Logger eventLogger = mockLogger();
        PageResources pr = mockPageResources(logger, eventLogger);
View Full Code Here

                        // trigger transformations of any base classes.

                        final ClassInstantiator<Component> plasticInstantiator = manager
                                .getClassInstantiator(className);

                        final ComponentModel model = classToModel.get(className);

                        return new Instantiator()
                        {
                            public Component newInstance(InternalComponentResources resources)
                            {
View Full Code Here

                        String className = plasticClass.getClassName();
                        String parentClassName = plasticClass.getSuperClassName();

                        // The parent model may not exist, if the super class is not in a controlled package.

                        ComponentModel parentModel = classToModel.get(parentClassName);

                        final boolean isRoot = parentModel == null;

                        if (isRoot
                                && !(parentClassName.equals("java.lang.Object") || parentClassName
View Full Code Here

        template.add(element);
    }

    private void addUnboundParameterNames(String prefix, List<String> unbound, InternalComponentResources resource)
    {
        ComponentModel model = resource.getComponentModel();

        for (String name : model.getParameterNames())
        {
            if (resource.isBound(name))
                continue;

            ParameterModel parameterModel = model.getParameterModel(name);

            if (parameterModel.isRequired())
            {
                String fullName = prefix == null ? name : prefix + "." + name;
View Full Code Here

        {
            public ComponentAssembler invoke()
            {
                Instantiator instantiator = instantiatorSource.getInstantiator(className);

                ComponentModel componentModel = instantiator.getModel();

                ComponentTemplate template = templateSource.getTemplate(componentModel, selector);

                ComponentPageElementResources resources = resourcesSource.get(selector);
View Full Code Here

    private List<ComponentTemplate> buildOverrideSearch(ComponentAssembler assembler, ComponentTemplate template)
    {
        List<ComponentTemplate> result = CollectionFactory.newList();
        result.add(template);

        ComponentModel model = assembler.getModel();

        ComponentTemplate lastTemplate = template;

        while (lastTemplate.isExtension())
        {
            ComponentModel parentModel = model.getParentModel();

            if (parentModel == null) { throw new RuntimeException(PageloadMessages.noParentForExtension(model)); }

            ComponentTemplate parentTemplate = templateSource.getTemplate(parentModel, assembler.getSelector());
View Full Code Here

    {
        // TODO: Much more, this is an area where we can make things a bit more efficient by tracking
        // what has and hasn't been bound in the EmbeddedComponentAssembler (and identifying what is
        // and isn't informal).

        ComponentModel model = embedded.getComponentResources().getComponentModel();

        Map<String, Binding> informals = container.getInformalParameterBindings();

        for (String name : informals.keySet())
        {
            if (model.getParameterModel(name) != null)
                continue;

            Binding binding = informals.get(name);

            embedded.bindParameter(name, binding);
View Full Code Here

    {
        for (String className : instantiator.getModel().getMixinClassNames())
        {
            Instantiator mixinInstantiator = instantiatorSource.getInstantiator(className);

            ComponentModel model = instantiator.getModel();
            element.addMixin(InternalUtils.lastTerm(className), mixinInstantiator, model.getOrderForMixin(className));
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.model.ComponentModel

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.