public class MarkupLevel
extends java.lang.Object
StructuredDocumentTag can occur.
Examples:
Shows how to work with styles for content control elements.
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());
}
| Modifier and Type | Field and Description |
|---|---|
static int |
BLOCK
The element occurs at the block level (e.g.
|
static int |
CELL
The element occurs among cells in a row.
|
static int |
INLINE
The element occurs at the inline level (e.g.
|
static int |
length |
static int |
ROW
The element occurs among rows in a table.
|
static int |
UNKNOWN
Specifies the unknown or invalid value.
|
| Modifier and Type | Method and Description |
|---|---|
static int |
fromName(java.lang.String markupLevelName) |
static java.lang.String |
getName(int markupLevel) |
static int[] |
getValues() |
static java.lang.String |
toString(int markupLevel) |
public static int UNKNOWN
public static int INLINE
public static int BLOCK
public static int ROW
public static int CELL
public static int length