Package org.apache.tapestry.internal.event

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


    /**
     * {@inheritDoc}
     */
    public ComponentEventProperty getElementEvents(String id)
    {
        ComponentEventProperty prop = (ComponentEventProperty)_elementEvents.get(id);
        if (prop == null) {
            prop = new ComponentEventProperty(id);
            _elementEvents.put(id, prop);
        }
       
        return prop;
    }
View Full Code Here


       
        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

        {
            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

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

        assert spec.getComponentEvents("comp1") != null;
        assert spec.getComponentEvents("comp1").getEvents().size() == 1;

        ComponentEventProperty prop = spec.getComponentEvents("comp1");
        assertNotNull(prop);
        assertEquals(prop.getEventListeners("onClick").size(), 1);

        prop = spec.getComponentEvents("comp2");
        assert prop == null;
    }
View Full Code Here

        spec.addEventListener("comp1", new String[] {"onClick"}, "testFoo", "form", false, true, false, false);
        spec.addEventListener("comp1", new String[] {"onClick"}, "testBar", "form", false, true, false, false);

        assert spec.getComponentEvents("comp1") != null;

        ComponentEventProperty p = spec.getComponentEvents("comp1");

        // should be only form events bound
        assertEquals(p.getEvents().size(), 0);
        assertEquals(p.getEventListeners("onClick").size(), 0);

        assertEquals(p.getComponentId(), "comp1");
        assertEquals(p.getFormEventListeners("onClick").size(), 2);
        assertEquals(p.getFormEvents().size(), 1);
    }
View Full Code Here

     * {@inheritDoc}
     */
    public void addEventListener(String componentId, String[] events,
            String methodName, String formId, boolean validateForm, boolean async, boolean focus, boolean autoSubmit)
    {
        ComponentEventProperty property = getComponentEvents(componentId);
        if (property == null) {
            property = new ComponentEventProperty(componentId);
            _componentEvents.put(componentId, property);
        }

        property.addListener(events, methodName, formId, validateForm, async, focus, autoSubmit);
    }
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);
        if (property == null) {
            property = new ComponentEventProperty(elementId);
            _elementEvents.put(elementId, property);
        }

        property.addListener(events, methodName, formId, validateForm, async, focus, true);
    }
View Full Code Here

    public void connectAutoSubmitEvents(IComponent component, IForm form)
    {
        Defense.notNull(form, "form");
       
        ComponentEventProperty property = getComponentEvents(component.getExtendedId());
       
        if (property == null)
            return;

        property.connectAutoSubmitEvents(form.getExtendedId());
    }
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

        property.connectAutoSubmitEvents(form.getExtendedId());
    }

    public void rewireComponentId(String componentId, String extendedId, String idPath)
    {
        ComponentEventProperty prop = getComponentEvents(componentId);
        if (prop == null)
            return;

        if (_componentEvents.containsKey(extendedId))
            return;

        try {

            ComponentEventProperty clone = (ComponentEventProperty) prop.clone();

            clone.rewireComponentId(extendedId, idPath);

            _componentEvents.put(extendedId, clone);

        } catch (CloneNotSupportedException e) {
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.