org.faceless.pdf2.viewer2
Class JSManager

java.lang.Object
  extended by JSCoreMethods
      extended by org.faceless.pdf2.viewer2.JSManager

public class JSManager
extends JSCoreMethods

Handles the Events - primarily JavaScript events - raised during the lifetime of the viewer. This class will raise the PDF lifetime events defined in the Acrobat JavaScript Scripting Reference, which may have PDFAction objects associated with them. These are unrelated to Swing events and to the DocumentPanelEvent, PagePanelEvent and similar.

We recommend developers and those working with the viewer steer well clear of calling into this class, as the API is subject to change without notice.

Since:
2.9

Method Summary
 int appAlert(String message, int nIcon, int nType, String cTitle, Object oDoc, Object oCheckbox)
          An implementation of the App.alert JavaScript method
 void appBeep()
          An implementation of the App.beep JavaScript method
 String appResponse(String message, String cTitle, String cDefault, boolean bPassword, String cLabel)
          An implementation of the App.response JavaScript method
 void consoleClear()
          An implementation of the Console.clear JavaScript method
 void consoleHide()
          An implementation of the Console.hide JavaScript method
 void consolePrintln(String message)
          An implementation of the Console.println JavaScript method
 void consoleShow()
          An implementation of the Console.show JavaScript method
 void defineObject(String key, Object value, String script)
          Define an Object in the Global JavaScript namespace.
 String getImplementationDescription()
          Return a description of the JavaScript implementation in use
 void notifyForRedraw(Object o)
          Notify the DocumentPanel that a specific Object is suitable for redrawing.
 void runEventAppInit()
          Raise the App/Init JavaScript method
 boolean runEventBatchExec(DocumentPanel panel, PDF pdf, String javascript)
          Raise the Batch/Exec JavaScript method
 void runEventBookmarkMouseUp(DocumentPanel panel, PDFBookmark bookmark)
          Raise the Bookmark/MouseUp JavaScript method
 void runEventConsoleExec(String javascript)
          Raise the Console/Exec JavaScript method
 void runEventDocDidPrint(DocumentPanel panel)
          Raise the Doc/DidPrint JavaScript method
 void runEventDocDidSave(DocumentPanel panel)
          Raise the Doc/DidSave JavaScript method
 void runEventDocOpen(DocumentPanel panel, String targetName)
          Raise the Doc/Open JavaScript method
 void runEventDocWillClose(DocumentPanel panel)
          Raise the Doc/WillClose JavaScript method
 void runEventDocWillPrint(DocumentPanel panel)
          Raise the Doc/WillPrint JavaScript method
 void runEventDocWillSave(DocumentPanel panel)
          Raise the Doc/WillSave JavaScript method
 void runEventExternalExec(DocumentPanel panel, String javascript)
          Raise the External/Exec JavaScript method
 void runEventFieldBlur(DocumentPanel panel, WidgetAnnotation annot, boolean shift, boolean modifier)
          Raise the Field/Blur JavaScript method
 boolean runEventFieldCalculate(DocumentPanel panel, WidgetAnnotation target, WidgetAnnotation source)
          Raise the Field/Calculate JavaScript method
 void runEventFieldFocus(DocumentPanel panel, WidgetAnnotation annot, boolean shift, boolean modifier)
          Raise the Field/Focus JavaScript method
 void runEventFieldFormat(DocumentPanel panel, WidgetAnnotation annot, int commitKey, boolean willCommit)
          Raise the Field/Format JavaScript method
 boolean runEventFieldKeystroke(DocumentPanel panel, WidgetAnnotation annot, int commitKey, String change, String changeEx, boolean fieldFull, boolean keyDown, boolean modifier, int selStart, int selEnd, boolean shift, String value, boolean willCommit)
          Raise the Field/Keystroke JavaScript method
 void runEventFieldMouseDown(DocumentPanel panel, WidgetAnnotation annot, MouseEvent mevent)
          Raise the Field/Mouse Down JavaScript method
 void runEventFieldMouseEnter(DocumentPanel panel, WidgetAnnotation annot, MouseEvent mevent)
          Raise the Field/Mouse Enter JavaScript method
 void runEventFieldMouseExit(DocumentPanel panel, WidgetAnnotation annot, MouseEvent mevent)
          Raise the Field/Mouse Exit JavaScript method
 void runEventFieldMouseUp(DocumentPanel panel, WidgetAnnotation annot, MouseEvent mevent)
          Raise the Field/Mouse Up JavaScript method
 boolean runEventFieldValidate(DocumentPanel panel, WidgetAnnotation annot, String value, boolean shift, boolean modifier, String change, String changeEx, boolean keyDown)
          Raise the Field/Validate JavaScript method
 void runEventLinkMouseUp(DocumentPanel panel, AnnotationLink annot)
          Raise the Link/Mouse Up JavaScript method
 void runEventPageClose(DocumentPanel panel, PDFPage page)
          Raise the Page/Close JavaScript method
 void runEventPageOpen(DocumentPanel panel, PDFPage page)
          Raise the Page/Open JavaScript method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getImplementationDescription

public String getImplementationDescription()
Return a description of the JavaScript implementation in use


defineObject

public void defineObject(String key,
                         Object value,
                         String script)
Define an Object in the Global JavaScript namespace. This method is intended for use by JavaScript plugins.

Parameters:
key - the key to bind the optional object to. May be null, in which case no binding takes place.
value - the value if bind to the key
script - the JavaScript to run after the object is defined - may be null

notifyForRedraw

public void notifyForRedraw(Object o)
Notify the DocumentPanel that a specific Object is suitable for redrawing. This method is called by JavaScript when the state of an object (usually a WidgetAnnotation or FormElement has been updated.

Parameters:
o - the Object that is to be redrawn.
See Also:
DocumentPanel.redraw(java.lang.Object)

appBeep

public void appBeep()
An implementation of the App.beep JavaScript method


consoleShow

public void consoleShow()
An implementation of the Console.show JavaScript method


consoleHide

public void consoleHide()
An implementation of the Console.hide JavaScript method


consolePrintln

public void consolePrintln(String message)
An implementation of the Console.println JavaScript method


consoleClear

public void consoleClear()
An implementation of the Console.clear JavaScript method


appAlert

public int appAlert(String message,
                    int nIcon,
                    int nType,
                    String cTitle,
                    Object oDoc,
                    Object oCheckbox)
An implementation of the App.alert JavaScript method


appResponse

public String appResponse(String message,
                          String cTitle,
                          String cDefault,
                          boolean bPassword,
                          String cLabel)
An implementation of the App.response JavaScript method


runEventAppInit

public void runEventAppInit()
Raise the App/Init JavaScript method


runEventBatchExec

public boolean runEventBatchExec(DocumentPanel panel,
                                 PDF pdf,
                                 String javascript)
Raise the Batch/Exec JavaScript method


runEventBookmarkMouseUp

public void runEventBookmarkMouseUp(DocumentPanel panel,
                                    PDFBookmark bookmark)
Raise the Bookmark/MouseUp JavaScript method


runEventConsoleExec

public void runEventConsoleExec(String javascript)
Raise the Console/Exec JavaScript method


runEventDocDidPrint

public void runEventDocDidPrint(DocumentPanel panel)
Raise the Doc/DidPrint JavaScript method


runEventDocDidSave

public void runEventDocDidSave(DocumentPanel panel)
Raise the Doc/DidSave JavaScript method


runEventDocOpen

public void runEventDocOpen(DocumentPanel panel,
                            String targetName)
Raise the Doc/Open JavaScript method


runEventDocWillClose

public void runEventDocWillClose(DocumentPanel panel)
Raise the Doc/WillClose JavaScript method


runEventDocWillPrint

public void runEventDocWillPrint(DocumentPanel panel)
Raise the Doc/WillPrint JavaScript method


runEventDocWillSave

public void runEventDocWillSave(DocumentPanel panel)
Raise the Doc/WillSave JavaScript method


runEventExternalExec

public void runEventExternalExec(DocumentPanel panel,
                                 String javascript)
Raise the External/Exec JavaScript method


runEventFieldBlur

public void runEventFieldBlur(DocumentPanel panel,
                              WidgetAnnotation annot,
                              boolean shift,
                              boolean modifier)
Raise the Field/Blur JavaScript method


runEventFieldCalculate

public boolean runEventFieldCalculate(DocumentPanel panel,
                                      WidgetAnnotation target,
                                      WidgetAnnotation source)
Raise the Field/Calculate JavaScript method


runEventFieldFocus

public void runEventFieldFocus(DocumentPanel panel,
                               WidgetAnnotation annot,
                               boolean shift,
                               boolean modifier)
Raise the Field/Focus JavaScript method


runEventFieldFormat

public void runEventFieldFormat(DocumentPanel panel,
                                WidgetAnnotation annot,
                                int commitKey,
                                boolean willCommit)
Raise the Field/Format JavaScript method


runEventFieldKeystroke

public boolean runEventFieldKeystroke(DocumentPanel panel,
                                      WidgetAnnotation annot,
                                      int commitKey,
                                      String change,
                                      String changeEx,
                                      boolean fieldFull,
                                      boolean keyDown,
                                      boolean modifier,
                                      int selStart,
                                      int selEnd,
                                      boolean shift,
                                      String value,
                                      boolean willCommit)
Raise the Field/Keystroke JavaScript method


runEventFieldMouseDown

public void runEventFieldMouseDown(DocumentPanel panel,
                                   WidgetAnnotation annot,
                                   MouseEvent mevent)
Raise the Field/Mouse Down JavaScript method


runEventFieldMouseEnter

public void runEventFieldMouseEnter(DocumentPanel panel,
                                    WidgetAnnotation annot,
                                    MouseEvent mevent)
Raise the Field/Mouse Enter JavaScript method


runEventFieldMouseExit

public void runEventFieldMouseExit(DocumentPanel panel,
                                   WidgetAnnotation annot,
                                   MouseEvent mevent)
Raise the Field/Mouse Exit JavaScript method


runEventFieldMouseUp

public void runEventFieldMouseUp(DocumentPanel panel,
                                 WidgetAnnotation annot,
                                 MouseEvent mevent)
Raise the Field/Mouse Up JavaScript method


runEventFieldValidate

public boolean runEventFieldValidate(DocumentPanel panel,
                                     WidgetAnnotation annot,
                                     String value,
                                     boolean shift,
                                     boolean modifier,
                                     String change,
                                     String changeEx,
                                     boolean keyDown)
Raise the Field/Validate JavaScript method


runEventLinkMouseUp

public void runEventLinkMouseUp(DocumentPanel panel,
                                AnnotationLink annot)
Raise the Link/Mouse Up JavaScript method


runEventPageOpen

public void runEventPageOpen(DocumentPanel panel,
                             PDFPage page)
Raise the Page/Open JavaScript method


runEventPageClose

public void runEventPageClose(DocumentPanel panel,
                              PDFPage page)
Raise the Page/Close JavaScript method



Copyright © 2001-2008 Big Faceless Organization