Class PageEvent
Event dispatched at the page level, typically used for page-scoped notifications.
Page events can be stopped to prevent further propagation to other listeners
via the stop() method.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates a new PageEvent with bubbling enabled.protectedPageEvent(boolean bubbles) Creates a new PageEvent with the specified bubbling behavior.protectedPageEvent(int id) Creates a new PageEvent with the specified ID.protectedPageEvent(int id, boolean bubbles) Creates a new PageEvent with the specified ID and bubbling behavior. -
Method Summary
Modifier and TypeMethodDescriptionfinal voiddispatchTo(PageEventListener listener) Dispatches this event to the specified listener.intgetId()Returns the event identifier.booleanReturns whether this event has been stopped.voidsetId(int id) Sets the event identifier.voidstop()Stops this event from being dispatched to further listeners.
-
Constructor Details
-
PageEvent
protected PageEvent()Creates a new PageEvent with bubbling enabled. -
PageEvent
protected PageEvent(boolean bubbles) Creates a new PageEvent with the specified bubbling behavior.- Parameters:
bubbles-trueif this event should bubble,falseotherwise
-
PageEvent
protected PageEvent(int id) Creates a new PageEvent with the specified ID.- Parameters:
id- the event identifier
-
PageEvent
protected PageEvent(int id, boolean bubbles) Creates a new PageEvent with the specified ID and bubbling behavior.- Parameters:
id- the event identifierbubbles-trueif this event should bubble,falseotherwise
-
-
Method Details
-
setId
public void setId(int id) Sets the event identifier.- Parameters:
id- the event ID
-
stop
public void stop()Stops this event from being dispatched to further listeners. -
getId
public int getId()Returns the event identifier.- Returns:
- the event ID
-
isStopped
public boolean isStopped()Returns whether this event has been stopped.- Returns:
trueif the event has been stopped,falseotherwise
-
dispatchTo
Dispatches this event to the specified listener.Subclasses implement this method to call the appropriate handler method on the listener interface.
- Specified by:
dispatchToin classEvent<PageEventListener>- Parameters:
listener- the listener to dispatch this event to
-