public void setBulletFontFollowText() { if (props.isSetBuFont()) { props.unsetBuFont(); } if (props.isSetBuFontTx()) { // nothing to do: already set } else { props.addNewBuFontTx(); } }
public XDDFFont getBulletFont() { if (props.isSetBuFont()) { return new XDDFFont(FontGroup.SYMBOL, props.getBuFont()); } else { return null; } }
/** * * @return the font of bullet characters within a given paragraph. A * <code>null</code> value means to use the text font font. */ public XDDFFont getBulletFont() { return findDefinedParagraphProperty(props -> props.isSetBuFont() || props.isSetBuFontTx(), props -> new XDDFParagraphBulletProperties(props).getBulletFont()).orElse(null); }
public boolean fetch(CTTextParagraphProperties props){ if(props.isSetBuFont()){ setValue(props.getBuFont().getTypeface()); return true; } return false; } };
public void setBulletFont(XDDFFont font) { if (props.isSetBuFontTx()) { props.unsetBuFontTx(); } if (font == null) { if (props.isSetBuFont()) { props.unsetBuFont(); } } else { props.setBuFont(font.getXmlObject()); } }
public boolean fetch(CTTextParagraphProperties props){ if(props.isSetBuFont()){ setValue(props.getBuFont().getTypeface()); return true; } return false; } };
/** * 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; } };
/** * * @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.addNewBuFont().setTypeface("Arial"); pr.addNewBuChar().setChar("\u2022"); } else { if (pr.isSetBuFont()) pr.unsetBuFont(); if (pr.isSetBuChar()) pr.unsetBuChar(); if (pr.isSetBuAutoNum()) pr.unsetBuAutoNum(); if (pr.isSetBuBlip()) pr.unsetBuBlip(); 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(); pr.addNewBuNone(); } }
public void setBulletFont(String typeface){ CTTextParagraphProperties pr = _p.isSetPPr() ? _p.getPPr() : _p.addNewPPr(); CTTextFont font = pr.isSetBuFont() ? pr.getBuFont() : pr.addNewBuFont(); font.setTypeface(typeface); }
props.unsetBuClrTx(); if (props.isSetBuFont()) { props.unsetBuFont();
@SuppressWarnings("WeakerAccess") public void setBulletFont(String typeface){ CTTextParagraphProperties pr = _p.isSetPPr() ? _p.getPPr() : _p.addNewPPr(); CTTextFont font = pr.isSetBuFont() ? pr.getBuFont() : pr.addNewBuFont(); font.setTypeface(typeface); }
public void setBulletFontFollowText() { if (props.isSetBuFont()) { props.unsetBuFont(); } if (props.isSetBuFontTx()) { // nothing to do: already set } else { props.addNewBuFontTx(); } }
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; } };
/** * 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 boolean fetch(CTTextParagraphProperties props){ if(props.isSetBuFont()){ setValue(props.getBuFont().getTypeface()); return true; } return false; } };
public boolean fetch(CTTextParagraphProperties props){ if(props.isSetBuFont()){ setValue(props.getBuFont().getTypeface()); 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; } };
@SuppressWarnings("WeakerAccess") public void setBulletFont(String typeface){ CTTextParagraphProperties pr = _p.isSetPPr() ? _p.getPPr() : _p.addNewPPr(); CTTextFont font = pr.isSetBuFont() ? pr.getBuFont() : pr.addNewBuFont(); font.setTypeface(typeface); }