com.aspose.words
Class BaseWebExtensionCollection

java.lang.Object
    extended by com.aspose.words.BaseWebExtensionCollection
All Implemented Interfaces:
java.lang.Iterable
Direct Known Subclasses:
TaskPaneCollection, WebExtensionBindingCollection, WebExtensionPropertyCollection, WebExtensionReferenceCollection

public abstract class BaseWebExtensionCollection 
extends java.lang.Object

Base class for TaskPaneCollection, WebExtensionBindingCollection, WebExtensionPropertyCollection and WebExtensionReferenceCollection collections. Type of a collection item.

Example:

Shows how to work with web extension collections.
Document doc = new Document(getMyDir() + "Web extension.docx");

// Add new taskpane to the collection
TaskPane newTaskPane = new TaskPane();
doc.getWebExtensionTaskPanes().add(newTaskPane);

// Enumerate all WebExtensionProperty in a collection
WebExtensionPropertyCollection webExtensionPropertyCollection = doc.getWebExtensionTaskPanes().get(0).getWebExtension().getProperties();
Iterator<WebExtensionProperty> enumerator = webExtensionPropertyCollection.iterator();
try {
    while (enumerator.hasNext()) {
        WebExtensionProperty webExtensionProperty = enumerator.next();
        System.out.println("Binding name: {webExtensionProperty.Name}; Binding value: {webExtensionProperty.Value}");
    }
} finally {
    if (enumerator != null) enumerator.remove();
}

// We can remove task panes one by one or clear the entire collection
doc.getWebExtensionTaskPanes().remove(1);
doc.getWebExtensionTaskPanes().clear();

Property Getters/Setters Summary
intgetCount()
           Gets the number of elements contained in the collection.
java.lang.Objectget(int index)
voidset(int index, java.lang.Object value)
           Gets or sets an item at the specified index.
 
Method Summary
voidadd(java.lang.Object item)
          
voidclear()
           Removes all elements from the collection.
java.util.Iteratoriterator()
           Returns an enumerator that can iterate through a collection.
voidremove(int index)
           Removes the item at the specified index from the collection.
 

Property Getters/Setters Detail

getCount

public int getCount()
Gets the number of elements contained in the collection.

Example:

Shows how to work with web extension collections.
Document doc = new Document(getMyDir() + "Web extension.docx");

// Add new taskpane to the collection
TaskPane newTaskPane = new TaskPane();
doc.getWebExtensionTaskPanes().add(newTaskPane);

// Enumerate all WebExtensionProperty in a collection
WebExtensionPropertyCollection webExtensionPropertyCollection = doc.getWebExtensionTaskPanes().get(0).getWebExtension().getProperties();
Iterator<WebExtensionProperty> enumerator = webExtensionPropertyCollection.iterator();
try {
    while (enumerator.hasNext()) {
        WebExtensionProperty webExtensionProperty = enumerator.next();
        System.out.println("Binding name: {webExtensionProperty.Name}; Binding value: {webExtensionProperty.Value}");
    }
} finally {
    if (enumerator != null) enumerator.remove();
}

// We can remove task panes one by one or clear the entire collection
doc.getWebExtensionTaskPanes().remove(1);
doc.getWebExtensionTaskPanes().clear();

get/set

public java.lang.Object get(int index) / public void set(int index, java.lang.Object value)
Gets or sets an item at the specified index.
Parameters:
index - Zero-based index of the item.

Example:

Shows how to work with web extension collections.
Document doc = new Document(getMyDir() + "Web extension.docx");

// Add new taskpane to the collection
TaskPane newTaskPane = new TaskPane();
doc.getWebExtensionTaskPanes().add(newTaskPane);

// Enumerate all WebExtensionProperty in a collection
WebExtensionPropertyCollection webExtensionPropertyCollection = doc.getWebExtensionTaskPanes().get(0).getWebExtension().getProperties();
Iterator<WebExtensionProperty> enumerator = webExtensionPropertyCollection.iterator();
try {
    while (enumerator.hasNext()) {
        WebExtensionProperty webExtensionProperty = enumerator.next();
        System.out.println("Binding name: {webExtensionProperty.Name}; Binding value: {webExtensionProperty.Value}");
    }
} finally {
    if (enumerator != null) enumerator.remove();
}

// We can remove task panes one by one or clear the entire collection
doc.getWebExtensionTaskPanes().remove(1);
doc.getWebExtensionTaskPanes().clear();

Method Detail

add

public void add(java.lang.Object item)

clear

public void clear()
Removes all elements from the collection.

Example:

Shows how to work with web extension collections.
Document doc = new Document(getMyDir() + "Web extension.docx");

// Add new taskpane to the collection
TaskPane newTaskPane = new TaskPane();
doc.getWebExtensionTaskPanes().add(newTaskPane);

// Enumerate all WebExtensionProperty in a collection
WebExtensionPropertyCollection webExtensionPropertyCollection = doc.getWebExtensionTaskPanes().get(0).getWebExtension().getProperties();
Iterator<WebExtensionProperty> enumerator = webExtensionPropertyCollection.iterator();
try {
    while (enumerator.hasNext()) {
        WebExtensionProperty webExtensionProperty = enumerator.next();
        System.out.println("Binding name: {webExtensionProperty.Name}; Binding value: {webExtensionProperty.Value}");
    }
} finally {
    if (enumerator != null) enumerator.remove();
}

// We can remove task panes one by one or clear the entire collection
doc.getWebExtensionTaskPanes().remove(1);
doc.getWebExtensionTaskPanes().clear();

iterator

public java.util.Iterator iterator()
Returns an enumerator that can iterate through a collection.
Returns:

Example:

Shows how to work with web extension collections.
Document doc = new Document(getMyDir() + "Web extension.docx");

// Add new taskpane to the collection
TaskPane newTaskPane = new TaskPane();
doc.getWebExtensionTaskPanes().add(newTaskPane);

// Enumerate all WebExtensionProperty in a collection
WebExtensionPropertyCollection webExtensionPropertyCollection = doc.getWebExtensionTaskPanes().get(0).getWebExtension().getProperties();
Iterator<WebExtensionProperty> enumerator = webExtensionPropertyCollection.iterator();
try {
    while (enumerator.hasNext()) {
        WebExtensionProperty webExtensionProperty = enumerator.next();
        System.out.println("Binding name: {webExtensionProperty.Name}; Binding value: {webExtensionProperty.Value}");
    }
} finally {
    if (enumerator != null) enumerator.remove();
}

// We can remove task panes one by one or clear the entire collection
doc.getWebExtensionTaskPanes().remove(1);
doc.getWebExtensionTaskPanes().clear();

remove

public void remove(int index)
Removes the item at the specified index from the collection.
Parameters:
index - The zero-based index of the collection item.

Example:

Shows how to work with web extension collections.
Document doc = new Document(getMyDir() + "Web extension.docx");

// Add new taskpane to the collection
TaskPane newTaskPane = new TaskPane();
doc.getWebExtensionTaskPanes().add(newTaskPane);

// Enumerate all WebExtensionProperty in a collection
WebExtensionPropertyCollection webExtensionPropertyCollection = doc.getWebExtensionTaskPanes().get(0).getWebExtension().getProperties();
Iterator<WebExtensionProperty> enumerator = webExtensionPropertyCollection.iterator();
try {
    while (enumerator.hasNext()) {
        WebExtensionProperty webExtensionProperty = enumerator.next();
        System.out.println("Binding name: {webExtensionProperty.Name}; Binding value: {webExtensionProperty.Value}");
    }
} finally {
    if (enumerator != null) enumerator.remove();
}

// We can remove task panes one by one or clear the entire collection
doc.getWebExtensionTaskPanes().remove(1);
doc.getWebExtensionTaskPanes().clear();

See Also:
          Aspose.Words Documentation - the home page for the Aspose.Words Product Documentation.
          Aspose.Words Support Forum - our preferred method of support.