com.aspose.words

Class TaskPane

  • java.lang.Object
    • com.aspose.words.TaskPane
public class TaskPane 
extends java.lang.Object

Represents an add-in task pane object.

Example:

Shows how to add a web extension to a document.
Document doc = new Document();

// Create task pane with "MyScript" add-in, which will be used by the document,
// then set its default location.
TaskPane myScriptTaskPane = new TaskPane();
doc.getWebExtensionTaskPanes().add(myScriptTaskPane);
myScriptTaskPane.setDockState(TaskPaneDockState.RIGHT);
myScriptTaskPane.isVisible(true);
myScriptTaskPane.setWidth(300.0);
myScriptTaskPane.isLocked(true);

// If there are multiple task panes in the same docking location, we can set this index to arrange them.
myScriptTaskPane.setRow(1);

// Create an add-in called "MyScript Math Sample", which the task pane will display within.
WebExtension webExtension = myScriptTaskPane.getWebExtension();

// Set application store reference parameters for our add-in, such as the ID.
webExtension.getReference().setId("WA104380646");
webExtension.getReference().setVersion("1.0.0.0");
webExtension.getReference().setStoreType(WebExtensionStoreType.OMEX);
webExtension.getReference().setStore("English (United States)");
webExtension.getProperties().add(new WebExtensionProperty("MyScript", "MyScript Math Sample"));
webExtension.getBindings().add(new WebExtensionBinding("MyScript", WebExtensionBindingType.TEXT, "104380646"));

// Allow the user to interact with the add-in.
webExtension.isFrozen(false);

// We can access the web extension in Microsoft Word via Developer -> Add-ins.
doc.save(getArtifactsDir() + "Document.WebExtension.docx");

// Remove all web extension task panes at once like this.
doc.getWebExtensionTaskPanes().clear();

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

Constructor Summary
 
Property Getters/Setters Summary
intgetDockState()
void
setDockState(intvalue)
           Specifies the last-docked location of this task pane object. The value of the property is TaskPaneDockState integer constant.
booleanisLocked()
void
isLocked(booleanvalue)
           Specifies whether the task pane is locked to the document in the UI and cannot be closed by the user.
booleanisVisible()
void
isVisible(booleanvalue)
           Specifies whether the task pane shows as visible by default when the document opens.
intgetRow()
void
setRow(intvalue)
           Specifies the index, enumerating from the outside to the inside, of this task pane among other persisted task panes docked in the same default location.
WebExtensiongetWebExtension()
Represents an web extension object.
doublegetWidth()
void
setWidth(doublevalue)
           Specifies the default width value for this task pane instance.
 

    • Constructor Detail

      • TaskPane

        public TaskPane()
    • Property Getters/Setters Detail

      • getDockState/setDockState

        public int getDockState() / public void setDockState(int value)
        
        Specifies the last-docked location of this task pane object. The value of the property is TaskPaneDockState integer constant.

        Example:

        Shows how to add a web extension to a document.
        Document doc = new Document();
        
        // Create task pane with "MyScript" add-in, which will be used by the document,
        // then set its default location.
        TaskPane myScriptTaskPane = new TaskPane();
        doc.getWebExtensionTaskPanes().add(myScriptTaskPane);
        myScriptTaskPane.setDockState(TaskPaneDockState.RIGHT);
        myScriptTaskPane.isVisible(true);
        myScriptTaskPane.setWidth(300.0);
        myScriptTaskPane.isLocked(true);
        
        // If there are multiple task panes in the same docking location, we can set this index to arrange them.
        myScriptTaskPane.setRow(1);
        
        // Create an add-in called "MyScript Math Sample", which the task pane will display within.
        WebExtension webExtension = myScriptTaskPane.getWebExtension();
        
        // Set application store reference parameters for our add-in, such as the ID.
        webExtension.getReference().setId("WA104380646");
        webExtension.getReference().setVersion("1.0.0.0");
        webExtension.getReference().setStoreType(WebExtensionStoreType.OMEX);
        webExtension.getReference().setStore("English (United States)");
        webExtension.getProperties().add(new WebExtensionProperty("MyScript", "MyScript Math Sample"));
        webExtension.getBindings().add(new WebExtensionBinding("MyScript", WebExtensionBindingType.TEXT, "104380646"));
        
        // Allow the user to interact with the add-in.
        webExtension.isFrozen(false);
        
        // We can access the web extension in Microsoft Word via Developer -> Add-ins.
        doc.save(getArtifactsDir() + "Document.WebExtension.docx");
        
        // Remove all web extension task panes at once like this.
        doc.getWebExtensionTaskPanes().clear();
        
        Assert.assertEquals(0, doc.getWebExtensionTaskPanes().getCount());
      • isLocked/isLocked

        public boolean isLocked() / public void isLocked(boolean value)
        
        Specifies whether the task pane is locked to the document in the UI and cannot be closed by the user.

        Example:

        Shows how to add a web extension to a document.
        Document doc = new Document();
        
        // Create task pane with "MyScript" add-in, which will be used by the document,
        // then set its default location.
        TaskPane myScriptTaskPane = new TaskPane();
        doc.getWebExtensionTaskPanes().add(myScriptTaskPane);
        myScriptTaskPane.setDockState(TaskPaneDockState.RIGHT);
        myScriptTaskPane.isVisible(true);
        myScriptTaskPane.setWidth(300.0);
        myScriptTaskPane.isLocked(true);
        
        // If there are multiple task panes in the same docking location, we can set this index to arrange them.
        myScriptTaskPane.setRow(1);
        
        // Create an add-in called "MyScript Math Sample", which the task pane will display within.
        WebExtension webExtension = myScriptTaskPane.getWebExtension();
        
        // Set application store reference parameters for our add-in, such as the ID.
        webExtension.getReference().setId("WA104380646");
        webExtension.getReference().setVersion("1.0.0.0");
        webExtension.getReference().setStoreType(WebExtensionStoreType.OMEX);
        webExtension.getReference().setStore("English (United States)");
        webExtension.getProperties().add(new WebExtensionProperty("MyScript", "MyScript Math Sample"));
        webExtension.getBindings().add(new WebExtensionBinding("MyScript", WebExtensionBindingType.TEXT, "104380646"));
        
        // Allow the user to interact with the add-in.
        webExtension.isFrozen(false);
        
        // We can access the web extension in Microsoft Word via Developer -> Add-ins.
        doc.save(getArtifactsDir() + "Document.WebExtension.docx");
        
        // Remove all web extension task panes at once like this.
        doc.getWebExtensionTaskPanes().clear();
        
        Assert.assertEquals(0, doc.getWebExtensionTaskPanes().getCount());
      • isVisible/isVisible

        public boolean isVisible() / public void isVisible(boolean value)
        
        Specifies whether the task pane shows as visible by default when the document opens.

        Example:

        Shows how to add a web extension to a document.
        Document doc = new Document();
        
        // Create task pane with "MyScript" add-in, which will be used by the document,
        // then set its default location.
        TaskPane myScriptTaskPane = new TaskPane();
        doc.getWebExtensionTaskPanes().add(myScriptTaskPane);
        myScriptTaskPane.setDockState(TaskPaneDockState.RIGHT);
        myScriptTaskPane.isVisible(true);
        myScriptTaskPane.setWidth(300.0);
        myScriptTaskPane.isLocked(true);
        
        // If there are multiple task panes in the same docking location, we can set this index to arrange them.
        myScriptTaskPane.setRow(1);
        
        // Create an add-in called "MyScript Math Sample", which the task pane will display within.
        WebExtension webExtension = myScriptTaskPane.getWebExtension();
        
        // Set application store reference parameters for our add-in, such as the ID.
        webExtension.getReference().setId("WA104380646");
        webExtension.getReference().setVersion("1.0.0.0");
        webExtension.getReference().setStoreType(WebExtensionStoreType.OMEX);
        webExtension.getReference().setStore("English (United States)");
        webExtension.getProperties().add(new WebExtensionProperty("MyScript", "MyScript Math Sample"));
        webExtension.getBindings().add(new WebExtensionBinding("MyScript", WebExtensionBindingType.TEXT, "104380646"));
        
        // Allow the user to interact with the add-in.
        webExtension.isFrozen(false);
        
        // We can access the web extension in Microsoft Word via Developer -> Add-ins.
        doc.save(getArtifactsDir() + "Document.WebExtension.docx");
        
        // Remove all web extension task panes at once like this.
        doc.getWebExtensionTaskPanes().clear();
        
        Assert.assertEquals(0, doc.getWebExtensionTaskPanes().getCount());
      • getRow/setRow

        public int getRow() / public void setRow(int value)
        
        Specifies the index, enumerating from the outside to the inside, of this task pane among other persisted task panes docked in the same default location.

        Example:

        Shows how to add a web extension to a document.
        Document doc = new Document();
        
        // Create task pane with "MyScript" add-in, which will be used by the document,
        // then set its default location.
        TaskPane myScriptTaskPane = new TaskPane();
        doc.getWebExtensionTaskPanes().add(myScriptTaskPane);
        myScriptTaskPane.setDockState(TaskPaneDockState.RIGHT);
        myScriptTaskPane.isVisible(true);
        myScriptTaskPane.setWidth(300.0);
        myScriptTaskPane.isLocked(true);
        
        // If there are multiple task panes in the same docking location, we can set this index to arrange them.
        myScriptTaskPane.setRow(1);
        
        // Create an add-in called "MyScript Math Sample", which the task pane will display within.
        WebExtension webExtension = myScriptTaskPane.getWebExtension();
        
        // Set application store reference parameters for our add-in, such as the ID.
        webExtension.getReference().setId("WA104380646");
        webExtension.getReference().setVersion("1.0.0.0");
        webExtension.getReference().setStoreType(WebExtensionStoreType.OMEX);
        webExtension.getReference().setStore("English (United States)");
        webExtension.getProperties().add(new WebExtensionProperty("MyScript", "MyScript Math Sample"));
        webExtension.getBindings().add(new WebExtensionBinding("MyScript", WebExtensionBindingType.TEXT, "104380646"));
        
        // Allow the user to interact with the add-in.
        webExtension.isFrozen(false);
        
        // We can access the web extension in Microsoft Word via Developer -> Add-ins.
        doc.save(getArtifactsDir() + "Document.WebExtension.docx");
        
        // Remove all web extension task panes at once like this.
        doc.getWebExtensionTaskPanes().clear();
        
        Assert.assertEquals(0, doc.getWebExtensionTaskPanes().getCount());
      • getWebExtension

        public WebExtension getWebExtension()
        
        Represents an web extension object.

        Example:

        Shows how to add a web extension to a document.
        Document doc = new Document();
        
        // Create task pane with "MyScript" add-in, which will be used by the document,
        // then set its default location.
        TaskPane myScriptTaskPane = new TaskPane();
        doc.getWebExtensionTaskPanes().add(myScriptTaskPane);
        myScriptTaskPane.setDockState(TaskPaneDockState.RIGHT);
        myScriptTaskPane.isVisible(true);
        myScriptTaskPane.setWidth(300.0);
        myScriptTaskPane.isLocked(true);
        
        // If there are multiple task panes in the same docking location, we can set this index to arrange them.
        myScriptTaskPane.setRow(1);
        
        // Create an add-in called "MyScript Math Sample", which the task pane will display within.
        WebExtension webExtension = myScriptTaskPane.getWebExtension();
        
        // Set application store reference parameters for our add-in, such as the ID.
        webExtension.getReference().setId("WA104380646");
        webExtension.getReference().setVersion("1.0.0.0");
        webExtension.getReference().setStoreType(WebExtensionStoreType.OMEX);
        webExtension.getReference().setStore("English (United States)");
        webExtension.getProperties().add(new WebExtensionProperty("MyScript", "MyScript Math Sample"));
        webExtension.getBindings().add(new WebExtensionBinding("MyScript", WebExtensionBindingType.TEXT, "104380646"));
        
        // Allow the user to interact with the add-in.
        webExtension.isFrozen(false);
        
        // We can access the web extension in Microsoft Word via Developer -> Add-ins.
        doc.save(getArtifactsDir() + "Document.WebExtension.docx");
        
        // Remove all web extension task panes at once like this.
        doc.getWebExtensionTaskPanes().clear();
        
        Assert.assertEquals(0, doc.getWebExtensionTaskPanes().getCount());
      • getWidth/setWidth

        public double getWidth() / public void setWidth(double value)
        
        Specifies the default width value for this task pane instance.

        Example:

        Shows how to add a web extension to a document.
        Document doc = new Document();
        
        // Create task pane with "MyScript" add-in, which will be used by the document,
        // then set its default location.
        TaskPane myScriptTaskPane = new TaskPane();
        doc.getWebExtensionTaskPanes().add(myScriptTaskPane);
        myScriptTaskPane.setDockState(TaskPaneDockState.RIGHT);
        myScriptTaskPane.isVisible(true);
        myScriptTaskPane.setWidth(300.0);
        myScriptTaskPane.isLocked(true);
        
        // If there are multiple task panes in the same docking location, we can set this index to arrange them.
        myScriptTaskPane.setRow(1);
        
        // Create an add-in called "MyScript Math Sample", which the task pane will display within.
        WebExtension webExtension = myScriptTaskPane.getWebExtension();
        
        // Set application store reference parameters for our add-in, such as the ID.
        webExtension.getReference().setId("WA104380646");
        webExtension.getReference().setVersion("1.0.0.0");
        webExtension.getReference().setStoreType(WebExtensionStoreType.OMEX);
        webExtension.getReference().setStore("English (United States)");
        webExtension.getProperties().add(new WebExtensionProperty("MyScript", "MyScript Math Sample"));
        webExtension.getBindings().add(new WebExtensionBinding("MyScript", WebExtensionBindingType.TEXT, "104380646"));
        
        // Allow the user to interact with the add-in.
        webExtension.isFrozen(false);
        
        // We can access the web extension in Microsoft Word via Developer -> Add-ins.
        doc.save(getArtifactsDir() + "Document.WebExtension.docx");
        
        // Remove all web extension task panes at once like this.
        doc.getWebExtensionTaskPanes().clear();
        
        Assert.assertEquals(0, doc.getWebExtensionTaskPanes().getCount());