com.qoppa.pdf
Class JavaScriptEnabler

java.lang.Object
  extended by com.qoppa.pdf.JavaScriptEnabler
All Implemented Interfaces:
IJavaScriptEnabler

public class JavaScriptEnabler
extends Object
implements IJavaScriptEnabler

An implementation of IJavaScriptEnabler that can be set to true or false on construction. This implementation does not look at the document, it is document independent.


Constructor Summary
JavaScriptEnabler(boolean enable)
          Construct an instance with a set value for enabling / disabling Javascript.
 
Method Summary
 boolean shouldEnableJS(IPDFDocument document)
          Implementation of the IJavaScriptEnabler contract.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaScriptEnabler

public JavaScriptEnabler(boolean enable)
Construct an instance with a set value for enabling / disabling Javascript.

Parameters:
enable - Flag to enable / disable Javascript.
Method Detail

shouldEnableJS

public boolean shouldEnableJS(IPDFDocument document)
Implementation of the IJavaScriptEnabler contract.

Specified by:
shouldEnableJS in interface IJavaScriptEnabler
Parameters:
document - The PDF document that is being loaded. An implementation of this class can look at the document to see if it should enable or disable Javascript.
Returns:
true if Javascript should be enabled for this document.