Examples of ComponentResources


Examples of org.apache.tapestry5.ComponentResources

    {
        ValidationMessagesSource messagesSource = mockValidationMessagesSource();
        Validator validator = mockValidator();
        TypeCoercer coercer = mockTypeCoercer();
        FieldComponent field = newFieldComponent();
        ComponentResources resources = mockComponentResources();
        Messages containerMessages = mockMessages();
        FormSupport fs = mockFormSupport();

        Map<String, Validator> map = singletonMap("minlength", validator);
View Full Code Here

Examples of org.apache.tapestry5.ComponentResources

        TypeCoercer coercer = mockTypeCoercer();
        FieldComponent field = newFieldComponent();
        Messages messages = mockMessages();
        MessageFormatter formatter = mockMessageFormatter();
        Object inputValue = new Object();
        ComponentResources resources = mockComponentResources();
        Messages containerMessages = mockMessages();
        FormSupport fs = mockFormSupport();

        Map<String, Validator> map = singletonMap("required", validator);
View Full Code Here

Examples of org.apache.tapestry5.ComponentResources

        FieldComponent field = newFieldComponent();
        Messages messages = mockMessages();
        MessageFormatter requiredFormatter = mockMessageFormatter();
        MessageFormatter minLengthFormatter = mockMessageFormatter();
        Object inputValue = "input value";
        ComponentResources resources = mockComponentResources();
        Messages containerMessages = mockMessages();
        Integer fifteen = 15;
        FormSupport fs = mockFormSupport();

        Map<String, Validator> map = newMap();
View Full Code Here

Examples of org.apache.tapestry5.ComponentResources

        TypeCoercer coercer = mockTypeCoercer();
        FieldComponent field = newFieldComponent();
        Messages messages = mockMessages();
        MessageFormatter formatter = mockMessageFormatter();
        Object inputValue = new Object();
        ComponentResources resources = mockComponentResources();
        Messages containerMessages = mockMessages();
        Integer five = 5;
        FormSupport fs = mockFormSupport();

        Map<String, Validator> map = singletonMap("minLength", validator);
View Full Code Here

Examples of org.apache.tapestry5.ComponentResources

    public FieldValidator createValidator(Field field, String validatorType, String constraintValue)
    {
        Component component = (Component) field;       
        assert InternalUtils.isNonBlank(validatorType);
        ComponentResources componentResources = component.getComponentResources();
        String overrideId = componentResources.getId();
        Locale locale = componentResources.getLocale();

        // So, if you use a TextField on your EditUser page, we want to search the messages
        // of the EditUser page (the container), not the TextField (which will always be the same).

        Messages overrideMessages = componentResources.getContainerMessages();

        return createValidator(field, validatorType, constraintValue, overrideId, overrideMessages, locale);
    }
View Full Code Here

Examples of org.apache.tapestry5.ComponentResources

        ComponentPageElement element = page.getComponentElementByNestedId(nestedId);

        if (mixinId == null)
            return element.getComponent();

        ComponentResources resources = element.getMixinResources(mixinId);

        return resources.getComponent();
    }
View Full Code Here

Examples of org.apache.tapestry5.ComponentResources

public class JavaScriptSupportImplTest extends InternalBaseTestCase
{
    @Test
    public void allocate_id_from_resources()
    {
        ComponentResources resources = mockComponentResources();

        train_getId(resources, "tracy");

        replay();
View Full Code Here

Examples of org.apache.tapestry5.ComponentResources

         
          public void advise(MethodInvocation invocation) {
           
            invocation.proceed();
                final InterceptorStatusToken statusTokenVal = secChecker.checkBefore(confAttrHolder);
                final ComponentResources componentResources = invocation.getInstanceContext().get(ComponentResources.class);
            componentResources.storeRenderVariable(STATUS_TOKEN, statusTokenVal);           
            }
        };

        beginRenderMethod.addAdvice(beginRenderAdvice);

        // ---------------- END TRANSFORMATION ------------------------


        PlasticMethod cleanupRenderMethod = plasticClass.introduceMethod(TransformConstants.CLEANUP_RENDER_DESCRIPTION);

        MethodAdvice cleanupRenderAdvice = new MethodAdvice() {
         
          public void advise(MethodInvocation invocation) {
              invocation.proceed();

              final ComponentResources componentResources = invocation.getInstanceContext().get(ComponentResources.class);
              final InterceptorStatusToken tokenFieldValue = (InterceptorStatusToken) componentResources.getRenderVariable(STATUS_TOKEN);
                secChecker.checkAfter(tokenFieldValue, null);
            }
        };

        cleanupRenderMethod.addAdvice(cleanupRenderAdvice);
View Full Code Here

Examples of org.apache.tapestry5.ComponentResources

        replay();


        ComponentPageElement cpe = new ComponentPageElementImpl(page, ins, null);

        ComponentResources resources = cpe.getComponentResources();

        try
        {
            resources.getBlock("notFound");
            unreachable();
        }
        catch (BlockNotFoundException ex)
        {
            assertTrue(ex.getMessage().contains("does not contain a block with identifier 'notFound'."));
View Full Code Here

Examples of org.apache.tapestry5.ComponentResources

        replay();

        ComponentPageElement cpe = new ComponentPageElementImpl(page, ins, null);

        ComponentResources resources = cpe.getComponentResources();

        cpe.addBlock("known", block);

        assertSame(resources.getBlock("known"), block);
        // Caseless check
        assertSame(resources.getBlock("KNOWN"), block);

        verify();
    }
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.