org.apache.tapestry.binding
Class ListenerBinding

java.lang.Object
  extended byorg.apache.tapestry.binding.AbstractBinding
      extended byorg.apache.tapestry.binding.ListenerBinding
All Implemented Interfaces:
IActionListener, IBinding, org.apache.hivemind.Locatable

public class ListenerBinding
extends AbstractBinding
implements IActionListener

A very specialized binding that can be used as an IActionListener, executing a script in a scripting language, via Bean Scripting Framework .

Since:
3.0
Author:
Howard Lewis Ship

Constructor Summary
ListenerBinding(java.lang.String description, ValueConverter valueConverter, org.apache.hivemind.Location location, IComponent component, java.lang.String language, java.lang.String script, BSFManagerFactory managerFactory)
           
 
Method Summary
 void actionTriggered(IComponent component, IRequestCycle cycle)
          A ListenerBinding is also a IActionListener.
 java.lang.Object getComponent()
          Returns the component to which this binding is connected; this is currently only used when building certain exceptions.
 java.lang.Object getObject()
          Returns this.
 
Methods inherited from class org.apache.tapestry.binding.AbstractBinding
createReadOnlyBindingException, getDescription, getLocation, getObject, getValueConverter, isInvariant, setObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListenerBinding

public ListenerBinding(java.lang.String description,
                       ValueConverter valueConverter,
                       org.apache.hivemind.Location location,
                       IComponent component,
                       java.lang.String language,
                       java.lang.String script,
                       BSFManagerFactory managerFactory)
Method Detail

getObject

public java.lang.Object getObject()
Returns this.

Specified by:
getObject in interface IBinding

actionTriggered

public void actionTriggered(IComponent component,
                            IRequestCycle cycle)
A ListenerBinding is also a IActionListener. It registers a number of beans with the BSF manager and invokes the script.

Registers the following bean:

Specified by:
actionTriggered in interface IActionListener
Parameters:
component - The component which was "triggered".
cycle - The request cycle in which the component was triggered.

getComponent

public java.lang.Object getComponent()
Description copied from class: AbstractBinding
Returns the component to which this binding is connected; this is currently only used when building certain exceptions. This implementation returns null.

Overrides:
getComponent in class AbstractBinding
Since:
4.0