Package org.apache.tapestry.listener

Examples of org.apache.tapestry.listener.ListenerMap


     **/

    public ListenerMap getListeners()
    {
        if (_listeners == null)
            _listeners = new ListenerMap(this);

        return _listeners;
    }
View Full Code Here


     **/

    public ListenerMap getListeners()
    {
        if (_listeners == null)
            _listeners = new ListenerMap(this);

        return _listeners;
    }
View Full Code Here

public class TestListenerMethodBinding extends BindingTestCase
{
    public void testInvokeListener()
    {
        IComponent component = newComponent();
        ListenerMap map = newListenerMap();
        IActionListener listener = newListener();
        Location l = newLocation();
        IComponent sourceComponent = newComponent();
        IRequestCycle cycle = newCycle();
        ValueConverter vc = newValueConverter();
View Full Code Here

    }

    public void testInvokeAndRedirect()
    {
        IComponent component = newComponent();
        ListenerMap map = newListenerMap();
        IActionListener listener = newListener();
        Location l = newLocation();
        ValueConverter vc = newValueConverter();
        IComponent sourceComponent = newComponent();
        IRequestCycle cycle = newCycle();
View Full Code Here

    }

    public void testInvokeListenerFailure()
    {
        IComponent component = newComponent();
        ListenerMap map = newListenerMap();
        IActionListener listener = newListener();
        Location l = newLocation();
        ValueConverter vc = newValueConverter();
        IComponent sourceComponent = newComponent();
        IRequestCycle cycle = newCycle();
View Full Code Here

        IPage page = newMock(IPage.class);
       
        IComponentSpecification spec = new ComponentSpecification();
       
        ListenerInvoker listenerInvoker = newMock(ListenerInvoker.class);
        ListenerMap listenerMap = newMock(ListenerMap.class);
       
        IActionListener listener1 = 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.addEventListener("testId", new String[] { "onSelect" },
                "fooListener", null, false, false, false);
        invoker.addEventListener("testId", spec);
       
        expect(comp.getId()).andReturn("testId").anyTimes();
       
        expect(comp.getSpecification()).andReturn(spec).anyTimes();
       
        expect(comp.getPage()).andReturn(page);
       
        expect(page.getComponents()).andReturn(comps);
       
        expect(comp.getListeners()).andReturn(listenerMap);
       
        expect(listenerMap.getListener("fooListener")).andReturn(listener1);
       
        listenerInvoker.invokeListener(listener1, comp, cycle);
       
        replay();
       
View Full Code Here

       
        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.getId()).andReturn("testId").anyTimes();
       
        expect(comp.getSpecification()).andReturn(spec).anyTimes();
       
        expect(comp.getPage()).andReturn(page);
       
        expect(page.getComponents()).andReturn(comps);
       
        expect(comp.getListeners()).andReturn(listenerMap);
       
        expect(listenerMap.getListener("fooListener")).andReturn(listener);
       
        listenerInvoker.invokeListener(listener, comp, cycle);
       
        replay();
       
View Full Code Here

        checkOrder(form, false);
        FormSupport formSupport = newMock(FormSupport.class);
        IComponentSpecification spec = new ComponentSpecification();
       
        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", new EventTarget(tprops));
       
        ComponentEventInvoker invoker = new ComponentEventInvoker();
        invoker.setInvoker(listenerInvoker);
       
        spec.addEventListener("form1", new String[] { "onSelect" }, "fooListener",
                "form1", false, false, false);
        invoker.addFormEventListener("form1", spec);
       
        expect(formSupport.getForm()).andReturn(form);
       
        expect(form.getId()).andReturn("form1").anyTimes();
       
        expect(form.getPage()).andReturn(page);
       
        expect(page.getComponents()).andReturn(comps);
       
        expect(form.getSpecification()).andReturn(spec);
       
        expect(form.getListeners()).andReturn(listenerMap);
       
        expect(listenerMap.getListener("fooListener")).andReturn(listener);
       
        form.addDeferredRunnable(isA(Runnable.class));
       
        cycle.setAttribute(FormSupportImpl.FIELD_FOCUS_ATTRIBUTE, Boolean.TRUE);
       
View Full Code Here

        checkOrder(form, false);
        FormSupport formSupport = newMock(FormSupport.class);
        IComponentSpecification spec = new ComponentSpecification();
       
        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", new EventTarget(tprops));
       
        ComponentEventInvoker invoker = new ComponentEventInvoker();
        invoker.setInvoker(listenerInvoker);
       
        spec.addEventListener("form1", new String[] { "onSelect" }, "fooListener",
                "form1", false, false, true);
        invoker.addFormEventListener("form1", spec);
       
        expect(formSupport.getForm()).andReturn(form);
       
        expect(form.getId()).andReturn("form1").anyTimes();
       
        expect(form.getPage()).andReturn(page);
       
        expect(page.getComponents()).andReturn(comps);
       
        expect(form.getSpecification()).andReturn(spec);
       
        expect(form.getListeners()).andReturn(listenerMap);
       
        expect(listenerMap.getListener("fooListener")).andReturn(listener);
       
        form.addDeferredRunnable(isA(Runnable.class));
       
        replay();
       
View Full Code Here

public class TestListenerMethodBinding extends BindingTestCase
{
    public void testInvokeListener()
    {
        IComponent component = newComponent();
        ListenerMap map = newListenerMap();
        IActionListener listener = newListener();
        Location l = newLocation();
        IComponent sourceComponent = newComponent();
        IRequestCycle cycle = newCycle();
        ValueConverter vc = newValueConverter();
View Full Code Here

TOP

Related Classes of org.apache.tapestry.listener.ListenerMap

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.