intarsys PDF library API

de.intarsys.pdf.app.action
Class ActionTools

java.lang.Object
  extended by de.intarsys.pdf.app.action.ActionTools

public class ActionTools
extends Object

Tool class for PDAction related tasks.


Nested Class Summary
static class ActionTools.ActionDisablement
          Handle type for disable/enable action processing
 
Field Summary
static COSName DK_JavaScript
          The key where we can find the static JavaScripts in the document catalog.
 
Constructor Summary
ActionTools()
           
 
Method Summary
static TriggerEvent annotationTriggerBlurred(PDAnnotation annotation)
           
static TriggerEvent annotationTriggerFocus(PDAnnotation annotation)
           
static TriggerEvent annotationTriggerKeystroke(PDAnnotation annotation, String change, boolean willCommit, int commitKey, boolean modifier, int selStart, int selEnd, boolean shift, String value)
           
static TriggerEvent annotationTriggerMouseDown(PDAnnotation annotation)
           
static TriggerEvent annotationTriggerMouseEnter(PDAnnotation annotation)
           
static TriggerEvent annotationTriggerMouseExit(PDAnnotation annotation)
           
static TriggerEvent annotationTriggerMouseUp(PDAnnotation annotation)
           
static TriggerEvent annotationTriggerPageClose(PDAnnotation annotation)
           
static TriggerEvent annotationTriggerPageInvisible(PDAnnotation annotation)
           
static TriggerEvent annotationTriggerPageOpen(PDAnnotation annotation)
           
static TriggerEvent annotationTriggerPageVisible(PDAnnotation annotation)
           
static ActionTools.ActionDisablement disableActions(COSDocument doc, COSName actionType)
          Set a flag with doc to signal that action processing for the type actionType should be disabled.
static void documentProcessModules(PDDocument doc)
           
static TriggerEvent documentTriggerClose(PDDocument doc)
           
static TriggerEvent documentTriggerDidPrint(PDDocument doc)
           
static TriggerEvent documentTriggerDidSave(PDDocument doc)
           
static TriggerEvent documentTriggerOpen(PDDocument doc)
           
static TriggerEvent documentTriggerWillPrint(PDDocument doc)
           
static TriggerEvent documentTriggerWillSave(PDDocument doc)
           
static void enableActions(COSDocument doc, ActionTools.ActionDisablement disablement)
          Remove a flag with doc to reestablish action processing for the type actionType.
static TriggerEvent fieldTriggerCalculate(PDAcroFormField field, String value, PDAcroFormField source)
           
static TriggerEvent fieldTriggerFormat(PDAcroFormField field, boolean willCommit, int commitKey, String value)
          Format the value of the widget according to its formatting script.
static TriggerEvent fieldTriggerValidate(PDAcroFormField field, String value)
           
static boolean isEnabled(COSDocument doc, COSName actionType)
          true if execution of an action of type actionType should be allowed.
static TriggerEvent pageTriggerClose(PDPage page)
           
static TriggerEvent pageTriggerOpen(PDPage page)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DK_JavaScript

public static final COSName DK_JavaScript
The key where we can find the static JavaScripts in the document catalog.

Constructor Detail

ActionTools

public ActionTools()
Method Detail

annotationTriggerBlurred

public static TriggerEvent annotationTriggerBlurred(PDAnnotation annotation)

annotationTriggerFocus

public static TriggerEvent annotationTriggerFocus(PDAnnotation annotation)

annotationTriggerKeystroke

public static TriggerEvent annotationTriggerKeystroke(PDAnnotation annotation,
                                                      String change,
                                                      boolean willCommit,
                                                      int commitKey,
                                                      boolean modifier,
                                                      int selStart,
                                                      int selEnd,
                                                      boolean shift,
                                                      String value)

annotationTriggerMouseDown

public static TriggerEvent annotationTriggerMouseDown(PDAnnotation annotation)

annotationTriggerMouseEnter

public static TriggerEvent annotationTriggerMouseEnter(PDAnnotation annotation)

annotationTriggerMouseExit

public static TriggerEvent annotationTriggerMouseExit(PDAnnotation annotation)

annotationTriggerMouseUp

public static TriggerEvent annotationTriggerMouseUp(PDAnnotation annotation)

annotationTriggerPageClose

public static TriggerEvent annotationTriggerPageClose(PDAnnotation annotation)

annotationTriggerPageInvisible

public static TriggerEvent annotationTriggerPageInvisible(PDAnnotation annotation)

annotationTriggerPageOpen

public static TriggerEvent annotationTriggerPageOpen(PDAnnotation annotation)

annotationTriggerPageVisible

public static TriggerEvent annotationTriggerPageVisible(PDAnnotation annotation)

disableActions

public static ActionTools.ActionDisablement disableActions(COSDocument doc,
                                                           COSName actionType)
Set a flag with doc to signal that action processing for the type actionType should be disabled. This flag is honoured by the StandardActionProcessor.

Specify null as the actionType to disable processing of all actions.

Parameters:
doc - The document for which action processing is switched off.
actionType - The type of actions no longer executed or null for all action types.
Returns:
A handle that is used for re-enabling the processing. This ensures that action processing can't be reestablished by malicious code (as long as you don't leak the handle).

documentProcessModules

public static void documentProcessModules(PDDocument doc)

documentTriggerClose

public static TriggerEvent documentTriggerClose(PDDocument doc)

documentTriggerDidPrint

public static TriggerEvent documentTriggerDidPrint(PDDocument doc)

documentTriggerDidSave

public static TriggerEvent documentTriggerDidSave(PDDocument doc)

documentTriggerOpen

public static TriggerEvent documentTriggerOpen(PDDocument doc)

documentTriggerWillPrint

public static TriggerEvent documentTriggerWillPrint(PDDocument doc)

documentTriggerWillSave

public static TriggerEvent documentTriggerWillSave(PDDocument doc)

enableActions

public static void enableActions(COSDocument doc,
                                 ActionTools.ActionDisablement disablement)
Remove a flag with doc to reestablish action processing for the type actionType. This flag is honoured by the StandardActionProcessor.

You must supply the handle from your call to "disableAction" in disablement.

Parameters:
doc - The document for which action processing is switched off.
disablement - The handle from "disableActions"

fieldTriggerCalculate

public static TriggerEvent fieldTriggerCalculate(PDAcroFormField field,
                                                 String value,
                                                 PDAcroFormField source)

fieldTriggerFormat

public static TriggerEvent fieldTriggerFormat(PDAcroFormField field,
                                              boolean willCommit,
                                              int commitKey,
                                              String value)
Format the value of the widget according to its formatting script. The result of the formatting is not stored but only used as the input for the widget appearance rendering.


fieldTriggerValidate

public static TriggerEvent fieldTriggerValidate(PDAcroFormField field,
                                                String value)

isEnabled

public static boolean isEnabled(COSDocument doc,
                                COSName actionType)
true if execution of an action of type actionType should be allowed. This flag is honoured by the StandardActionProcessor.

Parameters:
doc - The document under inspection.
actionType - The type of actions we want to execute.
Returns:
true if execution of an action of type actionType should be allowed.

pageTriggerClose

public static TriggerEvent pageTriggerClose(PDPage page)

pageTriggerOpen

public static TriggerEvent pageTriggerOpen(PDPage page)

intarsys PDF library API

Copyright © 2006 intarsys consulting GmbH. All Rights Reserved.