Package org.apache.tapestry

Examples of org.apache.tapestry.ValidationDecorator


    public void setup(Environment environment)
    {
        Messages messages = _messagesSource.getValidationMessages(_threadLocale.getLocale());

        ValidationDecorator decorator = new DefaultValidationDecorator(environment, messages,
                _iconAsset);

        environment.push(ValidationDecorator.class, decorator);
    }
View Full Code Here


    {
        Environment env = mockEnvironment();

        replay();

        ValidationDecorator decorator = new DefaultValidationDecorator(env, null, null, null);

        decorator.insideLabel(null, null);

        verify();
    }
View Full Code Here

        replay();

        Element e = writer.element("label", "accesskey", "f");

        ValidationDecorator decorator = new DefaultValidationDecorator(env, null, null, null);

        decorator.insideLabel(field, e);

        assertEquals(writer.toString(), "<?xml version=\"1.0\"?>\n<label accesskey=\"f\" class=\"t-error\"/>");

        verify();
    }
View Full Code Here

        replay();

        Element e = writer.element("label", "accesskey", "f", "class", "foo");

        ValidationDecorator decorator = new DefaultValidationDecorator(env, null, null, null);

        decorator.insideLabel(field, e);

        assertEquals(writer.toString(), "<?xml version=\"1.0\"?>\n<label accesskey=\"f\" class=\"foo t-error\"/>");

        verify();
    }
View Full Code Here

        replay();

        writer.element("input", "type", "text", "name", "ex", "class", "foo", "value", "freddy", "size", "30");

        ValidationDecorator decorator = new DefaultValidationDecorator(env, null, null, writer);

        decorator.insideField(field);

        assertEquals(writer.toString(),
                     "<?xml version=\"1.0\"?>\n<input class=\"foo t-error\" name=\"ex\" size=\"30\" type=\"text\" value=\"freddy\"/>");

        verify();
View Full Code Here

        train_peekRequired(env, ValidationTracker.class, tracker);
        train_inError(tracker, field, false);

        replay();

        ValidationDecorator decorator = new DefaultValidationDecorator(env, null, null, null);

        decorator.insideField(field);

        verify();
    }
View Full Code Here

        train_peekRequired(env, ValidationTracker.class, tracker);
        train_inError(tracker, field, false);

        replay();

        ValidationDecorator decorator = new DefaultValidationDecorator(env, null, null, null);

        decorator.insideLabel(field, null);

        verify();
    }
View Full Code Here

    @Inject
    private Environment _environment;

    void beginRender(MarkupWriter writer)
    {
        ValidationDecorator existing = _environment.peekRequired(ValidationDecorator.class);

        _environment.push(ValidationDecorator.class, new ChattyValidationDecorator(writer, existing));
    }
View Full Code Here

    {
        Environment env = newEnvironment();

        replay();

        ValidationDecorator decorator = new DefaultValidationDecorator(env, null, null);

        decorator.insideLabel(null, null);

        verify();
    }
View Full Code Here

        replay();

        Element e = writer.element("label", "accesskey", "f");

        ValidationDecorator decorator = new DefaultValidationDecorator(env, null, null);

        decorator.insideLabel(field, e);

        assertEquals(writer.toString(), "<label accesskey=\"f\" class=\"t-error\"/>");

        verify();
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry.ValidationDecorator

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.