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
 String getCustomJavaScript(String type, String name)
           
 DocumentPanel getDocumentPanel(PDF pdf)
           
 String getImplementationDescription()
          Return a description of the JavaScript implementation in use
 PDFViewer getViewer()
           
 void notifyForRedraw(Object o)
          Notify the DocumentPanel that a specific Object is suitable for redrawing.
 void runEventAppInit()
          Raise the App/Init JavaScript method
 JSEvent runEventBatchExec(DocumentPanel panel, PDF pdf, String javascript)
          Raise the Batch/Exec JavaScript method
 JSEvent runEventBookmarkMouseUp(DocumentPanel panel, PDFBookmark bookmark)
          Raise the Bookmark/MouseUp JavaScript method
 JSEvent runEventConsoleExec(DocumentPanel panel, String javascript)
          Raise the Console/Exec JavaScript method
 JSEvent runEventDocDidPrint(DocumentPanel panel)
          Raise the Doc/DidPrint JavaScript method
 JSEvent runEventDocDidSave(DocumentPanel panel)
          Raise the Doc/DidSave JavaScript method
 JSEvent runEventDocOpen(DocumentPanel panel, String targetName)
          Raise the Doc/Open JavaScript method
 JSEvent runEventDocWillClose(DocumentPanel panel)
          Raise the Doc/WillClose JavaScript method
 JSEvent runEventDocWillPrint(DocumentPanel panel)
          Raise the Doc/WillPrint JavaScript method
 JSEvent runEventDocWillSave(DocumentPanel panel)
          Raise the Doc/WillSave JavaScript method
 JSEvent runEventExternalExec(DocumentPanel panel, String javascript)
          Raise the External/Exec JavaScript method
 JSEvent runEventFieldBlur(DocumentPanel panel, WidgetAnnotation annot, boolean shift, boolean modifier)
          Raise the Field/Blur JavaScript method
 JSEvent runEventFieldCalculate(DocumentPanel panel, WidgetAnnotation target, WidgetAnnotation source)
          Raise the Field/Calculate JavaScript method
 JSEvent runEventFieldFocus(DocumentPanel panel, WidgetAnnotation annot, boolean shift, boolean modifier)
          Raise the Field/Focus JavaScript method
 JSEvent runEventFieldFormat(DocumentPanel panel, WidgetAnnotation annot, int commitKey, boolean willCommit)
          Raise the Field/Format JavaScript method
 JSEvent 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
 JSEvent runEventFieldMouseDown(DocumentPanel panel, WidgetAnnotation annot, MouseEvent mevent)
          Raise the Field/Mouse Down JavaScript method
 JSEvent runEventFieldMouseEnter(DocumentPanel panel, WidgetAnnotation annot, MouseEvent mevent)
          Raise the Field/Mouse Enter JavaScript method
 JSEvent runEventFieldMouseExit(DocumentPanel panel, WidgetAnnotation annot, MouseEvent mevent)
          Raise the Field/Mouse Exit JavaScript method
 JSEvent runEventFieldMouseUp(DocumentPanel panel, WidgetAnnotation annot, MouseEvent mevent)
          Raise the Field/Mouse Up JavaScript method
 JSEvent runEventFieldValidate(DocumentPanel panel, WidgetAnnotation annot, String value, boolean shift, boolean modifier, String change, String changeEx, boolean keyDown)
          Raise the Field/Validate JavaScript method
 JSEvent runEventLinkMouseUp(DocumentPanel panel, AnnotationLink annot)
          Raise the Link/Mouse Up JavaScript method
 JSEvent runEventPageClose(DocumentPanel panel, PDFPage page)
          Raise the Page/Close JavaScript method
 JSEvent 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

getViewer

public final PDFViewer getViewer()

getDocumentPanel

public final DocumentPanel getDocumentPanel(PDF pdf)

getImplementationDescription

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


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 JSEvent runEventBatchExec(DocumentPanel panel,
                                 PDF pdf,
                                 String javascript)
Raise the Batch/Exec JavaScript method


runEventBookmarkMouseUp

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


runEventConsoleExec

public JSEvent runEventConsoleExec(DocumentPanel panel,
                                   String javascript)
Raise the Console/Exec JavaScript method


runEventDocDidPrint

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


runEventDocDidSave

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


runEventDocOpen

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


runEventDocWillClose

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


runEventDocWillPrint

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


runEventDocWillSave

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


runEventExternalExec

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


runEventFieldBlur

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


runEventFieldCalculate

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


runEventFieldFocus

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


runEventFieldFormat

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


runEventFieldKeystroke

public JSEvent 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 JSEvent runEventFieldMouseDown(DocumentPanel panel,
                                      WidgetAnnotation annot,
                                      MouseEvent mevent)
Raise the Field/Mouse Down JavaScript method


runEventFieldMouseEnter

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


runEventFieldMouseExit

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


runEventFieldMouseUp

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


runEventFieldValidate

public JSEvent 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 JSEvent runEventLinkMouseUp(DocumentPanel panel,
                                   AnnotationLink annot)
Raise the Link/Mouse Up JavaScript method


runEventPageOpen

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


runEventPageClose

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


getCustomJavaScript

public String getCustomJavaScript(String type,
                                  String name)


Copyright © 2001-2008 Big Faceless Organization