本文整理汇总了Java中org.docx4j.wml.Br.setType方法的典型用法代码示例。如果您正苦于以下问题:Java Br.setType方法的具体用法?Java Br.setType怎么用?Java Br.setType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.docx4j.wml.Br
的用法示例。
在下文中一共展示了Br.setType方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createPageBreak
import org.docx4j.wml.Br; //导入方法依赖的package包/类
public static P createPageBreak() {
org.docx4j.wml.ObjectFactory wmlObjectFactory = new org.docx4j.wml.ObjectFactory();
// Create object for p
P p = wmlObjectFactory.createP();
// Create object for r
R r = wmlObjectFactory.createR();
p.getContent().add(r);
// Create object for br
Br br = wmlObjectFactory.createBr();
r.getContent().add(br);
br.setType(org.docx4j.wml.STBrType.PAGE);
return p;
}
示例2: newPage
import org.docx4j.wml.Br; //导入方法依赖的package包/类
@Override
protected void newPage() {
flushNow();
Br objBr = new Br();
objBr.setType(STBrType.PAGE);
P para = createParagraph();
para.getContent().add(objBr);
wordMLPackage.getMainDocumentPart().getContent().add(para);
if (bean.getReportLayout().isHeaderOnEveryPage()) {
try {
printHeaderBand();
newRow = true;
} catch (QueryException e) {
e.printStackTrace();
}
}
}
示例3: addPageBreak
import org.docx4j.wml.Br; //导入方法依赖的package包/类
public void addPageBreak(WordprocessingMLPackage wordMLPackage,
ObjectFactory factory, STBrType sTBrType) {
MainDocumentPart documentPart = wordMLPackage.getMainDocumentPart();
Br breakObj = new Br();
breakObj.setType(sTBrType);
P paragraph = factory.createP();
paragraph.getContent().add(breakObj);
documentPart.addObject(paragraph);
}
示例4: addPageBreak
import org.docx4j.wml.Br; //导入方法依赖的package包/类
public void addPageBreak(WordprocessingMLPackage wordMLPackage,
ObjectFactory factory) {
MainDocumentPart documentPart = wordMLPackage.getMainDocumentPart();
Br breakObj = new Br();
breakObj.setType(STBrType.PAGE);
P paragraph = factory.createP();
paragraph.getContent().add(breakObj);
documentPart.addObject(paragraph);
}
示例5: addPageBreak
import org.docx4j.wml.Br; //导入方法依赖的package包/类
/**
* 向文档添加一个换行符
*/
private static void addPageBreak() {
MainDocumentPart documentPart = wordMLPackage.getMainDocumentPart();
Br breakObj = new Br();
breakObj.setType(STBrType.PAGE);
P paragraph = factory.createP();
paragraph.getContent().add(breakObj);
documentPart.getJaxbElement().getBody().getContent().add(paragraph);
}
示例6: addPageBreak
import org.docx4j.wml.Br; //导入方法依赖的package包/类
/**
* Adds a page break to the document.
*
* @param documentPart
*/
private static void addPageBreak(MainDocumentPart documentPart) {
Br breakObj = new Br();
breakObj.setType(STBrType.PAGE);
P paragraph = factory.createP();
paragraph.getContent().add(breakObj);
documentPart.getJaxbElement().getBody().getContent().add(paragraph);
}
示例7: addPageBreak
import org.docx4j.wml.Br; //导入方法依赖的package包/类
public void addPageBreak(WordprocessingMLPackage wordMLPackage,
ObjectFactory factory) {
MainDocumentPart documentPart = wordMLPackage.getMainDocumentPart();
Br breakObj = new Br();
breakObj.setType(STBrType.PAGE);
P paragraph = factory.createP();
paragraph.getContent().add(breakObj);
documentPart.addObject(paragraph);
}
示例8: addPageBreak
import org.docx4j.wml.Br; //导入方法依赖的package包/类
/**
* @Description: 段落添加Br 页面Break(分页符)
*/
public void addPageBreak(P para, STBrType sTBrType) {
Br breakObj = new Br();
breakObj.setType(sTBrType);
para.getContent().add(breakObj);
}