Package org.apache.tapestry5.ioc.util

Examples of org.apache.tapestry5.ioc.util.LocalizedNameGenerator


        }
    }

    private Resource findLocalizedResource(Locale locale)
    {
        for (String path : new LocalizedNameGenerator(this.path, locale))
        {
            Resource potential = createResource(path);

            if (potential.exists())
                return potential;
View Full Code Here


public class LocalizedNameGeneratorTest extends IOCTestCase
{

    private void run(String path, Locale locale, String... expected)
    {
        LocalizedNameGenerator g = new LocalizedNameGenerator(path, locale);

        for (String s : expected)
        {
            assertTrue(g.hasNext());
            assertEquals(g.next(), s);
        }

        assertFalse(g.hasNext());
    }
View Full Code Here

    public List<Resource> locateMessageCatalog(final Resource baseResource, ComponentResourceSelector selector)
    {
        String baseName = baseResource.getFile();

        return F.flow(new LocalizedNameGenerator(baseName, selector.locale).iterator()).map(new Mapper<String, Resource>()
        {
            public Resource map(String element)
            {
                return baseResource.forFile(element);
            }
View Full Code Here

        }
    }

    private Resource findLocalizedResource(Locale locale)
    {
        for (String path : new LocalizedNameGenerator(this.path, locale))
        {
            Resource potential = createResource(path);

            if (potential.exists())
                return potential;
View Full Code Here

    public List<Resource> locateMessageCatalog(final Resource baseResource, ComponentResourceSelector selector)
    {
        String baseName = baseResource.getFile();

        return F.flow(new LocalizedNameGenerator(baseName, selector.locale)).map(new Mapper<String, Resource>()
        {
            public Resource map(String element)
            {
                return baseResource.forFile(element);
            }
View Full Code Here

        }
    }

    private Resource findLocalizedResource(Locale locale)
    {
        for (String path : new LocalizedNameGenerator(this.path, locale))
        {
            Resource potential = createResource(path);

            if (potential.exists())
                return potential;
View Full Code Here

        if (baseName == null)
        {
            return Arrays.asList(baseResource.forLocale(selector.locale));
        }

        return F.flow(new LocalizedNameGenerator(baseName, selector.locale).iterator()).map(new Mapper<String, Resource>()
        {
            public Resource map(String element)
            {
                return baseResource.forFile(element);
            }
View Full Code Here

        return createResource(builder.toString());
    }

    public final Resource forLocale(Locale locale)
    {
        for (String path : new LocalizedNameGenerator(this.path, locale))
        {
            Resource potential = createResource(path);

            if (potential.exists())
                return potential;
View Full Code Here

        }

        // Let subclasses do more.
        configure(config);

        renderSupport.addInit("autocompleter", new JSONArray(id, menuId, link.toAbsoluteURI(), config));
    }
View Full Code Here

        "class", "t-autocomplete-menu");
        writer.end();

        Link link = resources.createEventLink(EVENT_NAME);

        JSONObject config = new JSONObject();
        config.put("paramName", PARAM_NAME);
        config.put("indicator", loaderId);

        if (resources.isBound("minChars"))
            config.put("minChars", minChars);

        if (resources.isBound("frequency"))
            config.put("frequency", frequency);

        if (resources.isBound("tokens"))
        {
            for (int i = 0; i < tokens.length(); i++)
            {
                config.accumulate("tokens", tokens.substring(i, i + 1));
            }
        }

        // Let subclasses do more.
        configure(config);
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.ioc.util.LocalizedNameGenerator

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.