| java.lang.Object com.sun.perseus.model.EventSupport
EventSupport | class EventSupport (Code) | | EventSupport assumes two functions. First, it offers
a central place for listeners to register for specific event types on
specific observers for a particular event propagation phase (capture
or bubble). Second, it performs the event dispatching according to the
DOM Level 2 Event model of capture, at target and bubbling.
version: $Id: EventSupport.java,v 1.9 2006/06/29 10:47:31 ln156897 Exp $ |
Method Summary | |
void | addEventListener(ModelNode handler, String type, int phase, EventListener listener) Adds a event listener on the input handler for the input event type
and phase.
Parameters: handler - the node on which the listener is hooked Parameters: type - the type of events to listen to. | public void | dispatchEvent(ModelEvent evt) Dispatches the input event to the listeners, performing a
capture and bubble phase, as defined by the DOM Level 2
event model. | protected void | fireBubble(ModelNode currentTarget, ModelEvent evt) Fires the bubble event listeners on the input target. | protected void | fireCapture(ModelNode currentTarget, ModelEvent evt) Fires the capture event listeners on the input target. | protected void | fireEventListeners(ModelNode currentTarget, ModelEvent evt, int phase) Fires the event listeners attached to the input current target
Parameters: currentTarget - the node on which the event is currently flowing Parameters: evt - the event to propagate Parameters: phase - defines whether the event is propagating in the captureor bubble phase. | protected Vector | getEventListeners(ModelNode node, int phase, ModelEvent evt) | EventListener[] | getFreezeList(int n) Implementation. | void | removeEventListener(ModelNode handler, String type, int phase, EventListener listener) Removes an event listener from the input handler, for the given
input event type and phase. |
BUBBLE_PHASE | final public static int BUBBLE_PHASE(Code) | | One of the values allowed for the phase parameter
in the addEventListener method
|
CAPTURE_PHASE | final public static int CAPTURE_PHASE(Code) | | One of the values allowed for the phase parameter
in the addEventListener method
|
allListeners | protected Hashtable allListeners(Code) | | Maps nodes to a map of listeners for a given event type
|
addEventListener | void addEventListener(ModelNode handler, String type, int phase, EventListener listener)(Code) | | Adds a event listener on the input handler for the input event type
and phase.
Parameters: handler - the node on which the listener is hooked Parameters: type - the type of events to listen to. Should not be null Parameters: phase - the phase the listener listens to. Should be oneof CAPTURE_PHASE or BUBBLE_PHASE Parameters: listener - the listener to hook to the handler |
dispatchEvent | public void dispatchEvent(ModelEvent evt)(Code) | | Dispatches the input event to the listeners, performing a
capture and bubble phase, as defined by the DOM Level 2
event model.
Parameters: evt - the event to dispatch |
fireBubble | protected void fireBubble(ModelNode currentTarget, ModelEvent evt)(Code) | | Fires the bubble event listeners on the input target. This starts
by firing this node's listeners, then the parent bubble listeners and
so on, up to the tree's root which has no parent.
Parameters: currentTarget - the node on which the event should be dispatchedunless the event propagation has been stopped. Parameters: evt - the event to dispatch. |
fireCapture | protected void fireCapture(ModelNode currentTarget, ModelEvent evt)(Code) | | Fires the capture event listeners on the input target. This starts
by firing the node's parent capture listeners. As a result of this
recursive behavior, the listeners on the tree root (which has no parent)
are fired first, then listeners down the tree are fired.
Parameters: currentTarget - the node on which the event should be dispatchedunless the event propagation has been stopped. Parameters: evt - the event to dispatch. |
fireEventListeners | protected void fireEventListeners(ModelNode currentTarget, ModelEvent evt, int phase)(Code) | | Fires the event listeners attached to the input current target
Parameters: currentTarget - the node on which the event is currently flowing Parameters: evt - the event to propagate Parameters: phase - defines whether the event is propagating in the captureor bubble phase. One of CAPTURE_PHASE or BUBBLE_PHASE. |
getEventListeners | protected Vector getEventListeners(ModelNode node, int phase, ModelEvent evt)(Code) | | Parameters: node - the ModelNode on which listeners are seeked Parameters: phase - the event propagation phase for which listeners areseeked. Parameters: evt - the event a Vector of EventListener registered on the input node,for the given phase and the given event type. |
getFreezeList | EventListener[] getFreezeList(int n)(Code) | | Implementation.
Parameters: n - the minimal size needed for the returned freezeList |
removeEventListener | void removeEventListener(ModelNode handler, String type, int phase, EventListener listener)(Code) | | Removes an event listener from the input handler, for the given
input event type and phase.
Parameters: handler - the node on which the listener was hooked Parameters: type - the event type the listener was listening to Parameters: phase - the phase the listener was listening to Parameters: listener - the listener to be removed |
|
|