com.aspose.words
Class WebExtensionBinding

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

public class WebExtensionBinding 
extends java.lang.Object

Specifies a binding relationship between a web extension and the data in the document.

Constructor Summary
WebExtensionBinding(java.lang.String id, int bindingType, java.lang.String appRef)
           Creates web extension binding with specified parameters.
 
Property Getters/Setters Summary
java.lang.StringgetAppRef()
voidsetAppRef(java.lang.String value)
           Specifies the binding key used to map the binding entry in this list with the bound data in the document.
intgetBindingType()
voidsetBindingType(int value)
           Specifies the binding type. The value of the property is WebExtensionBindingType integer constant.
java.lang.StringgetId()
voidsetId(java.lang.String value)
           Specifies the binding identifier.
 

Constructor Detail

WebExtensionBinding

public WebExtensionBinding(java.lang.String id, int bindingType, java.lang.String appRef)
Creates web extension binding with specified parameters.
Parameters:
id - Binding identifier.
bindingType - A WebExtensionBindingType value. Binding type.
appRef - Binding key used to map the binding entry in this list with the bound data in the document.

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 task panes
myScriptTaskPane.setRow(1);

// Add "MyScript Math Sample" add-in which will be displayed inside task pane
WebExtension webExtension = myScriptTaskPane.getWebExtension();

// Application Id from store
webExtension.getReference().setId("WA104380646");
// The current version of the application used
webExtension.getReference().setVersion("1.0.0.0");
// Type of marketplace
webExtension.getReference().setStoreType(WebExtensionStoreType.OMEX);
// Marketplace based on your locale
webExtension.getReference().setStore(Locale.getDefault().getDisplayName());

webExtension.getProperties().add(new WebExtensionProperty("MyScript", "MyScript Math Sample"));
webExtension.getBindings().add(new WebExtensionBinding("MyScript", WebExtensionBindingType.TEXT, "104380646"));

// Use this option if you need to block web extension from any action
webExtension.isFrozen(false);

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

Property Getters/Setters Detail

getAppRef/setAppRef

public java.lang.String getAppRef() / public void setAppRef(java.lang.String value)
Specifies the binding key used to map the binding entry in this list with the bound data in the document.

getBindingType/setBindingType

public int getBindingType() / public void setBindingType(int value)
Specifies the binding type. The value of the property is WebExtensionBindingType integer constant.

getId/setId

public java.lang.String getId() / public void setId(java.lang.String value)
Specifies the binding identifier.

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