public boolean fetch(CTTextParagraphProperties props){ if(props.isSetBuNone()) { setValue(false); return true; } if(props.isSetBuFont() || props.isSetBuChar()){ setValue(true); return true; } return false; } };
public XDDFBulletStyle getBulletStyle() { return findDefinedParagraphProperty( props -> props.isSetBuAutoNum() || props.isSetBuBlip() || props.isSetBuChar() || props.isSetBuNone(), props -> new XDDFParagraphBulletProperties(props).getBulletStyle()).orElse(null); }
public boolean fetch(CTTextParagraphProperties props){ if (props.isSetBuNone()) { setValue(false); return true; } if (props.isSetBuFont()) { if (props.isSetBuChar() || props.isSetBuAutoNum()) { setValue(true); return true; } /*else { // Excel treats text with buFont but no char/autonum // as not bulleted // Possibly the font is just used if bullets turned on again? }*/ } return false; } };
public XDDFBulletStyle getBulletStyle() { if (props.isSetBuAutoNum()) { return new XDDFBulletStyleAutoNumbered(props.getBuAutoNum()); } else if (props.isSetBuBlip()) { return new XDDFBulletStylePicture(props.getBuBlip()); } else if (props.isSetBuChar()) { return new XDDFBulletStyleCharacter(props.getBuChar()); } else if (props.isSetBuNone()) { return new XDDFBulletStyleNone(props.getBuNone()); } else { return null; } }
/** * 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(); }
public void setBulletStyle(XDDFBulletStyle style) { if (props.isSetBuAutoNum()) { props.unsetBuAutoNum(); } if (props.isSetBuBlip()) { props.unsetBuBlip(); } if (props.isSetBuChar()) { props.unsetBuChar(); } if (props.isSetBuNone()) { props.unsetBuNone(); } if (style != null) { if (style instanceof XDDFBulletStyleAutoNumbered) { props.setBuAutoNum(((XDDFBulletStyleAutoNumbered) style).getXmlObject()); } else if (style instanceof XDDFBulletStyleCharacter) { props.setBuChar(((XDDFBulletStyleCharacter) style).getXmlObject()); } else if (style instanceof XDDFBulletStyleNone) { props.setBuNone(((XDDFBulletStyleNone) style).getXmlObject()); } else if (style instanceof XDDFBulletStylePicture) { props.setBuBlip(((XDDFBulletStylePicture) style).getXmlObject()); } } }
props.unsetBuChar(); if (props.isSetBuNone()) { props.unsetBuNone();
/** * Set or unset this paragraph as a bullet point * * @param flag whether text in this paragraph has bullets */ public void setBullet(boolean flag) { if(isBullet() == flag) return; CTTextParagraphProperties pr = _p.isSetPPr() ? _p.getPPr() : _p.addNewPPr(); if(!flag) { pr.addNewBuNone(); if(pr.isSetBuAutoNum()) pr.unsetBuAutoNum(); if(pr.isSetBuBlip()) pr.unsetBuBlip(); if(pr.isSetBuChar()) pr.unsetBuChar(); if(pr.isSetBuClr()) pr.unsetBuClr(); if(pr.isSetBuClrTx()) pr.unsetBuClrTx(); if(pr.isSetBuFont()) pr.unsetBuFont(); if(pr.isSetBuFontTx()) pr.unsetBuFontTx(); if(pr.isSetBuSzPct()) pr.unsetBuSzPct(); if(pr.isSetBuSzPts()) pr.unsetBuSzPts(); if(pr.isSetBuSzTx()) pr.unsetBuSzTx(); } else { if(pr.isSetBuNone()) pr.unsetBuNone(); if(!pr.isSetBuFont()) pr.addNewBuFont().setTypeface("Arial"); if(!pr.isSetBuAutoNum()) pr.addNewBuChar().setChar("\u2022"); } }
public boolean fetch(CTTextParagraphProperties props){ if(props.isSetBuNone()) { setValue(false); return true; } if(props.isSetBuFont() || props.isSetBuChar()){ setValue(true); return true; } return false; } };
public boolean fetch(CTTextParagraphProperties props){ if(props.isSetBuNone()) { setValue(false); return true; } if(props.isSetBuFont() || props.isSetBuChar()){ setValue(true); return true; } return false; } };
public XDDFBulletStyle getBulletStyle() { return findDefinedParagraphProperty( props -> props.isSetBuAutoNum() || props.isSetBuBlip() || props.isSetBuChar() || props.isSetBuNone(), props -> new XDDFParagraphBulletProperties(props).getBulletStyle()).orElse(null); }
public boolean fetch(CTTextParagraphProperties props){ if (props.isSetBuNone()) { setValue(false); return true; } if (props.isSetBuFont()) { if (props.isSetBuChar() || props.isSetBuAutoNum()) { setValue(true); return true; } /*else { // Excel treats text with buFont but no char/autonum // as not bulleted // Possibly the font is just used if bullets turned on again? }*/ } return false; } };
public XDDFBulletStyle getBulletStyle() { if (props.isSetBuAutoNum()) { return new XDDFBulletStyleAutoNumbered(props.getBuAutoNum()); } else if (props.isSetBuBlip()) { return new XDDFBulletStylePicture(props.getBuBlip()); } else if (props.isSetBuChar()) { return new XDDFBulletStyleCharacter(props.getBuChar()); } else if (props.isSetBuNone()) { return new XDDFBulletStyleNone(props.getBuNone()); } else { return null; } }
/** * 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(); }
public void setBulletStyle(XDDFBulletStyle style) { if (props.isSetBuAutoNum()) { props.unsetBuAutoNum(); } if (props.isSetBuBlip()) { props.unsetBuBlip(); } if (props.isSetBuChar()) { props.unsetBuChar(); } if (props.isSetBuNone()) { props.unsetBuNone(); } if (style != null) { if (style instanceof XDDFBulletStyleAutoNumbered) { props.setBuAutoNum(((XDDFBulletStyleAutoNumbered) style).getXmlObject()); } else if (style instanceof XDDFBulletStyleCharacter) { props.setBuChar(((XDDFBulletStyleCharacter) style).getXmlObject()); } else if (style instanceof XDDFBulletStyleNone) { props.setBuNone(((XDDFBulletStyleNone) style).getXmlObject()); } else if (style instanceof XDDFBulletStylePicture) { props.setBuBlip(((XDDFBulletStylePicture) style).getXmlObject()); } } }
props.unsetBuChar(); if (props.isSetBuNone()) { props.unsetBuNone();
/** * Set or unset this paragraph as a bullet point * * @param flag whether text in this paragraph has bullets */ public void setBullet(boolean flag) { if(isBullet() == flag) return; CTTextParagraphProperties pr = _p.isSetPPr() ? _p.getPPr() : _p.addNewPPr(); if(!flag) { pr.addNewBuNone(); if(pr.isSetBuAutoNum()) pr.unsetBuAutoNum(); if(pr.isSetBuBlip()) pr.unsetBuBlip(); if(pr.isSetBuChar()) pr.unsetBuChar(); if(pr.isSetBuClr()) pr.unsetBuClr(); if(pr.isSetBuClrTx()) pr.unsetBuClrTx(); if(pr.isSetBuFont()) pr.unsetBuFont(); if(pr.isSetBuFontTx()) pr.unsetBuFontTx(); if(pr.isSetBuSzPct()) pr.unsetBuSzPct(); if(pr.isSetBuSzPts()) pr.unsetBuSzPts(); if(pr.isSetBuSzTx()) pr.unsetBuSzTx(); } else { if(pr.isSetBuNone()) pr.unsetBuNone(); if(!pr.isSetBuFont()) pr.addNewBuFont().setTypeface("Arial"); if(!pr.isSetBuAutoNum()) pr.addNewBuChar().setChar("\u2022"); } }