com.sun.webui.jsf.component
Interface EventSource

All Known Implementing Classes:
EventSourceImpl, Menu

public interface EventSource

The EventSource interface defines a minimal component interface to provide an application with simple GUI events. These GUI events reflect "gestures" made by the user, such as selecting a menu option, or any action that results in a reqeust value representing that action submitted in a request either by "form.submit" or an XmlHttpRequest. The intention is that specific event components will implement this interface and define their own subclass of FacesEvents. A typical event would include the appropriate phase in which the event should be broadcast, the EventSource component as the source of the event and the event payload which will be the converted request value. For example, a Menu component would implement EventSource and when a Menu gesture is seen in the request, will queue an appropriate event, with the component instance as the source and the result of calling "getConvertedValue" either implemented in the renderer or the component as the Event payload. It is this payload that the application can inspect to indicate the Menu "selection" and act accordingly. In addition EventSource can be implemented to support the navigational features of an ActionSource.


Method Summary
 void addEventListener(com.sun.webui.jsf.event.EventListener listener)
          Add a new EventListener to the set of listeners interested in being notified when EventSourceevents s occur.
 javax.el.MethodExpression getEventExpression()
          Return the MethodExpression pointing at the application action to be invoked, if this UIComponent is activated by the user, during PhaseId.ANY in case of immediate or PhaseId.INVOKE_APPLICATION phase by default, or the specific phase as set on the event of the request processing lifecycle,
 com.sun.webui.jsf.event.EventListener[] getEventListeners()
          Return the set of registered EventListeners for this EventSource instance.
 boolean isImmediate()
          Return a flag indicating that this event should be broadcast at the next available opportunity, ususally between lifecycle phases i.e.
 void removeEventListener(com.sun.webui.jsf.event.EventListener listener)
          Remove an existing EventListener (if any) from the set of listeners interested in being notified when EventSource events occur.
 void setEventExpression(javax.el.MethodExpression eventExpression)
          Set the MethodExpression pointing at the application action to be invoked, if this UIComponent is activated by the user, during PhaseId.ANY in case of immediate or PhaseId.INVOKE_APPLICATION phase by default, or the specific phase as set on the event of the request processing lifecycle,
 void setImmediate(boolean immediate)
          Set the "immediate execution" flag for this UIComponent.
 

Method Detail

isImmediate

boolean isImmediate()
Return a flag indicating that this event should be broadcast at the next available opportunity, ususally between lifecycle phases i.e. PhaseId.ANY.


setImmediate

void setImmediate(boolean immediate)

Set the "immediate execution" flag for this UIComponent.

Parameters:
immediate - The new immediate execution flag

addEventListener

void addEventListener(com.sun.webui.jsf.event.EventListener listener)

Add a new EventListener to the set of listeners interested in being notified when EventSourceevents s occur.

Parameters:
listener - The EventListener to be added
Throws:
java.lang.NullPointerException - if listener is null

getEventListeners

com.sun.webui.jsf.event.EventListener[] getEventListeners()

Return the set of registered EventListeners for this EventSource instance. If there are no registered listeners, a zero-length array is returned.


removeEventListener

void removeEventListener(com.sun.webui.jsf.event.EventListener listener)

Remove an existing EventListener (if any) from the set of listeners interested in being notified when EventSource events occur.

Parameters:
listener - The EventListener to be removed
Throws:
java.lang.NullPointerException - if listener is null

getEventExpression

javax.el.MethodExpression getEventExpression()
Return the MethodExpression pointing at the application action to be invoked, if this UIComponent is activated by the user, during PhaseId.ANY in case of immediate or PhaseId.INVOKE_APPLICATION phase by default, or the specific phase as set on the event of the request processing lifecycle,


setEventExpression

void setEventExpression(javax.el.MethodExpression eventExpression)

Set the MethodExpression pointing at the application action to be invoked, if this UIComponent is activated by the user, during PhaseId.ANY in case of immediate or PhaseId.INVOKE_APPLICATION phase by default, or the specific phase as set on the event of the request processing lifecycle,

Any method referenced by such an expression must be public, with a return type of String, and accept no parameters.

Parameters:
eventExpression - The new method expression


Copyright © 2008 Sun Microsystems, Inc. All Rights Reserved.