public class MarkupLevel
Example:
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
// Below are two ways to apply a style from the document to a structured document tag.
// 1 - Apply a style object from the document's style collection:
Style quoteStyle = doc.getStyles().getByStyleIdentifier(StyleIdentifier.QUOTE);
StructuredDocumentTag sdtPlainText = new StructuredDocumentTag(doc, SdtType.PLAIN_TEXT, MarkupLevel.INLINE);
sdtPlainText.setStyle(quoteStyle);
// 2 - Reference a style in the document by name:
StructuredDocumentTag sdtRichText = new StructuredDocumentTag(doc, SdtType.RICH_TEXT, MarkupLevel.INLINE);
sdtRichText.setStyleName("Quote");
builder.insertNode(sdtPlainText);
builder.insertNode(sdtRichText);
Assert.assertEquals(NodeType.STRUCTURED_DOCUMENT_TAG, sdtPlainText.getNodeType());
NodeCollection tags = doc.getChildNodes(NodeType.STRUCTURED_DOCUMENT_TAG, true);
for (StructuredDocumentTag sdt : (Iterable<StructuredDocumentTag>) tags) {
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