Package org.apache.tapestry.internal.event

Examples of org.apache.tapestry.internal.event.IComponentEventInvoker


   
   
    public void test_Script_Resource()
    {  
        ClassResolver resolver = new DefaultClassResolver();
        IComponentEventInvoker invoker = new org.apache.tapestry.internal.event.impl.ComponentEventInvoker();
       
        String compScript = "/org/apache/tapestry/ComponentEvent.script";
        String widScript = "/org/apache/tapestry/dojo/html/WidgetEvent.script";
        String elementScript = "/org/apache/tapestry/html/ElementEvent.script";
       
View Full Code Here


   
    public void test_Prerendered_Field()
    {  
        ClassResolver resolver = new DefaultClassResolver();
       
        IComponentEventInvoker invoker = new org.apache.tapestry.internal.event.impl.ComponentEventInvoker();
        IEngineService engine = newMock(IEngineService.class);
        IRequestCycle cycle = newCycle();
        checkOrder(cycle, false);
       
        PageRenderSupport prs = newPageRenderSupport();
       
        IScriptSource scriptSource = newMock(IScriptSource.class);
       
        ComponentEventConnectionWorker worker = new ComponentEventConnectionWorker();
        worker.setClassResolver(resolver);
        worker.setEventInvoker(invoker);
        worker.setEventEngine(engine);
        worker.setScriptSource(scriptSource);
       
        IDirectEvent component = newMock(IDirectEvent.class);
        IComponentSpecification spec = new ComponentSpecification();
       
        // now test render
        invoker.addEventListener("comp1", spec);
        spec.addEventListener("comp1", new String[] {"onclick"}, "testMethod", "form1", false, false, false, false);
       
        expect(cycle.isRewinding()).andReturn(false);
       
        expect(cycle.getAttribute(TapestryUtils.PAGE_RENDER_SUPPORT_ATTRIBUTE)).andReturn(prs);
View Full Code Here

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

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

        invoker.addEventListener("path/comp1", spec);

        replay();

        EventConnectionVisitor v = new EventConnectionVisitor();
        v.setEventInvoker(invoker);
View Full Code Here

        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);

        Map comps = new HashMap();
        comps.put("form", form);

        expect(comp.getPage()).andReturn(page).anyTimes();
        expect(page.getComponents()).andReturn(comps).anyTimes();
        expect(comp.getComponents()).andReturn(Collections.EMPTY_MAP).anyTimes();
        expect(form.getComponents()).andReturn(Collections.EMPTY_MAP).anyTimes();

        expect(form.getId()).andReturn("form").anyTimes();
        expect(form.getExtendedId()).andReturn("path/form").anyTimes();

        invoker.addFormEventListener("path/form", spec);
        invoker.addFormEventListener("path/form", spec);

        replay();

        EventConnectionVisitor v = new EventConnectionVisitor();
        v.setEventInvoker(invoker);
View Full Code Here

    }

    public void test_Spec_Rewire_Id()
    {
        IComponentSpecification spec = newMock(IComponentSpecification.class);
        IComponentEventInvoker invoker = newMock(IComponentEventInvoker.class);
        IComponent comp = newComponent(spec, "comp1", "path/", "Home/");

        ComponentEventProperty p = new ComponentEventProperty("comp1");
        p.addListener(new String[] {"onClick"}, "testFoo", null, false, false, false, false);

        Map compEvents = new HashMap();
        compEvents.put("comp1", p);
       
        expect(spec.getComponentEvents()).andReturn(compEvents);
        expect(spec.getElementEvents()).andReturn(Collections.EMPTY_MAP);

        invoker.addEventListener("path/comp1", spec);
        spec.rewireComponentId("comp1", "path/comp1", "Home/path/comp1");

        replay();

        EventConnectionVisitor v = new EventConnectionVisitor();
View Full Code Here

TOP

Related Classes of org.apache.tapestry.internal.event.IComponentEventInvoker

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.