org.apache.tapestry.internal.event
Class ComponentEventProperty

java.lang.Object
  extended by org.apache.tapestry.internal.event.ComponentEventProperty
All Implemented Interfaces:
Cloneable

public class ComponentEventProperty
extends Object
implements Cloneable

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


Constructor Summary
ComponentEventProperty(String componentId)
          Creates a new component event property mapped to the specified component id.
ComponentEventProperty(String componentId, Map events, Map formEvents)
          Used in cloning only currently.
 
Method Summary
 void addEventListener(String event, String methodName, boolean autoSubmit)
          Adds a listener to the specified client side event.
 void addFormEventListener(String event, String methodName, String formId, boolean validateForm, boolean async, boolean focus, boolean autoSubmit)
          Adds a form listener to the specified client side event.
 void addListener(String[] events, String methodName, String formId, boolean validateForm, boolean async, boolean focus)
          Adds a listener bound to the specified client side events.
 void addListener(String[] events, String methodName, String formId, boolean validateForm, boolean async, boolean focus, boolean autoSubmit)
          Adds a listener bound to the specified client side events.
 Object clone()
           
 void connectAutoSubmitEvents(String formIdPath)
           
 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.
 void rewireComponentId(String extendedId, String idPath)
          Replaces all instances of the existing component id mapped for this property with the new IComponent.getIdPath() version.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentEventProperty

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

Parameters:
componentId - The component which is the target of all mappings in this property.

ComponentEventProperty

public ComponentEventProperty(String componentId,
                              Map events,
                              Map formEvents)
Used in cloning only currently.

Parameters:
componentId - The component this property is bound to.
events - The list of event mappings.
formEvents - The list of form event mappings.
Method Detail

addListener

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

Parameters:
events -
methodName -
async -

addListener

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

Parameters:
events - The javascript events to bind to.
methodName - The method to invoke when triggered.
formId - Optional form to bind event to.
validateForm - Whether or not form client side validation should be performed.
async - Whether or not the request should be asynchronous.
focus - Whether or not the form should recieve focus events. (if any forms are involved)
autoSubmit - Whether or not IFormComponents should have their forms autowired for submission.

addFormEventListener

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

Parameters:
event -
methodName -
formId -
validateForm -

addEventListener

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

Parameters:
event -
methodName -

connectAutoSubmitEvents

public void connectAutoSubmitEvents(String formIdPath)

rewireComponentId

public void rewireComponentId(String extendedId,
                              String idPath)
Replaces all instances of the existing component id mapped for this property with the new IComponent.getIdPath() version.

Parameters:
extendedId - The component extended id path.
idPath - The component idPath from the page.

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:
The current set of listeners bound to the specified event.

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:
The current set of listeners that will submit a form bound to the specified event.

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:
All mapped form event keys.

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.

clone

public Object clone()
             throws CloneNotSupportedException
Overrides:
clone in class Object
Throws:
CloneNotSupportedException


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