public final class Events extends Object
Modifier and Type | Method and Description |
---|---|
static void |
addAfterPhaseListener(PhaseId phaseId,
Callback.Void callback)
Adds a phase listener to the current view that invokes the given callback everytime after given phase.
|
static void |
addBeforePhaseListener(PhaseId phaseId,
Callback.Void callback)
Adds a phase listener to the current view that invokes the given callback everytime before given phase ID.
|
static void |
addPhaseListener(PhaseListener phaseListener)
Adds a phase listener to the current view root of the current faces context.
|
static void |
removePhaseListener(PhaseListener phaseListener)
Removes a phase listener from the current view root of the current faces context.
|
static void |
subscribeToEvent(Class<? extends SystemEvent> type,
SystemEventListener listener)
Adds the given system event listener to the application that get invoked everytime when the given system event
type is been published.
|
public static void addPhaseListener(PhaseListener phaseListener)
phaseListener
- The phase listener to be added to the current view root of the current faces context.public static void removePhaseListener(PhaseListener phaseListener)
phaseListener
- The phase listener to be removed from the current view root of the current faces context.public static void addBeforePhaseListener(PhaseId phaseId, Callback.Void callback)
phaseId
- The phase ID to invoke the given callback everytime before.callback
- The callback to be invoked everytime before the given phase ID of the current view.public static void addAfterPhaseListener(PhaseId phaseId, Callback.Void callback)
phaseId
- The phase ID to invoke the given callback everytime after.callback
- The callback to be invoked everytime after the given phase ID of the current view.public static void subscribeToEvent(Class<? extends SystemEvent> type, SystemEventListener listener)
type
- The system event type to listen on.listener
- The system event listener to be invoked.