public class MarkupLevel
Example:
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
// Get specific style from the document to apply it to an SDT
Style quoteStyle = doc.getStyles().getByStyleIdentifier(StyleIdentifier.QUOTE);
StructuredDocumentTag sdtPlainText = new StructuredDocumentTag(doc, SdtType.PLAIN_TEXT, MarkupLevel.INLINE);
sdtPlainText.setStyle(quoteStyle);
StructuredDocumentTag sdtRichText = new StructuredDocumentTag(doc, SdtType.RICH_TEXT, MarkupLevel.INLINE);
// Second method to apply specific style to an SDT control
sdtRichText.setStyleName("Quote");
// Insert content controls into the document
builder.insertNode(sdtPlainText);
builder.insertNode(sdtRichText);
// We can get a collection of StructuredDocumentTags by looking for the document's child nodes of this NodeType
Assert.assertEquals(sdtPlainText.getNodeType(), NodeType.STRUCTURED_DOCUMENT_TAG);
NodeCollection tags = doc.getChildNodes(NodeType.STRUCTURED_DOCUMENT_TAG, true);
for (StructuredDocumentTag sdt : (Iterable<StructuredDocumentTag>) tags) {
// If style was not defined before, style should be "Default Paragraph Font"
Assert.assertEquals(StyleIdentifier.QUOTE, sdt.getStyle().getStyleIdentifier());
Assert.assertEquals("Quote", sdt.getStyleName());
}
Field Summary | ||
---|---|---|
static final int | UNKNOWN | |
Specifies the unknown or invalid value.
|
||
static final int | INLINE | |
The element occurs at the inline level (e.g. among as runs of text).
|
||
static final int | BLOCK | |
The element occurs at the block level (e.g. among tables and paragraphs).
|
||
static final int | ROW | |
The element occurs among rows in a table.
|
||
static final int | CELL | |
The element occurs among cells in a row.
|
public static final int UNKNOWN
public static final int INLINE
public static final int BLOCK
public static final int ROW
public static final int CELL