Package org.apache.tapestry.dom

Examples of org.apache.tapestry.dom.Element$Attribute


        ComponentInvocationMap map = mockComponentInvocationMap();

        MarkupWriter writer = new MarkupWriterImpl(new XMLMarkupModel(), map);
        Link link = mockLink();

        Element e = writer.element("form");

        map.store(e, link);

        replay();
View Full Code Here


    public Document clickSubmit(Element submitButton, Map<String, String> fieldValues)
    {
        final String DEFAULT_SUBMIT_VALUE_ATTRIBUTE = "Submit Query";
        Defense.notNull(submitButton, "submitButton");
        assertIsSubmit(submitButton);
        Element form = getFormAncestor(submitButton);
        String value = submitButton.getAttribute("value");
        if (value == null)
        {
            value = DEFAULT_SUBMIT_VALUE_ATTRIBUTE;
        }
View Full Code Here

    @BeginRender
    void begin(MarkupWriter writer)
    {
        final Field field = _field;

        final Element element = writer.element("label");

        _resources.renderInformalParameters(writer);

        // Uh oh! Referencing a private field (that happens to get instrumented up the wazoo) from
        // a inner class causes a java.lang.Verify error (Unable to pop operand off an empty stack).
        // Perhaps this is a Javassist error? Shouldn't the inner class be going through a synthetic
        // accessor method of some kind? Resolved by assigning to a local variable and referencing
        // that. Layers on layers, oh my!

        final ValidationDecorator decorator = _decorator;

        // Since we don't know if the field has rendered yet, we need to defer writing the for
        // attribute until we know the field has rendered (and set its clientId property). That's
        // exactly what Heartbeat is for.

        Runnable command = new Runnable()
        {
            public void run()
            {
                String fieldId = field.getClientId();

                element.forceAttributes("for", fieldId);

                decorator.insideLabel(field, element);
            }
        };
View Full Code Here

    public Document clickSubmit(Element submitButton, Map<String, String> fieldValues)
    {
        final String DEFAULT_SUBMIT_VALUE_ATTRIBUTE = "Submit Query";
        Defense.notNull(submitButton, "submitButton");
        assertIsSubmit(submitButton);
        Element form = getFormAncestor(submitButton);
        String value = submitButton.getAttribute("value");
        if (value == null)
        {
            value = DEFAULT_SUBMIT_VALUE_ATTRIBUTE;
        }
View Full Code Here

    private void addErrorClassToCurrentElement()
    {
        MarkupWriter writer = _environment.peekRequired(MarkupWriter.class);

        Element element = writer.getElement();

        addErrorClass(element);
    }
View Full Code Here

    public void cleanup(Environment environment)
    {
        Document document = environment.peek(Document.class);

        Element head = document.find("html/head");

        if (head == null)
            return;

        Asset asset = _assetSource.getClasspathAsset(
                "org/apache/tapestry/default.css",
                _threadLocale.getLocale());

        head.elementAt(0, "link", "rel", "stylesheet", "type", "text/css", "href", asset
                .toClientURL());
    }
View Full Code Here

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

        replay();

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

        ValidationDecorator decorator = new DefaultValidationDecorator(env);

        decorator.insideLabel(field, e);
View Full Code Here

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

        replay();

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

        ValidationDecorator decorator = new DefaultValidationDecorator(env);

        decorator.insideLabel(field, e);
View Full Code Here

    @Test
    public void element_nesting()
    {
        MarkupWriter w = new MarkupWriterImpl();

        Element root = w.element("root");

        w.attributes("foo", "bar");

        w.write("before child");

        assertNotSame(w.element("nested"), root);

        w.write("inner text");

        assertSame(w.end(), root);

        w.write("after child");

        root.attribute("gnip", "gnop");

        assertEquals(
                w.toString(),
                "<root foo=\"bar\" gnip=\"gnop\">before child<nested>inner text</nested>after child</root>");
    }
View Full Code Here

        ComponentInvocationMap map = newComponentInvocationMap();

        MarkupWriter writer = new MarkupWriterImpl(new XMLMarkupModel(), map);
        Link link = newLink();

        Element e = writer.element("form");

        map.store(e, link);

        replay();
View Full Code Here

TOP

Related Classes of org.apache.tapestry.dom.Element$Attribute

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.