Package org.apache.tapestry.ioc

Examples of org.apache.tapestry.ioc.Messages


    {
        ValidationMessagesSource messagesSource = mockValidationMessagesSource();
        Validator validator = mockValidator();
        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;

        Map<String, Validator> map = singletonMap("minLength", validator);

        train_getConstraintType(validator, Integer.class);
View Full Code Here


{

    @Test
    public void convert_symbols_success() throws Exception
    {
        Messages messages = messagesFor(DateField.class);

        DateField df = new DateField();
        df.injectMessages(messages);

        SimpleDateFormat format = df.toJavaDateFormat();
View Full Code Here

    }

    @Test
    public void convert_symbol_non_default() throws Exception
    {
        Messages messages = messagesFor(DateField.class);

        DateField df = new DateField();
        df.injectMessages(messages);
        df.injectFormat("%d %b %Y");
View Full Code Here

    }

    @Test
    public void unknown_symbol() throws Exception
    {
        Messages messages = messagesFor(DateField.class);
        ComponentResources resources = mockComponentResources();
        Location l = mockLocation();

        train_getLocation(resources, l);
View Full Code Here

    @Inject
    private DefaultComponentParameterBindingSource _defaultBindingSource;

    final String defaultLabel()
    {
        Messages containerMessages = _resources.getContainer().getComponentResources()
                .getMessages();

        String componentId = _resources.getId();

        String key = componentId + "-label";

        return containerMessages.contains(key) ? containerMessages.get(key) : TapestryInternalUtils
                .toUserPresentable(componentId);
    }
View Full Code Here

    {
        String rawValue = formSupport.getParameterValue(elementName);

        _tracker.recordInput(this, rawValue);

        Messages messages = _messagesSource.getValidationMessages(_locale);

        try
        {
            Object translated = _translate.parseClient(rawValue, messages);
View Full Code Here

        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,
View Full Code Here

        String overrideKey = overrideId + "-" + validatorType;

        if (overrideMessages.contains(overrideKey))
            return overrideMessages.getFormatter(overrideKey);

        Messages messages = _messagesSource.getValidationMessages(locale);

        String key = validator.getMessageKey();

        return messages.getFormatter(key);
    }
View Full Code Here

    }

    @Test
    public void default_label_key_found()
    {
        Messages messages = mockMessages();
        train_contains(messages, "myid-label", true);
        train_get(messages, "myid-label", "My Id");

        replay();
View Full Code Here

    }

    @Test
    public void default_label_from_name()
    {
        Messages messages = mockMessages();

        stub_contains(messages, false);

        replay();
View Full Code Here

TOP

Related Classes of org.apache.tapestry.ioc.Messages

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.