public class DocumentContext
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
AUTO_VALUE_DATA_ROW_INDEX |
Modifier and Type | Method and Description |
---|---|
void |
addNamespace(java.lang.String prefix,
java.lang.String namespace)
Adds a namespace to the document.
|
protected boolean |
doWrap(java.lang.Class nodeClass,
Node wrapper) |
protected void |
doWrap(Node documentNode,
Node wrapper) |
java.io.File |
findFile(java.lang.String path)
Finds a file that is either relative to the RTF file that is currently
imported or that is absolute.
|
ListItem |
getCurrentListItem()
Gets the current list item or null if context is not in list.
|
TableRow |
getCurrentTableRow()
Returns the current table-row or null if context is not in a table.
|
Document |
getDocument()
Returns the document (XSL-FO object tree) that is imported.
|
AreaEstimator |
getEstimator() |
java.lang.String |
getMappedFont(java.lang.String fontname)
Maps a font name using the font-mapper as defined JFO-Configuration or
Import-Parameters.
|
RTF2FOConfig |
getRTF2FOConfig() |
void |
insert(java.lang.Object obj)
Inserts an object at the current position.
|
void |
insert(java.lang.Object obj,
boolean mergeFormat)
This method is equivalent to
insert(Object obj) but with
a parameter that overrides mergeFormat property. |
void |
insert(java.lang.Object obj,
java.util.Map paragraphProperties)
This method is equivalent to
insert(Object obj) but with
a parameter for additional paragraph properties. |
void |
insert(java.lang.Object obj,
java.util.Map paragraphProperties,
boolean mergeFormat)
This method is equivalent to
insert(Object obj) but with
a parameter for additional paragraph properties. |
void |
insertAutoValue(int autoValue)
Inserts an automatically generated value.
|
void |
insertDocument(Document doc)
Appends a full document at the current position.
|
void |
insertDocument(Document doc,
boolean restartNumbering)
Appends a full document at the current position.
|
void |
insertDocumentContent(Document doc)
Inserts only the content of a document, no new page sequence is started.
|
void |
insertListItems(java.lang.Object[] items)
Inserts values for a list.
|
void |
insertTableColumn(java.lang.Object[] cells)
Inserts values for a table column.
|
boolean |
isInTable()
Tests if current position is in a table.
|
boolean |
isMergeFormat()
Checks whether text formatting properties are applied.
|
void |
setMergeFormat(boolean mergeFormat)
Sets whether text formatting properties of RTF should be applied to
inserted objects.
|
java.lang.String |
transcodeString(java.lang.String fontname,
java.lang.String str) |
void |
wrapBlock(Node wrapper)
Wraps the current block (paragraph) into another node.
|
void |
wrapListItem(Node wrapper)
Wraps this list item into another node.
|
void |
wrapPageSequence(Node wrapper)
Wraps the current page sequence (section) into another node.
|
void |
wrapParentNode(Node wrapper,
java.lang.Class wrappedNodeType) |
void |
wrapTableRow(Node wrapper)
Wraps the current table row into another node.
|
public static final int AUTO_VALUE_DATA_ROW_INDEX
public Document getDocument()
public AreaEstimator getEstimator()
public void insert(java.lang.Object obj)
isInTable()==true
),
obj can be a TableCell-Array for filling the actual table vertically.
If this context is inside a list, obj can be a ListItem-Array
or ListItemBody-Array.
Examples:
insert("Hello world");
insert(new Inline("Hello world",Color.green));
insert(new TableCell[]{new TableCell("row1"),new TableCell("row2")});
insert(new ListItem[]{new ListItem("item 1"),new ListItem("item 2")});
insert(new DefaultNode("my-xml-node"));
obj
- Object.public void insert(java.lang.Object obj, java.util.Map paragraphProperties, boolean mergeFormat)
insert(Object obj)
but with
a parameter for additional paragraph properties.obj
- Object.paragraphProperties
- Properties that are applied to the actual paragraph.mergeFormat
- Merge format. This overrides property
set by setMergeFormat().insert(java.lang.Object)
public void insert(java.lang.Object obj, java.util.Map paragraphProperties)
insert(Object obj)
but with
a parameter for additional paragraph properties.obj
- Object.paragraphProperties
- Properties that are applied to the actual paragraph.insert(java.lang.Object)
public void insert(java.lang.Object obj, boolean mergeFormat)
insert(Object obj)
but with
a parameter that overrides mergeFormat property.obj
- Object.mergeFormat
- Merge format. This overrides property
set by setMergeFormat().insert(java.lang.Object)
public void insertDocument(Document doc)
doc
- Document.public void insertDocument(Document doc, boolean restartNumbering)
doc
- Document.restartNumbering
- true
to restart page numbering.public void insertDocumentContent(Document doc)
doc
- Document.public void insertTableColumn(java.lang.Object[] cells)
cells
- Cells of column.public void insertAutoValue(int autoValue)
autoValue
- StringAUTO_VALUE_DATA_ROW_INDEX
public void insertListItems(java.lang.Object[] items)
items
- Object[]public void setMergeFormat(boolean mergeFormat)
true/code>
mergeFormat
- Merge text format.public boolean isMergeFormat()
true
if properties are applied.public boolean isInTable()
true
if in table.public java.lang.String getMappedFont(java.lang.String fontname)
fontname
- Original font name.public java.lang.String transcodeString(java.lang.String fontname, java.lang.String str)
public void wrapTableRow(Node wrapper)
wrapper
- Nodepublic void wrapBlock(Node wrapper)
wrapper
- Nodepublic void wrapPageSequence(Node wrapper)
wrapper
- Nodepublic void wrapListItem(Node wrapper)
wrapper
- Nodepublic void wrapParentNode(Node wrapper, java.lang.Class wrappedNodeType)
public TableRow getCurrentTableRow()
public ListItem getCurrentListItem()
public void addNamespace(java.lang.String prefix, java.lang.String namespace)
prefix
- Prefix of namespace.namespace
- Namespace.public final java.io.File findFile(java.lang.String path)
path
- Stringpublic RTF2FOConfig getRTF2FOConfig()
protected boolean doWrap(java.lang.Class nodeClass, Node wrapper)
© 2003-2011 by Sascha Schmidt (vision-cloud.de). All Rights Reserved.