org.faceless.pdf2.viewer2.feature
Class BackgroundSignatureVerifier

java.lang.Object
  extended by org.faceless.pdf2.viewer2.ViewerFeature
      extended by org.faceless.pdf2.viewer2.feature.BackgroundSignatureVerifier
All Implemented Interfaces:
DocumentPanelListener, PDFBackgroundTask

public class BackgroundSignatureVerifier
extends ViewerFeature
implements DocumentPanelListener, PDFBackgroundTask

This feature will cause signatures in the PDF to be verified automatically when a PDF is loaded by the viewer, using a thread that runs transparently in the background. The name of this feature is BackgroundSignatureVerifier

This code is copyright the Big Faceless Organization. You're welcome to use, modify and distribute it in any form in your own projects, provided those projects continue to make use of the Big Faceless PDF library.

Since:
2.11.7

Constructor Summary
BackgroundSignatureVerifier()
           
 
Method Summary
 void documentUpdated(DocumentPanelEvent event)
          Called when an DocumentPanelEvent is raised
 void initialize(PDFViewer viewer)
          Called when the feature is first added to a viewer
 boolean isEnabledByDefault()
          Return true if this feature is enabled by default (the default).
 boolean isPaused()
          Return true if the task has been paused with the PDFBackgroundTask.pause() method
 boolean isRunning()
          Returns true if the task is still running
 void pause()
          Pause the task until the PDFBackgroundTask.unpause() method is called.
 void startVerification(DocumentPanel docpanel, Collection fields)
          Start a background thread that runs the verify() method
 void unpause()
          Unpause the task after a call to PDFBackgroundTask.pause()
 void verify(DocumentPanel docpanel, Collection fields)
          Verify the specified collection of fields.
 
Methods inherited from class org.faceless.pdf2.viewer2.ViewerFeature
getAllEnabledFeatures, getAllFeatures, getCustomJavaScript, getFeatureProperty, getFeatureURLProperty, getName, setFeatureName, teardown, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BackgroundSignatureVerifier

public BackgroundSignatureVerifier()
Method Detail

initialize

public void initialize(PDFViewer viewer)
Description copied from class: ViewerFeature
Called when the feature is first added to a viewer

Overrides:
initialize in class ViewerFeature

isEnabledByDefault

public boolean isEnabledByDefault()
Description copied from class: ViewerFeature
Return true if this feature is enabled by default (the default). Disabled features are excluded from the list returned by ViewerFeature.getAllEnabledFeatures() and by the PDFViewerApplet and PDFTool

Overrides:
isEnabledByDefault in class ViewerFeature

documentUpdated

public void documentUpdated(DocumentPanelEvent event)
Description copied from interface: DocumentPanelListener
Called when an DocumentPanelEvent is raised

Specified by:
documentUpdated in interface DocumentPanelListener

isPaused

public boolean isPaused()
Description copied from interface: PDFBackgroundTask
Return true if the task has been paused with the PDFBackgroundTask.pause() method

Specified by:
isPaused in interface PDFBackgroundTask

isRunning

public boolean isRunning()
Description copied from interface: PDFBackgroundTask
Returns true if the task is still running

Specified by:
isRunning in interface PDFBackgroundTask

pause

public void pause()
Description copied from interface: PDFBackgroundTask
Pause the task until the PDFBackgroundTask.unpause() method is called. This method waits until the task has actually paused.

Specified by:
pause in interface PDFBackgroundTask

unpause

public void unpause()
Description copied from interface: PDFBackgroundTask
Unpause the task after a call to PDFBackgroundTask.pause()

Specified by:
unpause in interface PDFBackgroundTask

startVerification

public void startVerification(DocumentPanel docpanel,
                              Collection fields)
Start a background thread that runs the verify() method

Parameters:
docpanel - the DocumentPanel containing the signatures being verified
fields - a Collection containing the fields to verify

verify

public void verify(DocumentPanel docpanel,
                   Collection fields)
Verify the specified collection of fields. Fields will be verified if only one SignatureProvider can be found that canVerify() them.

Parameters:
docpanel - the DocumentPanel containing the signatures being verified
fields - a Collection containing the fields to verify. Only signed FormSignature fields from this Collection will be checked, so it's safe to pass pdf.getForm().getElements().values() to check all fields


Copyright © 2001-2010 Big Faceless Organization