Some test text!
By default, the Tools package will respond to user actions such as a click event on a link or form
widget, or a property change event on a selected annotation. If you would like to customize the
behavior executed (prior to handling by the Tools package) in response to user actions, it is
possible to do so via the
BasicAnnotationListener.onInterceptAnnotationHandling(Annot, Bundle, int) API. If this method returns true, then it will intercept executing the default logic.
BasicAnnotationListener.onInterceptAnnotationHandling(Annot, Bundle, int), the second parameter,
Bundle, contains the name of the action intercepted by this function, as well as some extra information. You can get the name of the intercepted action by calling
To get extra information, first obtain the information keys by calling
Then, you can get the information values by looping on each key obtained above:
For example, the following code demonstrates several scenarios and how you can get notified before each: clicking on a radio button, changing the annotation opacity, and clicking on a link. See the comments in the code for details.
If you simply want to get notified after the action has happened, you can do so via the
AnnotationModificationListener.onAnnotationsModified(Map<Annot, Integer>) API. This event callback is raised when an annotation change has occurred. For example, in order to get notified when the value of a checkbox has been changed and when annotation opacity has been changed, do the following:
When finished with the callback, do: