本文整理了Java中org.apache.poi.xwpf.usermodel.XWPFNumbering.addNum()
方法的一些代码示例,展示了XWPFNumbering.addNum()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XWPFNumbering.addNum()
方法的具体详情如下:
包路径:org.apache.poi.xwpf.usermodel.XWPFNumbering
类名称:XWPFNumbering
方法名:addNum
[英]Add a new num with an abstractNumID
[中]使用abstractNumID添加一个新num
代码示例来源:origin: Sayi/poi-tl
public BigInteger addNewNumbericId(Pair<Enum, String> numFmt) {
XWPFNumbering numbering = this.getNumbering();
if (null == numbering) {
numbering = this.createNumbering();
}
NumberingWrapper numberingWrapper = new NumberingWrapper(numbering);
CTAbstractNum cTAbstractNum = CTAbstractNum.Factory.newInstance();
// if we have an existing document, we must determine the next
// free number first.
cTAbstractNum
.setAbstractNumId(BigInteger.valueOf(numberingWrapper.getAbstractNumsSize() + 10));
Enum fmt = numFmt.getLeft();
String val = numFmt.getRight();
CTLvl cTLvl = cTAbstractNum.addNewLvl();
cTLvl.addNewNumFmt().setVal(fmt);
cTLvl.addNewLvlText().setVal(val);
cTLvl.addNewStart().setVal(BigInteger.valueOf(1));
cTLvl.setIlvl(BigInteger.valueOf(0));
if (fmt == STNumberFormat.BULLET) {
cTLvl.addNewLvlJc().setVal(STJc.LEFT);
} else {
// cTLvl.setIlvl(BigInteger.valueOf(0));
}
XWPFAbstractNum abstractNum = new XWPFAbstractNum(cTAbstractNum);
BigInteger abstractNumID = numbering.addAbstractNum(abstractNum);
return numbering.addNum(abstractNumID);
}
代码示例来源:origin: Sayi/poi-tl
BigInteger numID = numbering.addNum(numbering.addAbstractNum(new XWPFAbstractNum(cTAbstractNum)));
代码示例来源:origin: stackoverflow.com
run.setText("Items " + nx.toString());
BigInteger numId = numbering.addNum(numAbstract.getAbstractNum().getAbstractNumId());
XWPFNum num = numbering.getNum(numId);
CTNumLvl lvloverride = num.getCTNum().addNewLvlOverride();
内容来源于网络,如有侵权,请联系作者删除!