Search in sources :

Example 11 with FldChar

use of org.docx4j.wml.FldChar in project docx4j-template by vindell.

the class AddingTableOfContent method addFieldEnd.

/**
 *  每个域都需要用复杂的域字符来确定界限. 本方法向给定段落添加在真正域之后的界定符.
 *
 *  跟前面一样, 从创建可运行块开始, 然后创建域字符标记域的结束, 最后将域字符转换成JAXB元素并
 *  将其添加到可运行块, 可运行块再添加到段落中.
 *
 *  @param paragraph
 */
private static void addFieldEnd(P paragraph) {
    R run = factory.createR();
    FldChar fldcharend = factory.createFldChar();
    fldcharend.setFldCharType(STFldCharType.END);
    run.getContent().add(getWrappedFldChar(fldcharend));
    paragraph.getContent().add(run);
}
Also used : R(org.docx4j.wml.R) FldChar(org.docx4j.wml.FldChar)

Aggregations

FldChar (org.docx4j.wml.FldChar)11 R (org.docx4j.wml.R)11 Text (org.docx4j.wml.Text)1