com.aspose.words

Class BaseWebExtensionCollection

  • java.lang.Object
    • com.aspose.words.BaseWebExtensionCollection
Type of a collection item.

Example:

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

Assert.assertEquals(1, doc.getWebExtensionTaskPanes().getCount());

// Add new taskpane to the collection
TaskPane newTaskPane = new TaskPane();
doc.getWebExtensionTaskPanes().add(newTaskPane);
Assert.assertEquals(2, doc.getWebExtensionTaskPanes().getCount());

// 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(); }

// Delete specific taskpane from the collection
doc.getWebExtensionTaskPanes().remove(1);

// Or remove all items from the collection
doc.getWebExtensionTaskPanes().clear();

Property Getters/Setters Summary
intgetCount()
Gets the number of elements contained in the collection.
java.lang.Objectget(int index)
void
set(intindex, java.lang.Objectvalue)
           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");
        
        Assert.assertEquals(1, doc.getWebExtensionTaskPanes().getCount());
        
        // Add new taskpane to the collection
        TaskPane newTaskPane = new TaskPane();
        doc.getWebExtensionTaskPanes().add(newTaskPane);
        Assert.assertEquals(2, doc.getWebExtensionTaskPanes().getCount());
        
        // 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(); }
        
        // Delete specific taskpane from the collection
        doc.getWebExtensionTaskPanes().remove(1);
        
        // Or remove all items from the collection
        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");
        
        Assert.assertEquals(1, doc.getWebExtensionTaskPanes().getCount());
        
        // Add new taskpane to the collection
        TaskPane newTaskPane = new TaskPane();
        doc.getWebExtensionTaskPanes().add(newTaskPane);
        Assert.assertEquals(2, doc.getWebExtensionTaskPanes().getCount());
        
        // 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(); }
        
        // Delete specific taskpane from the collection
        doc.getWebExtensionTaskPanes().remove(1);
        
        // Or remove all items from the collection
        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");
        
        Assert.assertEquals(1, doc.getWebExtensionTaskPanes().getCount());
        
        // Add new taskpane to the collection
        TaskPane newTaskPane = new TaskPane();
        doc.getWebExtensionTaskPanes().add(newTaskPane);
        Assert.assertEquals(2, doc.getWebExtensionTaskPanes().getCount());
        
        // 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(); }
        
        // Delete specific taskpane from the collection
        doc.getWebExtensionTaskPanes().remove(1);
        
        // Or remove all items from the collection
        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");
        
        Assert.assertEquals(1, doc.getWebExtensionTaskPanes().getCount());
        
        // Add new taskpane to the collection
        TaskPane newTaskPane = new TaskPane();
        doc.getWebExtensionTaskPanes().add(newTaskPane);
        Assert.assertEquals(2, doc.getWebExtensionTaskPanes().getCount());
        
        // 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(); }
        
        // Delete specific taskpane from the collection
        doc.getWebExtensionTaskPanes().remove(1);
        
        // Or remove all items from the collection
        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");
        
        Assert.assertEquals(1, doc.getWebExtensionTaskPanes().getCount());
        
        // Add new taskpane to the collection
        TaskPane newTaskPane = new TaskPane();
        doc.getWebExtensionTaskPanes().add(newTaskPane);
        Assert.assertEquals(2, doc.getWebExtensionTaskPanes().getCount());
        
        // 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(); }
        
        // Delete specific taskpane from the collection
        doc.getWebExtensionTaskPanes().remove(1);
        
        // Or remove all items from the collection
        doc.getWebExtensionTaskPanes().clear();