com.aspose.words
Class TaskPane

java.lang.Object
    extended by com.aspose.words.TaskPane

public class TaskPane 
extends java.lang.Object

Represents an add-in task pane object.

Example:

Shows how to create add-ins inside the document.
Document doc = new Document();

// Create taskpane with "MyScript" add-in which will be used by the document
TaskPane myScriptTaskPane = new TaskPane();
doc.getWebExtensionTaskPanes().add(myScriptTaskPane);

// Define task pane location when the document opens
myScriptTaskPane.setDockState(TaskPaneDockState.RIGHT);
myScriptTaskPane.isVisible(true);
myScriptTaskPane.setWidth(300.0);
myScriptTaskPane.isLocked(true);
// Use this option if you have several taskpanes
myScriptTaskPane.setRow(1);

// Add "MyScript Math Sample" add-in which will be displayed inside task pane
// Application Id from store
myScriptTaskPane.getWebExtension().getReference().setId("WA104380646");
// The current version of the application used
myScriptTaskPane.getWebExtension().getReference().setVersion("1.0.0.0");
// Type of marketplace
myScriptTaskPane.getWebExtension().getReference().setStoreType(WebExtensionStoreType.OMEX);
// Marketplace based on your locale
myScriptTaskPane.getWebExtension().getReference().setStore("en-us");
myScriptTaskPane.getWebExtension().getProperties().add(new WebExtensionProperty("MyScript", "MyScript Math Sample"));
myScriptTaskPane.getWebExtension().getBindings().add(new WebExtensionBinding("Binding1", WebExtensionBindingType.TEXT, "104380646"));
// Use this option if you need to block web extension from any action
myScriptTaskPane.getWebExtension().isFrozen(false);

doc.save(getArtifactsDir() + "Document.WebExtension.docx");

Constructor Summary
TaskPane()
          
 
Property Getters/Setters Summary
intgetDockState()
voidsetDockState(int value)
           Specifies the last-docked location of this task pane object. The value of the property is TaskPaneDockState integer constant.
booleanisLocked()
voidisLocked(boolean value)
           Specifies whether the task pane is locked to the document in the UI and cannot be closed by the user.
booleanisVisible()
voidisVisible(boolean value)
           Specifies whether the task pane shows as visible by default when the document opens.
intgetRow()
voidsetRow(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.
WebExtensiongetWebExtension()
           Represents an web extension object.
doublegetWidth()
voidsetWidth(double value)
           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 create add-ins inside the document.
Document doc = new Document();

// Create taskpane with "MyScript" add-in which will be used by the document
TaskPane myScriptTaskPane = new TaskPane();
doc.getWebExtensionTaskPanes().add(myScriptTaskPane);

// Define task pane location when the document opens
myScriptTaskPane.setDockState(TaskPaneDockState.RIGHT);
myScriptTaskPane.isVisible(true);
myScriptTaskPane.setWidth(300.0);
myScriptTaskPane.isLocked(true);
// Use this option if you have several taskpanes
myScriptTaskPane.setRow(1);

// Add "MyScript Math Sample" add-in which will be displayed inside task pane
// Application Id from store
myScriptTaskPane.getWebExtension().getReference().setId("WA104380646");
// The current version of the application used
myScriptTaskPane.getWebExtension().getReference().setVersion("1.0.0.0");
// Type of marketplace
myScriptTaskPane.getWebExtension().getReference().setStoreType(WebExtensionStoreType.OMEX);
// Marketplace based on your locale
myScriptTaskPane.getWebExtension().getReference().setStore("en-us");
myScriptTaskPane.getWebExtension().getProperties().add(new WebExtensionProperty("MyScript", "MyScript Math Sample"));
myScriptTaskPane.getWebExtension().getBindings().add(new WebExtensionBinding("Binding1", WebExtensionBindingType.TEXT, "104380646"));
// Use this option if you need to block web extension from any action
myScriptTaskPane.getWebExtension().isFrozen(false);

doc.save(getArtifactsDir() + "Document.WebExtension.docx");

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 create add-ins inside the document.
Document doc = new Document();

// Create taskpane with "MyScript" add-in which will be used by the document
TaskPane myScriptTaskPane = new TaskPane();
doc.getWebExtensionTaskPanes().add(myScriptTaskPane);

// Define task pane location when the document opens
myScriptTaskPane.setDockState(TaskPaneDockState.RIGHT);
myScriptTaskPane.isVisible(true);
myScriptTaskPane.setWidth(300.0);
myScriptTaskPane.isLocked(true);
// Use this option if you have several taskpanes
myScriptTaskPane.setRow(1);

// Add "MyScript Math Sample" add-in which will be displayed inside task pane
// Application Id from store
myScriptTaskPane.getWebExtension().getReference().setId("WA104380646");
// The current version of the application used
myScriptTaskPane.getWebExtension().getReference().setVersion("1.0.0.0");
// Type of marketplace
myScriptTaskPane.getWebExtension().getReference().setStoreType(WebExtensionStoreType.OMEX);
// Marketplace based on your locale
myScriptTaskPane.getWebExtension().getReference().setStore("en-us");
myScriptTaskPane.getWebExtension().getProperties().add(new WebExtensionProperty("MyScript", "MyScript Math Sample"));
myScriptTaskPane.getWebExtension().getBindings().add(new WebExtensionBinding("Binding1", WebExtensionBindingType.TEXT, "104380646"));
// Use this option if you need to block web extension from any action
myScriptTaskPane.getWebExtension().isFrozen(false);

doc.save(getArtifactsDir() + "Document.WebExtension.docx");

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 create add-ins inside the document.
Document doc = new Document();

// Create taskpane with "MyScript" add-in which will be used by the document
TaskPane myScriptTaskPane = new TaskPane();
doc.getWebExtensionTaskPanes().add(myScriptTaskPane);

// Define task pane location when the document opens
myScriptTaskPane.setDockState(TaskPaneDockState.RIGHT);
myScriptTaskPane.isVisible(true);
myScriptTaskPane.setWidth(300.0);
myScriptTaskPane.isLocked(true);
// Use this option if you have several taskpanes
myScriptTaskPane.setRow(1);

// Add "MyScript Math Sample" add-in which will be displayed inside task pane
// Application Id from store
myScriptTaskPane.getWebExtension().getReference().setId("WA104380646");
// The current version of the application used
myScriptTaskPane.getWebExtension().getReference().setVersion("1.0.0.0");
// Type of marketplace
myScriptTaskPane.getWebExtension().getReference().setStoreType(WebExtensionStoreType.OMEX);
// Marketplace based on your locale
myScriptTaskPane.getWebExtension().getReference().setStore("en-us");
myScriptTaskPane.getWebExtension().getProperties().add(new WebExtensionProperty("MyScript", "MyScript Math Sample"));
myScriptTaskPane.getWebExtension().getBindings().add(new WebExtensionBinding("Binding1", WebExtensionBindingType.TEXT, "104380646"));
// Use this option if you need to block web extension from any action
myScriptTaskPane.getWebExtension().isFrozen(false);

doc.save(getArtifactsDir() + "Document.WebExtension.docx");

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 create add-ins inside the document.
Document doc = new Document();

// Create taskpane with "MyScript" add-in which will be used by the document
TaskPane myScriptTaskPane = new TaskPane();
doc.getWebExtensionTaskPanes().add(myScriptTaskPane);

// Define task pane location when the document opens
myScriptTaskPane.setDockState(TaskPaneDockState.RIGHT);
myScriptTaskPane.isVisible(true);
myScriptTaskPane.setWidth(300.0);
myScriptTaskPane.isLocked(true);
// Use this option if you have several taskpanes
myScriptTaskPane.setRow(1);

// Add "MyScript Math Sample" add-in which will be displayed inside task pane
// Application Id from store
myScriptTaskPane.getWebExtension().getReference().setId("WA104380646");
// The current version of the application used
myScriptTaskPane.getWebExtension().getReference().setVersion("1.0.0.0");
// Type of marketplace
myScriptTaskPane.getWebExtension().getReference().setStoreType(WebExtensionStoreType.OMEX);
// Marketplace based on your locale
myScriptTaskPane.getWebExtension().getReference().setStore("en-us");
myScriptTaskPane.getWebExtension().getProperties().add(new WebExtensionProperty("MyScript", "MyScript Math Sample"));
myScriptTaskPane.getWebExtension().getBindings().add(new WebExtensionBinding("Binding1", WebExtensionBindingType.TEXT, "104380646"));
// Use this option if you need to block web extension from any action
myScriptTaskPane.getWebExtension().isFrozen(false);

doc.save(getArtifactsDir() + "Document.WebExtension.docx");

getWebExtension

public WebExtension getWebExtension()
Represents an web extension object.

Example:

Shows how to create add-ins inside the document.
Document doc = new Document();

// Create taskpane with "MyScript" add-in which will be used by the document
TaskPane myScriptTaskPane = new TaskPane();
doc.getWebExtensionTaskPanes().add(myScriptTaskPane);

// Define task pane location when the document opens
myScriptTaskPane.setDockState(TaskPaneDockState.RIGHT);
myScriptTaskPane.isVisible(true);
myScriptTaskPane.setWidth(300.0);
myScriptTaskPane.isLocked(true);
// Use this option if you have several taskpanes
myScriptTaskPane.setRow(1);

// Add "MyScript Math Sample" add-in which will be displayed inside task pane
// Application Id from store
myScriptTaskPane.getWebExtension().getReference().setId("WA104380646");
// The current version of the application used
myScriptTaskPane.getWebExtension().getReference().setVersion("1.0.0.0");
// Type of marketplace
myScriptTaskPane.getWebExtension().getReference().setStoreType(WebExtensionStoreType.OMEX);
// Marketplace based on your locale
myScriptTaskPane.getWebExtension().getReference().setStore("en-us");
myScriptTaskPane.getWebExtension().getProperties().add(new WebExtensionProperty("MyScript", "MyScript Math Sample"));
myScriptTaskPane.getWebExtension().getBindings().add(new WebExtensionBinding("Binding1", WebExtensionBindingType.TEXT, "104380646"));
// Use this option if you need to block web extension from any action
myScriptTaskPane.getWebExtension().isFrozen(false);

doc.save(getArtifactsDir() + "Document.WebExtension.docx");

getWidth/setWidth

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

Example:

Shows how to create add-ins inside the document.
Document doc = new Document();

// Create taskpane with "MyScript" add-in which will be used by the document
TaskPane myScriptTaskPane = new TaskPane();
doc.getWebExtensionTaskPanes().add(myScriptTaskPane);

// Define task pane location when the document opens
myScriptTaskPane.setDockState(TaskPaneDockState.RIGHT);
myScriptTaskPane.isVisible(true);
myScriptTaskPane.setWidth(300.0);
myScriptTaskPane.isLocked(true);
// Use this option if you have several taskpanes
myScriptTaskPane.setRow(1);

// Add "MyScript Math Sample" add-in which will be displayed inside task pane
// Application Id from store
myScriptTaskPane.getWebExtension().getReference().setId("WA104380646");
// The current version of the application used
myScriptTaskPane.getWebExtension().getReference().setVersion("1.0.0.0");
// Type of marketplace
myScriptTaskPane.getWebExtension().getReference().setStoreType(WebExtensionStoreType.OMEX);
// Marketplace based on your locale
myScriptTaskPane.getWebExtension().getReference().setStore("en-us");
myScriptTaskPane.getWebExtension().getProperties().add(new WebExtensionProperty("MyScript", "MyScript Math Sample"));
myScriptTaskPane.getWebExtension().getBindings().add(new WebExtensionBinding("Binding1", WebExtensionBindingType.TEXT, "104380646"));
// Use this option if you need to block web extension from any action
myScriptTaskPane.getWebExtension().isFrozen(false);

doc.save(getArtifactsDir() + "Document.WebExtension.docx");

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