org.apache.tapestry.internal.event
Interface IComponentEventInvoker

All Superinterfaces:
EventListener, ResetEventListener
All Known Implementing Classes:
ComponentEventInvoker

public interface IComponentEventInvoker
extends ResetEventListener

Managed and handles invoking listener methods for components in response to requested event listener invocations.

Author:
jkuhnert

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 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.
 
Methods inherited from interface org.apache.tapestry.event.ResetEventListener
resetEventDidOccur
 

Method Detail

addEventListener

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

Parameters:
componentId - The component to map a listener with.
listener - The listener.

getEventListeners

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

Parameters:
componentId - The component id to find listeners for.
Returns:
The bound listeners, or null if none exist.

getEventPropertyListeners

ComponentEventProperty[] getEventPropertyListeners(String componentIdPath)
Gets all bound property event listeners for the specified componentIdPath.

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

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.

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

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

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.

invokeListeners

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

Parameters:
component - The component that recieved the invocations.
cycle - The associated request.
event - The event that started it all.

invokeFormListeners

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.

Parameters:
formSupport - The form support object being rendered.
cycle - The associated request.
event - The event that started it all.


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