aspose.pdf
Class JavaScripts

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList
              extended by aspose.pdf.JavaScripts
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, java.util.RandomAccess

public class JavaScripts
extends java.util.ArrayList

Represents a collection of JavaScript objects.

Typical usages are the following:

[Java] Pdf pdf1 = new Pdf(); pdf1.setJavaScripts(new JavaScripts()); pdf1.getJavaScripts().add(new JavaScript("this.print(true);")); pdf1.getJavaScripts().add("app.alert(\"hello world\");"); pdf1.save(....); [XML] <Pdf xmlns="Aspose.Pdf"> <JavaScript ID="js1">this.print(true);</JavaScript> <JavaScript>app.alert("hello world");</JavaScript> </Pdf>

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
JavaScripts()
           
 
Method Summary
 JavaScript add()
          Initializes a new instance of the JavaScript class and add it to the JavaScripts collection.
 void add(JavaScript script)
          Adds a new JavaScript object into the collection.
 JavaScript add(java.lang.String script)
          Initializes a new instance of the JavaScript class and add it to the JavaScripts collection.
 JavaScript getJavaScript(int index)
          Gets a JavaScript object from the collection according to JavaScript index.
 JavaScript getJavaScript(java.lang.String jsID)
          Gets a JavaScript object from the collection according to JavaScript ID.
 int indexOf(JavaScript js)
          Gets the index of a specified JavaScript in the collection.
 void insert(int index, JavaScript js)
          Inserts a new JavaScript object into the collection at specified position.
 void Remove(Cell jsToRemove)
          Removes a JavaScript object from the collection.
 void setJavaScript(int index, JavaScript value)
          Sets a JavaScript object from the collection according to JavaScript index.
 void setJavaScript(java.lang.String jsID, JavaScript value)
          Sets a JavaScript object from the collection according to JavaScript ID.
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Constructor Detail

JavaScripts

public JavaScripts()
Method Detail

add

public JavaScript add()
Initializes a new instance of the JavaScript class and add it to the JavaScripts collection.

Returns:
The JavaScript object that is created.

add

public void add(JavaScript script)
Adds a new JavaScript object into the collection.

Parameters:
script - The JavaScript object to be added.

add

public JavaScript add(java.lang.String script)
Initializes a new instance of the JavaScript class and add it to the JavaScripts collection.

Parameters:
script - The content of the script.
Returns:
The JavaScript object that is created.

getJavaScript

public JavaScript getJavaScript(int index)
Gets a JavaScript object from the collection according to JavaScript index.

Parameters:
index -

setJavaScript

public void setJavaScript(int index,
                          JavaScript value)
Sets a JavaScript object from the collection according to JavaScript index.

Parameters:
index -
value -

getJavaScript

public JavaScript getJavaScript(java.lang.String jsID)
Gets a JavaScript object from the collection according to JavaScript ID.

Parameters:
jsID -

setJavaScript

public void setJavaScript(java.lang.String jsID,
                          JavaScript value)
Sets a JavaScript object from the collection according to JavaScript ID.

Parameters:
jsID -
value -

insert

public void insert(int index,
                   JavaScript js)
Inserts a new JavaScript object into the collection at specified position.

Parameters:
index - The zero-based index at which JavaScript object should be inserted.
js - The JavaScript object to be inserted.

Remove

public void Remove(Cell jsToRemove)
Removes a JavaScript object from the collection.

Parameters:
jsToRemove - The JavaScript object to be removed.

indexOf

public int indexOf(JavaScript js)
Gets the index of a specified JavaScript in the collection.

Parameters:
js - The specified JavaScript object.
Returns:
The index value.