Package org.apache.tapestry.internal.event

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


       
        verify();
       
        assertEquals(1, invoker.getEventListeners("email").size());
       
        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() == false;
    }
View Full Code Here


        verify();
       
        assertEquals(1, invoker.getEventListeners("email").size());
        assertEquals(1, invoker.getFormEventListeners("testForm").size());
       
        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

           
            Map parms = new HashMap();
           
            String target = (String)keys.next();
           
            ComponentEventProperty prop = (ComponentEventProperty)elements.get(target);
           
            parms.put("component", component);
            parms.put("target", target);
            parms.put("url", url);
            parms.put("events", getEvents(prop, target));
View Full Code Here

       
        while (keyIt.hasNext()) {
            String elem = (String)keyIt.next();
            assertEquals(elem, "elementId");
           
            ComponentEventProperty prop = (ComponentEventProperty)elmEvents.get(elem);
            assertNotNull(prop);
           
            Object[][] events = worker.getEvents(prop, elem);
           
            assertNotNull(events);
View Full Code Here

        spec.addEventListener("comp1", new String[] {"onClick"}, "testFoo",
                null, false, false, false);
       
        assertTrue(spec.hasEvents("comp1"));
       
        ComponentEventProperty prop = spec.getComponentEvents("comp1");
        assertNotNull(prop);
        assertEquals(prop.getEventListeners("onClick").size(), 1);
       
        // ensure valid props always returned
        prop = spec.getComponentEvents("comp2");
        assertNotNull(prop);
        assertEquals(prop.getEvents().size(), 0);
       
        List listeners = prop.getEventListeners("nonExistant");
        assertNotNull(listeners);
        assertEquals(listeners.size(), 0);
    }
View Full Code Here

        for (int i = 0; i < listeners.size(); i++) {
           
            IComponentSpecification listener = (IComponentSpecification)listeners.get(i);
           
            IComponent target = null;
            ComponentEventProperty props = null;
           
            if (listener.isPageSpecification()) {
               
                target = component.getPage();
                props = listener.getComponentEvents(component.getId());
            } else {
               
                target = findComponent(component.getPage().getComponents().values(), listener);
                props = target.getSpecification().getComponentEvents(component.getId());
            }
           
            List clisteners = props.getEventListeners(event.getName());
            for (int e=0; e < clisteners.size(); e++) {
               
                EventBoundListener eventListener = (EventBoundListener)clisteners.get(e);
               
                _invoker.invokeListener(target.getListeners().getListener(eventListener.getMethodName()), target, cycle);
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

     * {@inheritDoc}
     */
    public void addEventListener(String componentId, String[] events,
            String methodName, String formId, boolean validateForm, boolean async, boolean focus)
    {
        ComponentEventProperty property = getComponentEvents(componentId);
       
        property.addListener(events, methodName, formId, validateForm, async, focus);
    }
View Full Code Here

     * {@inheritDoc}
     */
    public void addElementEventListener(String elementId, String[] events,
            String methodName, String formId, boolean validateForm, boolean async, boolean focus)
    {
        ComponentEventProperty property = getElementEvents(elementId);
       
        property.addListener(events, methodName, formId, validateForm, async, focus);
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public ComponentEventProperty getComponentEvents(String id)
    {
        ComponentEventProperty prop = (ComponentEventProperty)_componentEvents.get(id);
        if (prop == null) {
            prop = new ComponentEventProperty(id);
            _componentEvents.put(id, prop);
        }
       
        return prop;
    }
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.