org.apache.tapestry.internal.event
Class ComponentEventProperty

java.lang.Object
  extended by org.apache.tapestry.internal.event.ComponentEventProperty

public class ComponentEventProperty
extends Object

Represents a configured listener/event(s) binding for a a component and the events that may be optionally listened for on the client browser.

Author:
jkuhnert

Constructor Summary
ComponentEventProperty(String componentId)
          Creates a new component event property with the specified component id.
 
Method Summary
 void addEventListener(String event, String methodName)
          Adds a listener to the specified client side event.
 void addFormEventListener(String event, String methodName, String formId, boolean validateForm, boolean async)
          Adds a form listener to the specified client side event.
 void addListener(String[] events, String methodName, String formId, boolean validateForm, boolean async)
          Adds a listener bound to the specified client side events.
 String getComponentId()
           
 List getEventListeners(String event)
          Gets the current list of listeners for a specific event, creates a new instance if one doesn't exist already.
 Set getEvents()
          The set of all non form based events.
 List getFormEventListeners(String event)
          Gets the current list of listeners for a specific event, creates a new instance if one doesn't exist already.
 List getFormEventListeners(String formId, BrowserEvent event, List append)
          Creates a list of listeners bound to a particular form and client side browser event.
 Set getFormEvents()
          The set of all form based listener events.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentEventProperty

public ComponentEventProperty(String componentId)
Creates a new component event property with the specified component id.

Parameters:
componentId -
Method Detail

addListener

public void addListener(String[] events,
                        String methodName,
                        String formId,
                        boolean validateForm,
                        boolean async)
Adds a listener bound to the specified client side events.

Parameters:
events -
methodName -
async -

addFormEventListener

public void addFormEventListener(String event,
                                 String methodName,
                                 String formId,
                                 boolean validateForm,
                                 boolean async)
Adds a form listener to the specified client side event.

Parameters:
event -
methodName -
formId -
validateForm -

addEventListener

public void addEventListener(String event,
                             String methodName)
Adds a listener to the specified client side event.

Parameters:
event -
methodName -

getComponentId

public String getComponentId()
Returns:
the componentId

getEventListeners

public List getEventListeners(String event)
Gets the current list of listeners for a specific event, creates a new instance if one doesn't exist already.

Parameters:
event -
Returns:

getFormEventListeners

public List getFormEventListeners(String event)
Gets the current list of listeners for a specific event, creates a new instance if one doesn't exist already.

Parameters:
event -
Returns:

getEvents

public Set getEvents()
The set of all non form based events.

Returns:
The unique set of events.

getFormEvents

public Set getFormEvents()
The set of all form based listener events.

Returns:

getFormEventListeners

public List getFormEventListeners(String formId,
                                  BrowserEvent event,
                                  List append)
Creates a list of listeners bound to a particular form and client side browser event.

Parameters:
formId - The form to find listeners for.
event - The browser event that generated the request.
append - The optional list to add the listeners to.
Returns:
The list of listeners to invoke for the form and event passed in, will be empty if none found.


Copyright © 2006 Apache Software Foundation. All Rights Reserved.