com.aspose.words
Interface IStructuredDocumentTag

All Known Implementing Classes:
StructuredDocumentTagRangeStart, StructuredDocumentTag

public interface IStructuredDocumentTag 

Interface to define a common data for StructuredDocumentTag and StructuredDocumentTagRangeStart.

Property Getters/Setters Summary
abstract java.awt.ColorgetColor()
abstract voidsetColor(java.awt.Color value)
           Gets or sets the color of the structured document tag.
abstract intgetId()
          

Specifies a unique read-only persistent numerical Id for this SDT.

abstract booleanisShowingPlaceholderText()
abstract voidisShowingPlaceholderText(boolean value)
          

Specifies whether the content of this SDT shall be interpreted to contain placeholder text (as opposed to regular text contents within the SDT).

if set to true, this state shall be resumed (showing placeholder text) upon opening this document.

abstract intgetLevel()
           Gets the level at which this SDT occurs in the document tree. The value of the property is MarkupLevel integer constant.
abstract booleangetLockContentControl()
abstract voidsetLockContentControl(boolean value)
           When set to true, this property will prohibit a user from deleting this SDT.
abstract booleangetLockContents()
abstract voidsetLockContents(boolean value)
           When set to true, this property will prohibit a user from editing the contents of this SDT.
abstract BuildingBlockgetPlaceholder()
           Gets the BuildingBlock containing placeholder text which should be displayed when this SDT run contents are empty, the associated mapped XML element is empty as specified via the XmlMapping element or the IsShowingPlaceholderText element is true.
abstract java.lang.StringgetPlaceholderName()
abstract voidsetPlaceholderName(java.lang.String value)
          

Gets or sets Name of the BuildingBlock containing placeholder text.

BuildingBlock with this name BuildingBlock.Name has to be present in the Document.GlossaryDocument otherwise java.lang.IllegalStateException will occur.

abstract intgetSdtType()
           Gets type of this Structured document tag. The value of the property is SdtType integer constant.
abstract java.lang.StringgetTag()
abstract voidsetTag(java.lang.String value)
           Specifies a tag associated with the current SDT node. Can not be null.
abstract java.lang.StringgetTitle()
abstract voidsetTitle(java.lang.String value)
           Specifies the friendly name associated with this SDT. Can not be null.
abstract java.lang.StringgetWordOpenXML()
           Gets a string that represents the XML contained within the node in the SaveFormat.FLAT_OPC format.
abstract XmlMappinggetXmlMapping()
           Gets an object that represents the mapping of this structured document tag to XML data in a custom XML part of the current document.
 
Method Summary
abstract booleanisRanged()
           Returns true if this instance is a ranged structured document tag.
abstract NodestructuredDocumentTagNode()
           Returns Node object that implements this interface.
 

Property Getters/Setters Detail

getColor/setColor

public abstract java.awt.Color getColor() / public abstract void setColor(java.awt.Color value)
Gets or sets the color of the structured document tag.

getId

public abstract int getId()

Specifies a unique read-only persistent numerical Id for this SDT.


isShowingPlaceholderText/isShowingPlaceholderText

public abstract boolean isShowingPlaceholderText() / public abstract void isShowingPlaceholderText(boolean value)

Specifies whether the content of this SDT shall be interpreted to contain placeholder text (as opposed to regular text contents within the SDT).

if set to true, this state shall be resumed (showing placeholder text) upon opening this document.


getLevel

public abstract int getLevel()
Gets the level at which this SDT occurs in the document tree. The value of the property is MarkupLevel integer constant.

getLockContentControl/setLockContentControl

public abstract boolean getLockContentControl() / public abstract void setLockContentControl(boolean value)
When set to true, this property will prohibit a user from deleting this SDT.

getLockContents/setLockContents

public abstract boolean getLockContents() / public abstract void setLockContents(boolean value)
When set to true, this property will prohibit a user from editing the contents of this SDT.

getPlaceholder

public abstract BuildingBlock getPlaceholder()
Gets the BuildingBlock containing placeholder text which should be displayed when this SDT run contents are empty, the associated mapped XML element is empty as specified via the XmlMapping element or the IsShowingPlaceholderText element is true. Can be null, meaning that the placeholder is not applicable for this Sdt.

getPlaceholderName/setPlaceholderName

public abstract java.lang.String getPlaceholderName() / public abstract void setPlaceholderName(java.lang.String value)

Gets or sets Name of the BuildingBlock containing placeholder text.

BuildingBlock with this name BuildingBlock.Name has to be present in the Document.GlossaryDocument otherwise java.lang.IllegalStateException will occur.


getSdtType

public abstract int getSdtType()
Gets type of this Structured document tag. The value of the property is SdtType integer constant.

getTag/setTag

public abstract java.lang.String getTag() / public abstract void setTag(java.lang.String value)
Specifies a tag associated with the current SDT node. Can not be null.

getTitle/setTitle

public abstract java.lang.String getTitle() / public abstract void setTitle(java.lang.String value)
Specifies the friendly name associated with this SDT. Can not be null.

Example:

Shows how to get structured document tag.
Document doc = new Document(getMyDir() + "Structured document tags by id.docx");

// Get the structured document tag by Id.
IStructuredDocumentTag sdt = doc.getRange().getStructuredDocumentTags().getById(1160505028);
System.out.println(sdt.isRanged());
System.out.println(sdt.getTitle());

// Get the structured document tag or ranged tag by Title.
sdt = doc.getRange().getStructuredDocumentTags().getByTitle("Alias4");
System.out.println(sdt.getId());

getWordOpenXML

public abstract java.lang.String getWordOpenXML()
Gets a string that represents the XML contained within the node in the SaveFormat.FLAT_OPC format.

getXmlMapping

public abstract XmlMapping getXmlMapping()
Gets an object that represents the mapping of this structured document tag to XML data in a custom XML part of the current document. You can use the XmlMapping.setMapping(com.aspose.words.CustomXmlPart,java.lang.String,java.lang.String) method of this object to map a structured document tag to XML data.

Method Detail

isRanged

public abstract boolean isRanged()
Returns true if this instance is a ranged structured document tag.

Example:

Shows how to get structured document tag.
Document doc = new Document(getMyDir() + "Structured document tags by id.docx");

// Get the structured document tag by Id.
IStructuredDocumentTag sdt = doc.getRange().getStructuredDocumentTags().getById(1160505028);
System.out.println(sdt.isRanged());
System.out.println(sdt.getTitle());

// Get the structured document tag or ranged tag by Title.
sdt = doc.getRange().getStructuredDocumentTags().getByTitle("Alias4");
System.out.println(sdt.getId());

structuredDocumentTagNode

public abstract Node structuredDocumentTagNode()
Returns Node object that implements this interface.

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