public class EventDispatcher extends Object implements IEventDispatcher
IEventHandler
implementations.
Modifier and Type | Field and Description |
---|---|
protected Map<String,List<IEventHandler>> |
eventHandlers |
Constructor and Description |
---|
EventDispatcher() |
Modifier and Type | Method and Description |
---|---|
void |
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 |
removeAllHandlers()
Remove all event handlers.
|
void |
removeEventHandler(String type, IEventHandler handler)
Removes event handler.
|
protected Map<String,List<IEventHandler>> eventHandlers
public void addEventHandler(String type, IEventHandler handler)
IEventDispatcher
addEventHandler
in interface IEventDispatcher
type
- a type of event to be handled.
handler
- event handler.
public void dispatchEvent(Event event)
IEventDispatcher
dispatchEvent
in interface IEventDispatcher
public void dispatchEvent(Event event, boolean delayed)
IEventDispatcher
dispatchEvent
in interface IEventDispatcher
public boolean hasEventHandler(String type)
IEventDispatcher
hasEventHandler
in interface IEventDispatcher
public void removeEventHandler(String type, IEventHandler handler)
IEventDispatcher
removeEventHandler
in interface IEventDispatcher
public void removeAllHandlers()
IEventDispatcher
removeAllHandlers
in interface IEventDispatcher
Copyright © 1998–2020 iText Group NV. All rights reserved.