Package muntjac :: Package event :: Module method_event_source :: Class IMethodEventSource
[hide private]
[frames] | no frames]

Class IMethodEventSource

source code

object --+
         |
        IMethodEventSource

Interface for classes supporting registration of methods as event receivers.

For more information on the inheritable event mechanism see the muntjac.event package documentation.


Authors:
Vaadin Ltd., Richard Lincoln

Version: 1.1.2

Instance Methods [hide private]
 
addListener(self, eventType, obj, method)
Registers a new event listener with the specified activation method to listen events generated by this component.
source code
 
removeListener(self, eventType, obj, method)
Removes all registered listeners matching the given parameters.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

addListener(self, eventType, obj, method)

source code 

Registers a new event listener with the specified activation method to listen events generated by this component. If the activation method does not have any arguments the event object will not be passed to it when it's called.

For more information on the inheritable event mechanism see the muntjac.event package documentation.

Parameters:
  • eventType - the type of the listened event. Events of this type or its subclasses activate the listener.
  • obj - the object instance who owns the activation method.
  • method - the activation method or the name of the activation method.
Raises:
  • ValueError - unless method has a match in object

removeListener(self, eventType, obj, method)

source code 

Removes all registered listeners matching the given parameters. Since this method receives the event type and the listener object as parameters, it will unregister all object's methods that are registered to listen to events of type eventType generated by this component.

For more information on the inheritable event mechanism see the muntjac.event package documentation.

Parameters:
  • eventType - the exact event type the object listens to.
  • obj - the target object that has registered to listen to events of type eventType with one or more methods.
  • method - the method owned by the target that's registered to listen to events of type eventType. Or the name of the method owned by target that's registered to listen to events of type eventType.