|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.faces.component.UIComponent
javax.faces.component.UIComponentBase
com.sun.webui.jsf.component.EventSourceImpl
public abstract class EventSourceImpl
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.
Constructor Summary | |
---|---|
EventSourceImpl()
|
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 EventSource events s occur. |
void |
broadcast(javax.faces.event.FacesEvent event)
In addition to to the default UIComponent.broadcast(javax.faces.event.FacesEvent)
processing, pass the ActionEvent being broadcast to the
method referenced by actionListener (if any),
and to the default ActionListener registered on the
Application . |
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, |
javax.el.MethodExpression |
getEventListenerExpression()
Used to specify a method to handle an menu event that is triggered when this component is activated by the user. |
com.sun.webui.jsf.event.EventListener[] |
getEventListeners()
Return the set of registered EventListener s for this
EventSource instance. |
javax.faces.event.PhaseId |
getPhaseId()
Return the PhaseId of the lifecycle phase in
which events will be queued. |
boolean |
isImmediate()
Return a flag indicating that this event should be broadcast at the next available opportunity, ususally between lifecycle phases i.e. |
void |
processEventExpression()
|
void |
queueEvent(javax.faces.event.FacesEvent e)
Intercept queueEvent and, for ActionEvent s,
mark the phaseId for the event to be
PhaseId.APPLY_REQUEST_VALUES if the
immediate flag is true,
PhaseId.INVOKE_APPLICATION otherwise. |
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 |
restoreState(javax.faces.context.FacesContext _context,
java.lang.Object _state)
|
java.lang.Object |
saveState(javax.faces.context.FacesContext _context)
Save the state of this component. |
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 |
setEventListenerExpression(javax.el.MethodExpression me)
Used to specify a method to handle an menu event that is triggered when this component is activated by the user. |
void |
setImmediate(boolean immediate)
Set the "immediate execution" flag for this UIComponent . |
void |
setPhaseId(javax.faces.event.PhaseId phaseId)
Set the PhaseId in which events should be broadcast. |
Methods inherited from class javax.faces.component.UIComponentBase |
---|
decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRendererType, getRendersChildren, getValueBinding, getValueExpression, invokeOnComponent, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding, setValueExpression |
Methods inherited from class javax.faces.component.UIComponent |
---|
encodeAll, getContainerClientId, getFamily |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EventSourceImpl()
Method Detail |
---|
public boolean isImmediate()
PhaseId.ANY
.
isImmediate
in interface EventSource
public void setImmediate(boolean immediate)
Set the "immediate execution" flag for this UIComponent
.
setImmediate
in interface EventSource
immediate
- The new immediate execution flagpublic javax.el.MethodExpression getEventExpression()
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,
getEventExpression
in interface EventSource
public 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.
setEventExpression
in interface EventSource
eventExpression
- The new method expressionpublic void addEventListener(com.sun.webui.jsf.event.EventListener listener)
Add a new EventListener
to the set of listeners interested
in being notified when EventSource
events s occur.
addEventListener
in interface EventSource
listener
- The EventListener
to be added
java.lang.NullPointerException
- if listener
is null
public com.sun.webui.jsf.event.EventListener[] getEventListeners()
Return the set of registered EventListener
s for this
EventSource
instance. If there are no registered listeners,
a zero-length array is returned.
getEventListeners
in interface EventSource
public javax.el.MethodExpression getEventListenerExpression()
Used to specify a method to handle
an menu event that is triggered when this
component is activated by the user.
Value must be a JavaServer Faces EL expression that resolves
to a method in a backing bean. The method must take a single parameter
that is an event, and its return type must be void
.
The class that defines the method must implement the java.io.Serializable
interface or javax.faces.component.StateHolder
interface.
public void setEventListenerExpression(javax.el.MethodExpression me)
Used to specify a method to handle
an menu event that is triggered when this
component is activated by the user.
Value must be a JavaServer Faces EL expression that resolves
to a method in a backing bean. The method must take a single parameter
that is an event, and its return type must be void
.
The class that defines the method must implement the java.io.Serializable
interface or javax.faces.component.StateHolder
interface.
public 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.
removeEventListener
in interface EventSource
listener
- The EventListener
to be removed
java.lang.NullPointerException
- if listener
is null
public void processEventExpression()
public void broadcast(javax.faces.event.FacesEvent event) throws javax.faces.event.AbortProcessingException
In addition to to the default UIComponent.broadcast(javax.faces.event.FacesEvent)
processing, pass the ActionEvent
being broadcast to the
method referenced by actionListener
(if any),
and to the default ActionListener
registered on the
Application
.
broadcast
in class javax.faces.component.UIComponentBase
event
- FacesEvent
to be broadcast
javax.faces.event.AbortProcessingException
- Signal the JavaServer Faces
implementation that no further processing on the current event
should be performed
java.lang.IllegalArgumentException
- if the implementation class
of this FacesEvent
is not supported by this component
java.lang.NullPointerException
- if event
is
null
public void setPhaseId(javax.faces.event.PhaseId phaseId)
PhaseId
in which events should be broadcast.
The default is PhaseId.INVOKE_APPLICATION
or
PhaseId.ANY
if isImmediate
returns
true
public javax.faces.event.PhaseId getPhaseId()
PhaseId
of the lifecycle phase in
which events will be queued.
public void queueEvent(javax.faces.event.FacesEvent e)
Intercept queueEvent
and, for ActionEvent
s,
mark the phaseId for the event to be
PhaseId.APPLY_REQUEST_VALUES
if the
immediate
flag is true,
PhaseId.INVOKE_APPLICATION
otherwise.
queueEvent
in class javax.faces.component.UIComponentBase
public void restoreState(javax.faces.context.FacesContext _context, java.lang.Object _state)
restoreState
in interface javax.faces.component.StateHolder
restoreState
in class javax.faces.component.UIComponentBase
public java.lang.Object saveState(javax.faces.context.FacesContext _context)
Save the state of this component.
saveState
in interface javax.faces.component.StateHolder
saveState
in class javax.faces.component.UIComponentBase
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |