Examples of ComponentModel


Examples of org.apache.tapestry5.model.ComponentModel

            return model.getComponentClassName();
        }

        public MessagesBundle getParent()
        {
            ComponentModel parentModel = model.getParentModel();

            if (parentModel == null)
                return appCatalogBundle;

            return new ComponentModelBundle(parentModel);
View Full Code Here

Examples of org.apache.tapestry5.model.ComponentModel

    @Test
    public void caching()
    {
        TemplateParser parser = mockTemplateParser();
        ComponentTemplate template = mockComponentTemplate();
        ComponentModel model = mockComponentModel();
        Resource resource = mockResource();
        ComponentResourceLocator locator = mockLocator(model, english, resource);

        train_getComponentClassName(model, PACKAGE + ".Fred");
View Full Code Here

Examples of org.apache.tapestry5.model.ComponentModel

    @Test
    public void invalidation() throws Exception
    {
        File rootDir = createClasspathRoot();
        URLClassLoader loader = newLoaderWithClasspathRoot(rootDir);
        ComponentModel model = mockComponentModel();

        File packageDir = new File(rootDir, "baz");
        packageDir.mkdirs();

        File f = new File(packageDir, "Biff.tml");
View Full Code Here

Examples of org.apache.tapestry5.model.ComponentModel

    public void localization_to_same()
    {
        Resource resource = mockResource();
        TemplateParser parser = mockTemplateParser();
        ComponentTemplate template = mockComponentTemplate();
        ComponentModel model = mockComponentModel();
        ComponentResourceLocator locator = newMock(ComponentResourceLocator.class);

        train_getComponentClassName(model, PACKAGE + ".Fred");

        expect(locator.locateTemplate(model, english)).andReturn(resource).once();
View Full Code Here

Examples of org.apache.tapestry5.model.ComponentModel

    @Test
    public void no_template_found()
    {
        TemplateParser parser = mockTemplateParser();
        ComponentModel model = mockComponentModel();
        Resource baseResource = mockResource();
        Resource missingResource = mockResource();

        train_getComponentClassName(model, PACKAGE + ".Barney");
View Full Code Here

Examples of org.apache.tapestry5.model.ComponentModel

    @Test
    public void child_component_inherits_parent_template()
    {
        TemplateParser parser = mockTemplateParser();
        ComponentTemplate template = mockComponentTemplate();
        ComponentModel model = mockComponentModel();
        ComponentModel parentModel = mockComponentModel();
        Resource resource = mockResource();
        ComponentResourceLocator locator = mockLocator(model, english, null);

        train_getComponentClassName(model, "foo.Bar");
View Full Code Here

Examples of org.apache.tapestry5.model.ComponentModel

        return parser.parseTemplate(r);
    }

    private Resource locateTemplateResource(ComponentModel initialModel, Locale locale)
    {
        ComponentModel model = initialModel;
        while (model != null)
        {

            Resource baseResource = baseResourceForModel(model);
            Resource localized = baseResource.forLocale(locale);

            // In a race condition, we may hit this method a couple of times, and overwrite previous
            // results with identical new results.

            // If found a properly localized version of the base resource for the model,
            // then we've found a match (even if we had to ascend a couple of levels
            // to reach it).

            if (localized != null) return localized;

            // Not on the classpath, the the locator see if its a) a page and b) a resource inside
            // the context

            localized = locator.findPageTemplateResource(model, locale);

            if (localized != null) return localized;

            // Otherwise, this component doesn't have its own template ... lets work up to its
            // base class and check there.

            model = model.getParentModel();
        }

        // This will be a Resource whose URL is null, which will be picked up later and force the
        // return of the empty template.
View Full Code Here

Examples of org.apache.tapestry5.model.ComponentModel

    @Test
    public void declared_parameter_names_does_not_include_superclass_parameters()
    {
        Resource r = mockResource();
        Logger logger = mockLogger();
        ComponentModel parent = mockComponentModel();

        train_getPersistentFieldNames(parent);
        train_getParameterNames(parent, "betty");

        expect(parent.getParameterModel("fred")).andReturn(null);
        expect(parent.getParameterModel("wilma")).andReturn(null);
        expect(parent.getParameterModel("barney")).andReturn(null);

        replay();

        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, logger, r, parent, false);
View Full Code Here

Examples of org.apache.tapestry5.model.ComponentModel

    {
        Resource r = mockResource();
        Logger logger = mockLogger();

        replay();
        ComponentModel model = new MutableComponentModelImpl(CLASS_NAME, logger, r, null, false);

        assertTrue(model.getMixinClassNames().isEmpty());

        verify();
    }
View Full Code Here

Examples of org.apache.tapestry5.model.ComponentModel

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