Package org.apache.tapestry.spec

Examples of org.apache.tapestry.spec.ComponentSpecification


        IPage page = newMock(IPage.class);
        ListenerInvoker listenerInvoker = newMock(ListenerInvoker.class);
        ListenerMap listenerMap = newMock(ListenerMap.class);
        IActionListener listener1 = newMock(IActionListener.class);

        IComponentSpecification spec = new ComponentSpecification();
       
        Map comps = new HashMap();
        comps.put("testId", comp);
       
        Map tprops = new HashMap();
        tprops.put("id", "testId");
        BrowserEvent event = new BrowserEvent("onSelect", new EventTarget(tprops));
       
        ComponentEventInvoker invoker = new ComponentEventInvoker();
        invoker.setInvoker(listenerInvoker);
       
        spec.addEventListener("testId", new String[] { "onSelect" },
                "fooListener", null, false, false, false, false);
        invoker.addEventListener("testId", spec);

        expect(comp.getExtendedId()).andReturn("testId").anyTimes();
        expect(comp.getSpecification()).andReturn(spec).anyTimes();
View Full Code Here


        IRequestCycle cycle = newCycle();
        IComponent comp = newComponent();
        checkOrder(comp, false);
       
        IPage page = newMock(IPage.class);
        IComponentSpecification spec = new ComponentSpecification();
       
        ListenerInvoker listenerInvoker = newMock(ListenerInvoker.class);
        ListenerMap listenerMap = newMock(ListenerMap.class);
        IActionListener listener = newMock(IActionListener.class);
       
        Map comps = new HashMap();
        comps.put("testId", comp);
       
        Map tprops = new HashMap();
        tprops.put("id", "testId");
        BrowserEvent event = new BrowserEvent("onSelect", new EventTarget(tprops));
       
        ComponentEventInvoker invoker = new ComponentEventInvoker();
        invoker.setInvoker(listenerInvoker);
       
        spec.addElementEventListener("testId", new String[] { "onSelect" },
                "fooListener", null, false, true, true);
        invoker.addEventListener("testId", spec);
       
        expect(comp.getExtendedId()).andReturn("testId").anyTimes();
        expect(comp.getSpecification()).andReturn(spec).anyTimes();
View Full Code Here

    {
        IRequestCycle cycle = newCycle();
        IForm form = newForm();
        checkOrder(form, false);
        FormSupport formSupport = newMock(FormSupport.class);
        IComponentSpecification spec = new ComponentSpecification();
        IValidationDelegate delegate = newMock(IValidationDelegate.class);
        ListenerInvoker listenerInvoker = newMock(ListenerInvoker.class);
        ListenerMap listenerMap = newMock(ListenerMap.class);
        IActionListener listener = newMock(IActionListener.class);
        IPage page = newMock(IPage.class);
        checkOrder(page, false);
       
        Map comps = new HashMap();
        comps.put("form1", form);
       
        Map tprops = new HashMap();
        tprops.put("id", "form1");
        BrowserEvent event = new BrowserEvent("onSelect", "form1", new EventTarget(tprops));
       
        ComponentEventInvoker invoker = new ComponentEventInvoker();
        invoker.setInvoker(listenerInvoker);
       
        spec.addEventListener("form1", new String[] { "onSelect" }, "fooListener",
                "form1", false, false, false, false);
        invoker.addFormEventListener("form1", spec);
       
        expect(formSupport.getForm()).andReturn(form);
        expect(form.getExtendedId()).andReturn("form1").anyTimes();
View Full Code Here

    {
        IRequestCycle cycle = newCycle();
        IForm form = newForm();
        checkOrder(form, false);
        FormSupport formSupport = newMock(FormSupport.class);
        IComponentSpecification spec = new ComponentSpecification();
        IValidationDelegate delegate = newMock(IValidationDelegate.class);
       
        ListenerInvoker listenerInvoker = newMock(ListenerInvoker.class);
        ListenerMap listenerMap = newMock(ListenerMap.class);
        IActionListener listener = newMock(IActionListener.class);
        IPage page = newMock(IPage.class);
        checkOrder(page, false);
       
        Map comps = new HashMap();
        comps.put("form1", form);
       
        Map tprops = new HashMap();
        tprops.put("id", "form1");
        BrowserEvent event = new BrowserEvent("onSelect", "form1", new EventTarget(tprops));
       
        ComponentEventInvoker invoker = new ComponentEventInvoker();
        invoker.setInvoker(listenerInvoker);
       
        spec.addEventListener("form1", new String[] { "onSelect" }, "fooListener",
                "form1", false, false, true, false);
        invoker.addFormEventListener("form1", spec);
       
        expect(formSupport.getForm()).andReturn(form);
        expect(form.getExtendedId()).andReturn("form1").anyTimes();
View Full Code Here

@Test
public class TestEventConnectionVisitor extends BaseComponentTestCase {

    public void test_Wire_Component_Event()
    {
        IComponentSpecification spec = new ComponentSpecification();
        spec.addEventListener("comp1", new String[] {"onClick"}, "testFoo", null, false, false, false, false);

        IComponent comp = newComponent(spec, "comp1", "path/");
        IComponentEventInvoker invoker = newMock(IComponentEventInvoker.class);

        invoker.addEventListener("path/comp1", spec);
View Full Code Here

        verify();
    }

    public void test_Wire_Element_Form_Events()
    {
        IComponentSpecification spec = new ComponentSpecification();
        spec.addElementEventListener("elem1", new String[] {"onClick"}, "testFoo", "form", false, false, false);

        IComponent comp = newComponent(spec);
        IPage page = newMock(IPage.class);
        IForm form = newMock(IForm.class);
        IComponentEventInvoker invoker = newMock(IComponentEventInvoker.class);
View Full Code Here

    private void setupImplicitPage(IResourceLocation location)
    {
        if (LOG.isDebugEnabled())
            LOG.debug("Found HTML template at " + location);
    // TODO The SpecFactory in Specification parser should be used in some way to create an IComponentSpecifciation!
        IComponentSpecification specification = new ComponentSpecification();
        specification.setPageSpecification(true);
        specification.setSpecificationLocation(location);

        setSpecification(specification);

        install();
    }
View Full Code Here

    public void testRenderInformalParameters()
    {
        Checkbox cb = (Checkbox) newInstance(Checkbox.class, new Object[]
        { "name", "assignedName", "value", Boolean.TRUE, "specification",
                new ComponentSpecification() });

        IMarkupWriter writer = newBufferWriter();
        IRequestCycle cycle = newCycle();

        IBinding binding = newBinding("informal-value");
View Full Code Here

        train(log, logc, ResolverMessages.checkingResource(contextRoot
                .getRelativeResource("TemplatePage.html")));

        train(log, logc, ResolverMessages.foundHTMLTemplate(resource));

        IComponentSpecification expectedSpec = new ComponentSpecification();
        expectedSpec.setPageSpecification(true);
        expectedSpec.setSpecificationLocation(resource);

        // The toString() on ComponentSpecification means we can't predict
        // what the string would be.

        trainIsDebugEnabled(logc, log, false);
View Full Code Here

        ContainedComponent contained = new ContainedComponent();
        contained.setBinding("barney", bspec);
        contained.setType("FredComponent");

        IComponentSpecification spec = new ComponentSpecification();
        spec.addParameter(pspec);

        component.getSpecification();
        componentc.setReturnValue(spec);

        Log log = (Log) newMock(Log.class);
View Full Code Here

TOP

Related Classes of org.apache.tapestry.spec.ComponentSpecification

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.