org.apache.tapestry.internal.event.impl
Class ComponentEventInvoker

java.lang.Object
  extended by org.apache.tapestry.internal.event.impl.ComponentEventInvoker
All Implemented Interfaces:
EventListener, ResetEventListener, IComponentEventInvoker

public class ComponentEventInvoker
extends Object
implements IComponentEventInvoker, ResetEventListener

Implementation of IComponentEventInvoker.


Constructor Summary
ComponentEventInvoker()
           
 
Method Summary
 void addEventListener(String componentId, IComponentSpecification listener)
          Adds a listener mapping for events related to the specified component.
 void addFormEventListener(String formId, IComponentSpecification listener)
          Adds a mapping for an event listener that should be triggered when the specified form component with id of formId is submitted.
 List getEventListeners(String componentId)
          Returns a list of all known listeners for the specified component.
 ComponentEventProperty[] getEventPropertyListeners(String componentIdPath)
          Gets all bound property event listeners for the specified componentIdPath.
 List getFormEventListeners(String formId)
          Gets a list of form bound event listeners previously bound via IComponentEventInvoker.addFormEventListener(String, IComponentSpecification).
 void invokeFormListeners(FormSupport formSupport, IRequestCycle cycle, BrowserEvent event)
          Causes the configured listeners for the passed FormSupport's IForm to be invoked, if mapped to this request/event.
 void invokeListeners(IComponent component, IRequestCycle cycle, BrowserEvent event)
          Causes the configured listeners for the passed component to be invoked.
 void resetEventDidOccur()
          
 void setInvoker(ListenerInvoker invoker)
          Injected.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentEventInvoker

public ComponentEventInvoker()
Method Detail

invokeListeners

public void invokeListeners(IComponent component,
                            IRequestCycle cycle,
                            BrowserEvent event)
Causes the configured listeners for the passed component to be invoked.

Specified by:
invokeListeners in interface IComponentEventInvoker
Parameters:
component - The component that recieved the invocations.
cycle - The associated request.
event - The event that started it all.

invokeFormListeners

public void invokeFormListeners(FormSupport formSupport,
                                IRequestCycle cycle,
                                BrowserEvent event)
Causes the configured listeners for the passed FormSupport's IForm to be invoked, if mapped to this request/event.

Specified by:
invokeFormListeners in interface IComponentEventInvoker
Parameters:
formSupport - The form support object being rendered.
cycle - The associated request.
event - The event that started it all.

addEventListener

public void addEventListener(String componentId,
                             IComponentSpecification listener)
Adds a listener mapping for events related to the specified component.

Specified by:
addEventListener in interface IComponentEventInvoker
Parameters:
componentId - The component to map a listener with.
listener - The listener.

getEventListeners

public List getEventListeners(String componentId)
Returns a list of all known listeners for the specified component.

Specified by:
getEventListeners in interface IComponentEventInvoker
Parameters:
componentId - The component id to find listeners for.
Returns:
The bound listeners, or null if none exist.

getEventPropertyListeners

public ComponentEventProperty[] getEventPropertyListeners(String componentIdPath)
Description copied from interface: IComponentEventInvoker
Gets all bound property event listeners for the specified componentIdPath.

Specified by:
getEventPropertyListeners in interface IComponentEventInvoker
Parameters:
componentIdPath - The unique id path of the component, as returned from IComponent.getIdPath().
Returns:
The aggregated array of all event properties bound to the specified component, empty if none exist.

addFormEventListener

public void addFormEventListener(String formId,
                                 IComponentSpecification listener)
Adds a mapping for an event listener that should be triggered when the specified form component with id of formId is submitted. This will later be used when the form is submitted to find event listeners bound to fire when a particular form is submitted.

Specified by:
addFormEventListener in interface IComponentEventInvoker
Parameters:
formId - The form the event listener is bound to. This is the submitForm parameter of the EventListener annotation/spec driving an event occurrence to submit a particular form. It doesn't mean that the actual event target was the form .
listener - The listener that has form bound event listeners.

getFormEventListeners

public List getFormEventListeners(String formId)
Gets a list of form bound event listeners previously bound via IComponentEventInvoker.addFormEventListener(String, IComponentSpecification).

Specified by:
getFormEventListeners in interface IComponentEventInvoker
Parameters:
formId - The form to get mapped listeners for.
Returns:
The list of form event listeners of type IComponentSpecification, if any exist. Null if none exist.

resetEventDidOccur

public void resetEventDidOccur()

Specified by:
resetEventDidOccur in interface ResetEventListener

setInvoker

public void setInvoker(ListenerInvoker invoker)
Injected.



Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.