public boolean hasHangingPunctuation() { return findDefinedParagraphProperty(props -> props.isSetHangingPunct(), props -> props.getHangingPunct()) .orElse(false); }
public boolean hasEastAsianLineBreak() { return findDefinedParagraphProperty(props -> props.isSetEaLnBrk(), props -> props.getEaLnBrk()).orElse(false); }
public boolean hasLatinLineBreak() { return findDefinedParagraphProperty(props -> props.isSetLatinLnBrk(), props -> props.getLatinLnBrk()) .orElse(false); }
public boolean isRightToLeft() { return findDefinedParagraphProperty(props -> props.isSetRtl(), props -> props.getRtl()).orElse(false); }
/** * * @return the indentation, in points, applied to the first line of text in * the paragraph. */ public Double getIndentation() { return findDefinedParagraphProperty(props -> props.isSetIndent(), props -> props.getIndent()) .map(emu -> Units.toPoints(emu)).orElse(null); }
/** * * @return the right margin, in points, of the paragraph. */ public Double getMarginRight() { return findDefinedParagraphProperty(props -> props.isSetMarR(), props -> props.getMarR()) .map(emu -> Units.toPoints(emu)).orElse(null); }
/** * * @return the left margin, in points, of the paragraph. */ public Double getMarginLeft() { return findDefinedParagraphProperty(props -> props.isSetMarL(), props -> props.getMarL()) .map(emu -> Units.toPoints(emu)).orElse(null); }
/** * Returns the alignment that is applied to the paragraph. * * If this attribute is omitted, then a value of left is implied. * * @return alignment that is applied to the paragraph */ public TextAlignment getTextAlignment() { return findDefinedParagraphProperty(props -> props.isSetAlgn(), props -> props.getAlgn()) .map(align -> TextAlignment.valueOf(align)).orElse(null); }
/** * * @return the default size for a tab character within this paragraph in * points. */ public Double getDefaultTabSize() { return findDefinedParagraphProperty(props -> props.isSetDefTabSz(), props -> props.getDefTabSz()) .map(emu -> Units.toPoints(emu)).orElse(null); }
/** * Returns where vertically on a line of text the actual words are * positioned. This deals with vertical placement of the characters with * respect to the baselines. * * If this attribute is omitted, then a value of baseline is implied. * * @return alignment that is applied to the paragraph */ public FontAlignment getFontAlignment() { return findDefinedParagraphProperty(props -> props.isSetFontAlgn(), props -> props.getFontAlgn()) .map(align -> FontAlignment.valueOf(align)).orElse(null); }
/** * The amount of vertical white space before the paragraph. This may be * specified in two different ways, percentage spacing or font points * spacing: * <p> * If spacing is a percentage of normal line height, result is instance of * XDDFSpacingPercent. If spacing is expressed in points, result is instance * of XDDFSpacingPoints. * </p> * * @return the vertical white space before the paragraph. */ public XDDFSpacing getSpaceBefore() { return findDefinedParagraphProperty(props -> props.isSetSpcBef(), props -> props.getSpcBef()) .map(spacing -> extractSpacing(spacing)).orElse(null); }
/** * Returns the vertical line spacing that is to be used within a paragraph. * This may be specified in two different ways, percentage spacing or font * points spacing: * <p> * If line spacing is a percentage of normal line height, result is instance * of XDDFSpacingPercent. If line spacing is expressed in points, result is * instance of XDDFSpacingPoints. * </p> * * @return the vertical line spacing. */ public XDDFSpacing getLineSpacing() { return findDefinedParagraphProperty(props -> props.isSetLnSpc(), props -> props.getLnSpc()) .map(spacing -> extractSpacing(spacing)).orElse(null); }
/** * The amount of vertical white space after the paragraph. This may be * specified in two different ways, percentage spacing or font points * spacing: * <p> * If spacing is a percentage of normal line height, result is instance of * XDDFSpacingPercent. If spacing is expressed in points, result is instance * of XDDFSpacingPoints. * </p> * * @return the vertical white space after the paragraph. */ public XDDFSpacing getSpaceAfter() { return findDefinedParagraphProperty(props -> props.isSetSpcAft(), props -> props.getSpcAft()) .map(spacing -> extractSpacing(spacing)).orElse(null); }
/** * * @return the color of bullet characters within a given paragraph. A * <code>null</code> value means to use the text font color. */ public XDDFColor getBulletColor() { return findDefinedParagraphProperty(props -> props.isSetBuClr() || props.isSetBuClrTx(), props -> new XDDFParagraphBulletProperties(props).getBulletColor()).orElse(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 XDDFBulletStyle getBulletStyle() { return findDefinedParagraphProperty( props -> props.isSetBuAutoNum() || props.isSetBuBlip() || props.isSetBuChar() || props.isSetBuNone(), props -> new XDDFParagraphBulletProperties(props).getBulletStyle()).orElse(null); }
/** * Returns the bullet size that is to be used within a paragraph. This may * be specified in three different ways, follows text size, percentage size * and font points size: * <p> * If returned value is instance of XDDFBulletSizeFollowText, then bullet * size is text size; If returned value is instance of * XDDFBulletSizePercent, then bullet size is a percentage of the font size; * If returned value is instance of XDDFBulletSizePoints, then bullet size * is specified in points. * </p> * * @return the bullet size */ public XDDFBulletSize getBulletSize() { return findDefinedParagraphProperty( props -> props.isSetBuSzPct() || props.isSetBuSzPts() || props.isSetBuSzTx(), props -> new XDDFParagraphBulletProperties(props).getBulletSize()).orElse(null); }
protected <R> Optional<R> findDefinedParagraphProperty(Function<CTTextParagraphProperties, Boolean> isSet, Function<CTTextParagraphProperties, R> getter) { if (_p.isSetPPr()) { int level = _p.getPPr().isSetLvl() ? 1 + _p.getPPr().getLvl() : 0; return findDefinedParagraphProperty(isSet, getter, level); } else { return _parent.findDefinedParagraphProperty(isSet, getter, 0); } }
/** * * @return the indentation, in points, applied to the first line of text in * the paragraph. */ public Double getIndentation() { return findDefinedParagraphProperty(props -> props.isSetIndent(), props -> props.getIndent()) .map(emu -> Units.toPoints(emu)).orElse(null); }
protected <R> Optional<R> findDefinedParagraphProperty(Function<CTTextParagraphProperties, Boolean> isSet, Function<CTTextParagraphProperties, R> getter) { if (_p.isSetPPr()) { int level = _p.getPPr().isSetLvl() ? 1 + _p.getPPr().getLvl() : 0; return findDefinedParagraphProperty(isSet, getter, level); } else { return _parent.findDefinedParagraphProperty(isSet, getter, 0); } }