public final class

EventHandler

extends Object
java.lang.Object
   ↳ com.pdftron.pdf.utils.EventHandler

Class Overview

Singleton instance class that sends viewer events to any listeners.

Summary

Nested Classes
interface EventHandler.EventListener Listener used to listen for viewer events. 
class EventHandler.EventType Encapsulates and event type. 
Constants
String ANNOT_LIST_FILTER_EVENT
String ANNOT_TOOLBAR_BUTTON_TYPE_METADATA_KEY
String ANNOT_TOOLBAR_EVENT
String ANNOT_TOOLBAR_TOOL_EVENT
String APPLY_REDACTION_EVENT
String EDIT_OUTLINE_EVENT
String FAVORITE_TOOLBAR_EVENT
String FILE_PICKER_VISIBLE_EVENT
String REFLOW_TEXT_MARKUP
String TOOLBAR_METADATA_KEY
Public Constructors
EventHandler()
Public Methods
static void addListener(EventHandler.EventListener listener)
Adds an event listener to listen for viewer events.
static String eventIdFromToolbar(String toolbarId, int buttonId)
static EventHandler getInstance()
static void removeListener(EventHandler.EventListener listener)
Removes an event listener.
static boolean sendPreEvent(String eventId)
Sends event with given event id to the event listeners.
static boolean sendPreEvent(String eventId, HashMap<String, String> metadata)
Sends event with given event id and metadata to the event listeners.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String ANNOT_LIST_FILTER_EVENT

Constant Value: "pdftron_annotation_list_filter"

public static final String ANNOT_TOOLBAR_BUTTON_TYPE_METADATA_KEY

Constant Value: "pdftron_toolbarButtonType"

public static final String ANNOT_TOOLBAR_EVENT

Constant Value: "pdftron_annot_toolbar"

public static final String ANNOT_TOOLBAR_TOOL_EVENT

Constant Value: "pdftron_annot_toolbar_tool"

public static final String APPLY_REDACTION_EVENT

Constant Value: "pdftron_apply_redaction"

public static final String EDIT_OUTLINE_EVENT

Constant Value: "pdftron_edit_outline"

public static final String FAVORITE_TOOLBAR_EVENT

Constant Value: "pdftron_favorite_toolbar"

public static final String FILE_PICKER_VISIBLE_EVENT

Constant Value: "pdftron_file_picker_visible"

public static final String REFLOW_TEXT_MARKUP

Constant Value: "pdftron_reflow_text_markup"

public static final String TOOLBAR_METADATA_KEY

Constant Value: "pdftron_toolbar"

Public Constructors

public EventHandler ()

Public Methods

public static void addListener (EventHandler.EventListener listener)

Adds an event listener to listen for viewer events.

Parameters
listener EventHandler.EventListener that listeners for viewer events

public static String eventIdFromToolbar (String toolbarId, int buttonId)

public static EventHandler getInstance ()

public static void removeListener (EventHandler.EventListener listener)

Removes an event listener.

Parameters
listener to remove

public static boolean sendPreEvent (String eventId)

Sends event with given event id to the event listeners. Called before the event occurs.

Parameters
eventId unique event id that represents the type of event
Returns
  • True if the listeners intercepted event, false otherwise

public static boolean sendPreEvent (String eventId, HashMap<String, String> metadata)

Sends event with given event id and metadata to the event listeners. Called before the event occurs.

Parameters
eventId unique event id that represents the type of event
metadata metadata to attach to event
Returns
  • True if the listeners intercepted event, false otherwise