Package org.apache.tapestry

Examples of org.apache.tapestry.IAsset


     */

    private ComponentTemplate findTemplate(IRequestCycle cycle, Resource resource,
            IComponent component, Locale locale)
    {
        IAsset templateAsset = component.getAsset(TEMPLATE_ASSET_NAME);

        if (templateAsset != null)
            return readTemplateFromAsset(cycle, component, templateAsset);

        String name = resource.getName();
View Full Code Here


        {
            String name = (String) i.next();

            IAssetSpecification assetSpec = specification.getAsset(name);

            IAsset asset = convertAsset(assetSpec);

            component.addAsset(name, asset);
        }
    }
View Full Code Here

    }
   
    protected void renderFormComponent(IMarkupWriter writer, IRequestCycle cycle)
    {
        boolean disabled = isDisabled();
        IAsset disabledImage = getDisabledImage();

        IAsset finalImage = (disabled && disabledImage != null) ? disabledImage : getImage();

        String imageURL = finalImage.buildURL();

        writer.beginEmpty("input");
        writer.attribute("type", "image");
        writer.attribute("name", getName());
       
View Full Code Here

@Test
public class TestImageSubmit extends BaseFormComponentTestCase
{
    protected IAsset newAsset(IRequestCycle cycle, String imageURL)
    {
        IAsset asset = newMock(IAsset.class);
        checkOrder(asset, false);
       
        expect(asset.buildURL()).andReturn(imageURL);

        return asset;
    }
View Full Code Here

    {
        IValidationDelegate delegate = newDelegate();
        IForm form = newForm();
        IRequestCycle cycle = newCycle();
        IMarkupWriter writer = newWriter();
        IAsset image = newAsset(cycle, "image-url");
       
        Creator creator = new Creator();
        ImageSubmit submit = (ImageSubmit) creator.newInstance(ImageSubmit.class, new Object[]
        { "image", image , "submitType", "submit"});
View Full Code Here

        IValidationDelegate delegate = newDelegate();
        IForm form = newForm();
        IRequestCycle cycle = newCycle();
        IMarkupWriter writer = newWriter();
       
        IAsset image = newAsset(cycle, "disabled-image-url");

        Creator creator = new Creator();
        ImageSubmit submit = (ImageSubmit) creator.newInstance(ImageSubmit.class, new Object[]
        { "disabledImage", image, "disabled", Boolean.TRUE, "submitType", "submit" });
View Full Code Here

        IValidationDelegate delegate = newDelegate();
        IForm form = newForm();
        IRequestCycle cycle = newCycle();
        IMarkupWriter writer = newWriter();
       
        IAsset image = newAsset(cycle, "image-url");

        Creator creator = new Creator();
        ImageSubmit submit = (ImageSubmit) creator.newInstance(ImageSubmit.class, new Object[]
        { "image", image, "disabled", Boolean.TRUE, "submitType", "submit" });
View Full Code Here

        IValidationDelegate delegate = newDelegate();
        IForm form = newForm();
        IRequestCycle cycle = newCycle();
        IMarkupWriter writer = newWriter();
       
        IAsset image = newAsset(cycle, "image-url");

        Creator creator = new Creator();
        ImageSubmit submit = (ImageSubmit) creator.newInstance(ImageSubmit.class, new Object[]
        { "image", image, "nameOverride", "barney", "submitType", "submit" });
View Full Code Here

        ContextAssetFactory factory = new ContextAssetFactory();
        factory.setLocalizer(new DefaultResourceLocalizer());

        factory.setContextPath("/context");

        IAsset asset = factory.createAsset(base, spec, "asset.png", Locale.FRENCH, l);

        assertTrue(asset instanceof ContextAsset);
        assertSame(localized, asset.getResourceLocation());
        assertSame(l, asset.getLocation());

        verify();
    }
View Full Code Here

        ContextAssetFactory factory = new ContextAssetFactory();
        factory.setLocalizer(new DefaultResourceLocalizer());
        factory.setContextPath("/context");
        factory.setWebContext(context);

        IAsset asset = factory.createAbsoluteAsset("/asset.png", Locale.FRENCH, l);

        assertTrue(asset instanceof ContextAsset);
        assertEquals("/asset_fr.png", asset.getResourceLocation().getPath());
        assertSame(l, asset.getLocation());

        verify();
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry.IAsset

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.