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 intgetAppearance()
abstract voidsetAppearance(int value)
           Gets or sets the appearance of the structured document tag. The value of the property is SdtAppearance integer constant.
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 booleanisMultiSection()
           Returns true if this instance is a ranged (multi-section) structured document tag.
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 NodegetNode()
           Returns Node object that implements this interface.
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.

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 NodeCollectiongetChildNodes(int nodeType, boolean isDeep)
           Returns a live collection of child nodes that match the specified types.
abstract booleanisRanged()
          Deprecated. Returns true if this instance is a ranged structured document tag.
abstract voidremoveSelfOnly()
           Removes just this SDT node itself, but keeps the content of it inside the document tree.
abstract NodestructuredDocumentTagNode()
          Deprecated. Returns Node object that implements this interface.
 

Property Getters/Setters Detail

getAppearance/setAppearance

public abstract int getAppearance() / public abstract void setAppearance(int value)
Gets or sets the appearance of the structured document tag. The value of the property is SdtAppearance integer constant.

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.


isMultiSection

public abstract boolean isMultiSection()
Returns true if this instance is a ranged (multi-section) 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.isMultiSection());
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());

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.

getNode

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

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.


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.isMultiSection());
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

getChildNodes

public abstract NodeCollection getChildNodes(int nodeType, boolean isDeep)
Returns a live collection of child nodes that match the specified types.
Parameters:
nodeType - A NodeType value.

Example:

Shows how to remove structured document tag, but keeps content inside.
Document doc = new Document(getMyDir() + "Structured document tags.docx");

// This collection provides a unified interface for accessing ranged and non-ranged structured tags.
StructuredDocumentTagCollection sdts = doc.getRange().getStructuredDocumentTags();
Assert.assertEquals(5, sdts.getCount());

// Here we can get child nodes from the common interface of ranged and non-ranged structured tags.
for (IStructuredDocumentTag sdt : sdts)
    if (sdt.getChildNodes(NodeType.ANY, false).getCount() > 0)
        sdt.removeSelfOnly();

sdts = doc.getRange().getStructuredDocumentTags();
Assert.assertEquals(0, sdts.getCount());

isRanged

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

removeSelfOnly

public abstract void removeSelfOnly()
                                 throws java.lang.Exception
Removes just this SDT node itself, but keeps the content of it inside the document tree.

Example:

Shows how to remove structured document tag, but keeps content inside.
Document doc = new Document(getMyDir() + "Structured document tags.docx");

// This collection provides a unified interface for accessing ranged and non-ranged structured tags.
StructuredDocumentTagCollection sdts = doc.getRange().getStructuredDocumentTags();
Assert.assertEquals(5, sdts.getCount());

// Here we can get child nodes from the common interface of ranged and non-ranged structured tags.
for (IStructuredDocumentTag sdt : sdts)
    if (sdt.getChildNodes(NodeType.ANY, false).getCount() > 0)
        sdt.removeSelfOnly();

sdts = doc.getRange().getStructuredDocumentTags();
Assert.assertEquals(0, sdts.getCount());

structuredDocumentTagNode

@Deprecated
public abstract Node structuredDocumentTagNode()
Deprecated. 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.