Package com.itextpdf.commons.actions
Class EventManager
- java.lang.Object
-
- com.itextpdf.commons.actions.EventManager
-
public final class EventManager extends java.lang.Object
Entry point for event handling mechanism. Class is a singleton, seegetInstance()
.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Set<IEventHandler>
handlers
private static EventManager
INSTANCE
-
Constructor Summary
Constructors Modifier Constructor Description private
EventManager()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
acknowledgeAgplUsageDisableWarningMessage()
Deliberately turns off the warning message about AGPL usage.static EventManager
getInstance()
Allows an access to the instance of EventManager.boolean
isRegistered(IEventHandler handler)
Check if the handler was registered for event handling process.void
onEvent(IEvent event)
Handles the event.void
register(IEventHandler handler)
Add newIEventHandler
to the event handling process.boolean
unregister(IEventHandler handler)
Removes handler from event handling process.
-
-
-
Field Detail
-
INSTANCE
private static final EventManager INSTANCE
-
handlers
private final java.util.Set<IEventHandler> handlers
-
-
Method Detail
-
getInstance
public static EventManager getInstance()
Allows an access to the instance of EventManager.- Returns:
- the instance of the class
-
acknowledgeAgplUsageDisableWarningMessage
public static void acknowledgeAgplUsageDisableWarningMessage()
Deliberately turns off the warning message about AGPL usage.Important note. Calling of this method means that the terms of AGPL license are met.
-
onEvent
public void onEvent(IEvent event)
Handles the event.- Parameters:
event
- to handle
-
register
public void register(IEventHandler handler)
Add newIEventHandler
to the event handling process.- Parameters:
handler
- is a handler to add
-
isRegistered
public boolean isRegistered(IEventHandler handler)
Check if the handler was registered for event handling process.- Parameters:
handler
- is a handler to check- Returns:
- true if handler has been already registered and false otherwise
-
unregister
public boolean unregister(IEventHandler handler)
Removes handler from event handling process.- Parameters:
handler
- is a handle to remove- Returns:
- true if the handler had been registered previously and was removed. False if the handler was not found among registered handlers
-
-