public class BuildingBlock extends CompositeNode
To learn more, visit the Aspose.Words Document Object Model (DOM) documentation article.
BuildingBlock can contain only Section nodes.
BuildingBlock can only be a child of GlossaryDocument.
You can create new building blocks and insert them into a glossary document. You can modify or delete existing building blocks. You can copy or move building blocks between documents. You can insert content of a building block into a document.
Corresponds to the docPart, docPartPr and docPartBody elements in OOXML.
GlossaryDocument| Constructor and Description |
|---|
BuildingBlock(GlossaryDocument glossaryDoc)
Initializes a new instance of this class.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
accept(DocumentVisitor visitor)
Accepts a visitor.
|
int |
getBehavior()
Specifies the behavior that shall be applied when the contents of the building block is inserted into the main document.
|
java.lang.String |
getCategory()
Specifies the second-level categorization for the building block.
|
java.lang.String |
getDescription()
Gets the description associated with this building block.
|
Section |
getFirstSection()
Gets the first section in the building block.
|
int |
getGallery()
Specifies the first-level categorization for the building block for the purposes of classification or user interface sorting.
|
java.util.UUID |
getGuid()
Gets an identifier (a 128-bit GUID) that uniquely identifies this building block.
|
Section |
getLastSection()
Gets the last section in the building block.
|
java.lang.String |
getName()
Gets the name of this building block.
|
int |
getNodeType()
Returns the
NodeType.BUILDING_BLOCK value. |
SectionCollection |
getSections()
Returns a collection that represents all sections in the building block.
|
int |
getType()
Specifies the building block type.
|
void |
setBehavior(int value)
Specifies the behavior that shall be applied when the contents of the building block is inserted into the main document.
|
void |
setCategory(java.lang.String value)
Specifies the second-level categorization for the building block.
|
void |
setDescription(java.lang.String value)
Sets the description associated with this building block.
|
void |
setGallery(int value)
Specifies the first-level categorization for the building block for the purposes of classification or user interface sorting.
|
void |
setGuid(java.util.UUID value)
Sets an identifier (a 128-bit GUID) that uniquely identifies this building block.
|
void |
setName(java.lang.String value)
Sets the name of this building block.
|
void |
setType(int value)
Specifies the building block type.
|
acceptChildren, acceptCore, appendChild, coreRemoveSelfOnly, getChild, getChildNodes, getChildNodes, getContainer, getCount, getCurrentNode, getFirstChild, getLastChild, getNextMatchingNode, getText, hasChildNodes, indexOf, insertAfter, insertBefore, isComposite, iterator, prependChild, removeAllChildren, removeChild, removeSmartTags, selectNodes, selectSingleNodedd, deepClone, getAncestor, getAncestor, getCustomNodeId, getDocument, getNextSibling, getParentNode, getPreviousSibling, getRange, memberwiseClone, nextPreOrder, nodeTypeToString, previousPreOrder, remove, setCustomNodeId, toString, toString, toString, visitorActionToBoolpublic BuildingBlock(GlossaryDocument glossaryDoc)
When BuildingBlock is created, it belongs to the specified glossary document, but is not yet part of the glossary document and Node.getParentNode() is null.
To append BuildingBlock to a GlossaryDocument use CompositeNode.appendChild(com.aspose.words.Node).
glossaryDoc - The owner document.public int getNodeType()
NodeType.BUILDING_BLOCK value.getNodeType in class NodeNodeType.BUILDING_BLOCK value. The returned value is one of NodeType constants.public boolean accept(DocumentVisitor visitor) throws java.lang.Exception
Enumerates over this node and all of its children. Each node calls a corresponding method on DocumentVisitor.
For more info see the Visitor design pattern.
public SectionCollection getSections()
public Section getFirstSection()
null if there are no sections.public Section getLastSection()
null if there are no sections.public java.lang.String getName()
The name may contain any string content, usually a friendly identifier. Multiple building blocks can have the same name.
Cannot be null and cannot be an empty string.
Corresponds to the docPartPr.name element in OOXML.
getGallery(),
setGallery(int),
getCategory(),
setCategory(java.lang.String)public void setName(java.lang.String value)
The name may contain any string content, usually a friendly identifier. Multiple building blocks can have the same name.
Cannot be null and cannot be an empty string.
Corresponds to the docPartPr.name element in OOXML.
value - The name of this building block.getGallery(),
setGallery(int),
getCategory(),
setCategory(java.lang.String)public java.util.UUID getGuid()
Can be used by an application to uniquely reference a building block regardless of different naming due to localization.
Corresponds to the docPartPr.guid element in OOXML.
public void setGuid(java.util.UUID value)
Can be used by an application to uniquely reference a building block regardless of different naming due to localization.
Corresponds to the docPartPr.guid element in OOXML.
value - An identifier (a 128-bit GUID) that uniquely identifies this building block.public java.lang.String getDescription()
The description may contain any string content, usually additional information.
Cannot be null, but can be an empty string.
Corresponds to the docPartPr.description element in OOXML.
public void setDescription(java.lang.String value)
The description may contain any string content, usually additional information.
Cannot be null, but can be an empty string.
Corresponds to the docPartPr.description element in OOXML.
value - The description associated with this building block.public int getGallery()
Building blocks in Microsoft Word user interface are arranged into Galleries. Each getGallery() / setGallery(int) can have multiple Categories. Each block within a getCategory() / setCategory(java.lang.String) has a getName() / setName(java.lang.String).
Corresponds to the docPartPr.category.gallery element in OOXML.
int value. The returned value is one of BuildingBlockGallery constants.getCategory(),
setCategory(java.lang.String),
getName(),
setName(java.lang.String)public void setGallery(int value)
Building blocks in Microsoft Word user interface are arranged into Galleries. Each getGallery() / setGallery(int) can have multiple Categories. Each block within a getCategory() / setCategory(java.lang.String) has a getName() / setName(java.lang.String).
Corresponds to the docPartPr.category.gallery element in OOXML.
value - The corresponding int value. The value must be one of BuildingBlockGallery constants.getCategory(),
setCategory(java.lang.String),
getName(),
setName(java.lang.String)public java.lang.String getCategory()
Building blocks in Microsoft Word user interface are arranged into Galleries. Each getGallery() / setGallery(int) can have multiple Categories. Each block within a getCategory() / setCategory(java.lang.String) has a getName() / setName(java.lang.String).
Cannot be null and cannot be an empty string.
Corresponds to the docPartPr.category.name element in OOXML.
String value.getGallery(),
setGallery(int),
getName(),
setName(java.lang.String)public void setCategory(java.lang.String value)
Building blocks in Microsoft Word user interface are arranged into Galleries. Each getGallery() / setGallery(int) can have multiple Categories. Each block within a getCategory() / setCategory(java.lang.String) has a getName() / setName(java.lang.String).
Cannot be null and cannot be an empty string.
Corresponds to the docPartPr.category.name element in OOXML.
value - The corresponding String value.getGallery(),
setGallery(int),
getName(),
setName(java.lang.String)public int getBehavior()
int value. The returned value is one of BuildingBlockBehavior constants.public void setBehavior(int value)
value - The corresponding int value. The value must be one of BuildingBlockBehavior constants.public int getType()
The building block type can influence the visibility and behavior of the building block in Microsoft Word.
Corresponds to the docPartPr.types element in OOXML.
int value. The returned value is one of BuildingBlockType constants.public void setType(int value)
The building block type can influence the visibility and behavior of the building block in Microsoft Word.
Corresponds to the docPartPr.types element in OOXML.
value - The corresponding int value. The value must be one of BuildingBlockType constants.