Package org.apache.tapestry.internal.event

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


       
        Iterator it = _componentEvents.keySet().iterator();
        while (it.hasNext()) {
           
            String compId = (String)it.next();
            ComponentEventProperty prop = (ComponentEventProperty)_componentEvents.get(compId);

            ret.addAll(prop.getFormEventListeners(formId, event, null));
        }
       
        it = _elementEvents.keySet().iterator();
        while (it.hasNext()) {
           
            String compId = (String)it.next();
            ComponentEventProperty prop = (ComponentEventProperty)_elementEvents.get(compId);

            ret.addAll(prop.getFormEventListeners(formId, event, null));
        }
       
        return (EventBoundListener[])ret.toArray(new EventBoundListener[ret.size()]);
    }
View Full Code Here


        }

        while (it.hasNext())
        {
            String elementId = (String) it.next();
            ComponentEventProperty property = (ComponentEventProperty) events.get(elementId);

            Iterator bindingIt  = property.getFormEvents().iterator();
            while (bindingIt.hasNext())
            {
                String key = (String) bindingIt.next();
                List listeners = property.getFormEventListeners(key);

                for (int i=0; i < listeners.size(); i++)
                {
                    EventBoundListener listener = (EventBoundListener) listeners.get(i);
                    wireElementFormEvents(listener, component, component.getSpecification());
View Full Code Here

        for (int i = 0; i < listeners.size(); i++)
        {
            IComponentSpecification listener = (IComponentSpecification)listeners.get(i);

            ComponentEventProperty props = listener.getComponentEvents(idPath);
           
            if (props == null)
                continue;

            List clisteners = props.getEventListeners(event.getName());
            for (int e=0; e < clisteners.size(); e++)
            {
                EventBoundListener eventListener = (EventBoundListener)clisteners.get(e);

                IComponent target = page.getNestedComponent(eventListener.getComponentIdPath());
View Full Code Here

    {
        String targetId = (String)event.getTarget().get("id");
        if (targetId == null)
            return;

        ComponentEventProperty prop = component.getSpecification().getElementEvents(targetId);
        if (prop == null)
            return;

        List listeners = prop.getEventListeners(event.getName());

        for (int i=0; i < listeners.size(); i++)
        {
            EventBoundListener listener = (EventBoundListener)listeners.get(i);
View Full Code Here

        assertEquals(cs.getComponentEvents().size(), 2);
        assert cs.getComponentEvents("comp") != null;
        assert cs.getComponentEvents("page/comp") != null;

        ComponentEventProperty prop = cs.getComponentEvents("comp");
        assertEquals(prop.getComponentId(), "comp");
        assertEquals(prop.getEvents().size(), 1);
        EventBoundListener listener = (EventBoundListener)prop.getEventListeners("foo").get(0);
        assertEquals(listener.getComponentId(), "comp");

        prop = cs.getComponentEvents("page/comp");
        assertEquals(prop.getComponentId(), "page/comp");
        assertEquals(prop.getEvents().size(), 1);
        listener = (EventBoundListener)prop.getEventListeners("foo").get(0);
        assertEquals(listener.getComponentId(), "page/comp");
    }
View Full Code Here

    {
        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);
View Full Code Here

        assertFalse(worker.canEnhance(findMethod(AnnotatedPage.class, "getPersistentProperty")));
        worker.peformEnhancement(op, spec, m, resource);
       
        verify();
               
        ComponentEventProperty property = spec.getComponentEvents("email");
        assertNotNull(property);
       
        List listeners = property.getEventListeners("onClick");
        assertNotNull(listeners);
        assertEquals(1, listeners.size());
       
        property = spec.getElementEvents("foo");
        assertNotNull(property);
       
        listeners = property.getEventListeners("onClick");
        assertNotNull(listeners);
        assertEquals(1, listeners.size());
       
        assert !((EventBoundListener)listeners.get(0)).shouldFocusForm();
        assert ((EventBoundListener)listeners.get(0)).isAutoSubmit();
View Full Code Here

        assertTrue(worker.canEnhance(m));
        worker.peformEnhancement(op, spec, m, resource);
       
        verify();
               
        ComponentEventProperty property = spec.getComponentEvents("email");
        assertNotNull(property);
       
        List listeners = property.getFormEventListeners("onClick");
        assertNotNull(listeners);
        assertEquals(1, listeners.size());
       
        EventBoundListener formListener = (EventBoundListener)listeners.get(0);
        assertEquals("testForm", formListener.getFormId());
View Full Code Here

        assertTrue(worker.canEnhance(m));
        worker.peformEnhancement(op, spec, m, resource);

        verify();

        ComponentEventProperty property = spec.getComponentEvents("foo");
        assertNotNull(property);

        List listeners = property.getEventListeners("onchange");
        assertNotNull(listeners);
        assertEquals(1, listeners.size());

        EventBoundListener listener = (EventBoundListener) listeners.get(0);
        assert !listener.shouldFocusForm();
View Full Code Here

TOP

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

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.