Package com.itextpdf.kernel.events
Interface IEventDispatcher
- All Known Implementing Classes:
-
EventDispatcher
,PdfAAgnosticPdfDocument
,PdfADocument
,PdfDocument
,PdfUADocument
public interface IEventDispatcher
Event dispatcher interface.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addEventHandler
(String type, IEventHandler handler) Adds new event handler.void
dispatchEvent
(Event event) Dispatches an event.void
dispatchEvent
(Event event, boolean delayed) Dispatches a delayed event.boolean
hasEventHandler
(String type) Checks if event dispatcher as an event handler assigned for a certain event type.void
Remove all event handlers.void
removeEventHandler
(String type, IEventHandler handler) Removes event handler.
-
Method Details
-
addEventHandler
Adds new event handler.- Parameters:
-
type
- a type of event to be handled -
handler
- event handler
-
dispatchEvent
Dispatches an event.- Parameters:
-
event
- theEvent
to be dispatched
-
dispatchEvent
Dispatches a delayed event. Sometimes event cannot be handled immediately because event handler has not been set yet. In this case event is placed into event ques of dispatcher and is waiting until handler is assigned. -
hasEventHandler
Checks if event dispatcher as an event handler assigned for a certain event type.- Parameters:
-
type
- a type of theEvent
- Returns:
- true if event dispatcher as an event handler assigned for a certain event type
-
removeEventHandler
Removes event handler.- Parameters:
-
type
- a type of theEvent
-
handler
- event handlerIEventHandler
-
removeAllHandlers
void removeAllHandlers()Remove all event handlers.
-