/** * Specifies that automatic numbered bullet points should be applied to this paragraph * * @param scheme type of auto-numbering * @param startAt the number that will start number for a given sequence of automatically numbered bullets (1-based). */ @SuppressWarnings("WeakerAccess") public void setBulletAutoNumber(AutoNumberingScheme scheme, int startAt) { if(startAt < 1) throw new IllegalArgumentException("Start Number must be greater or equal that 1") ; CTTextParagraphProperties pr = _p.isSetPPr() ? _p.getPPr() : _p.addNewPPr(); CTTextAutonumberBullet lst = pr.isSetBuAutoNum() ? pr.getBuAutoNum() : pr.addNewBuAutoNum(); lst.setType(STTextAutonumberScheme.Enum.forInt(scheme.ooxmlId)); lst.setStartAt(startAt); }
/** * Set this paragraph as an automatic numbered bullet point * * @param scheme type of auto-numbering * @param startAt the number that will start number for a given sequence of automatically * numbered bullets (1-based). */ public void setBullet(ListAutoNumber scheme, int startAt) { if(startAt < 1) throw new IllegalArgumentException("Start Number must be greater or equal that 1") ; CTTextParagraphProperties pr = _p.isSetPPr() ? _p.getPPr() : _p.addNewPPr(); CTTextAutonumberBullet lst = pr.isSetBuAutoNum() ? pr.getBuAutoNum() : pr.addNewBuAutoNum(); lst.setType(STTextAutonumberScheme.Enum.forInt(scheme.ordinal() + 1)); lst.setStartAt(startAt); if(!pr.isSetBuFont()) pr.addNewBuFont().setTypeface("Arial"); if(pr.isSetBuNone()) pr.unsetBuNone(); // remove these elements if present as it results in invalid content when opening in Excel. if(pr.isSetBuBlip()) pr.unsetBuBlip(); if(pr.isSetBuChar()) pr.unsetBuChar(); }
/** * Set this paragraph as an automatic numbered bullet point * * @param scheme type of auto-numbering */ public void setBullet(ListAutoNumber scheme) { CTTextParagraphProperties pr = _p.isSetPPr() ? _p.getPPr() : _p.addNewPPr(); CTTextAutonumberBullet lst = pr.isSetBuAutoNum() ? pr.getBuAutoNum() : pr.addNewBuAutoNum(); lst.setType(STTextAutonumberScheme.Enum.forInt(scheme.ordinal() + 1)); if(!pr.isSetBuFont()) pr.addNewBuFont().setTypeface("Arial"); if(pr.isSetBuNone()) pr.unsetBuNone(); // remove these elements if present as it results in invalid content when opening in Excel. if(pr.isSetBuBlip()) pr.unsetBuBlip(); if(pr.isSetBuChar()) pr.unsetBuChar(); }
/** * Specifies that automatic numbered bullet points should be applied to this paragraph * * @param scheme type of auto-numbering * @param startAt the number that will start number for a given sequence of automatically numbered bullets (1-based). */ @SuppressWarnings("WeakerAccess") public void setBulletAutoNumber(AutoNumberingScheme scheme, int startAt) { if(startAt < 1) throw new IllegalArgumentException("Start Number must be greater or equal that 1") ; CTTextParagraphProperties pr = _p.isSetPPr() ? _p.getPPr() : _p.addNewPPr(); CTTextAutonumberBullet lst = pr.isSetBuAutoNum() ? pr.getBuAutoNum() : pr.addNewBuAutoNum(); lst.setType(STTextAutonumberScheme.Enum.forInt(scheme.ooxmlId)); lst.setStartAt(startAt); }
/** * Specifies that automatic numbered bullet points should be applied to this paragraph * * @param scheme type of auto-numbering * @param startAt the number that will start number for a given sequence of automatically numbered bullets (1-based). */ public void setBulletAutoNumber(ListAutoNumber scheme, int startAt) { if(startAt < 1) throw new IllegalArgumentException("Start Number must be greater or equal that 1") ; CTTextParagraphProperties pr = _p.isSetPPr() ? _p.getPPr() : _p.addNewPPr(); CTTextAutonumberBullet lst = pr.isSetBuAutoNum() ? pr.getBuAutoNum() : pr.addNewBuAutoNum(); lst.setType(STTextAutonumberScheme.Enum.forInt(scheme.ordinal() + 1)); lst.setStartAt(startAt); }
/** * Set this paragraph as an automatic numbered bullet point * * @param scheme type of auto-numbering * @param startAt the number that will start number for a given sequence of automatically * numbered bullets (1-based). */ public void setBullet(ListAutoNumber scheme, int startAt) { if(startAt < 1) throw new IllegalArgumentException("Start Number must be greater or equal that 1") ; CTTextParagraphProperties pr = _p.isSetPPr() ? _p.getPPr() : _p.addNewPPr(); CTTextAutonumberBullet lst = pr.isSetBuAutoNum() ? pr.getBuAutoNum() : pr.addNewBuAutoNum(); lst.setType(STTextAutonumberScheme.Enum.forInt(scheme.ordinal() + 1)); lst.setStartAt(startAt); if(!pr.isSetBuFont()) pr.addNewBuFont().setTypeface("Arial"); if(pr.isSetBuNone()) pr.unsetBuNone(); // remove these elements if present as it results in invalid content when opening in Excel. if(pr.isSetBuBlip()) pr.unsetBuBlip(); if(pr.isSetBuChar()) pr.unsetBuChar(); }
/** * Set this paragraph as an automatic numbered bullet point * * @param scheme type of auto-numbering */ public void setBullet(ListAutoNumber scheme) { CTTextParagraphProperties pr = _p.isSetPPr() ? _p.getPPr() : _p.addNewPPr(); CTTextAutonumberBullet lst = pr.isSetBuAutoNum() ? pr.getBuAutoNum() : pr.addNewBuAutoNum(); lst.setType(STTextAutonumberScheme.Enum.forInt(scheme.ordinal() + 1)); if(!pr.isSetBuFont()) pr.addNewBuFont().setTypeface("Arial"); if(pr.isSetBuNone()) pr.unsetBuNone(); // remove these elements if present as it results in invalid content when opening in Excel. if(pr.isSetBuBlip()) pr.unsetBuBlip(); if(pr.isSetBuChar()) pr.unsetBuChar(); }