/** * Returns the text vertical alignment which shall be applied to text in * this paragraph. * <p> * If the line height (before any added spacing) is larger than one or more * characters on the line, all characters will be aligned to each other as * specified by this element. * </p> * <p> * If this element is omitted on a given paragraph, its value is determined * by the setting previously set at any level of the style hierarchy (i.e. * that previous setting remains unchanged). If this setting is never * specified in the style hierarchy, then the vertical alignment of all * characters on the line shall be automatically determined by the consumer. * </p> * * @return the vertical alignment of this paragraph. */ public TextAlignment getVerticalAlignment() { CTPPr pr = getCTPPr(); return (pr == null || !pr.isSetTextAlignment()) ? TextAlignment.AUTO : TextAlignment.valueOf(pr.getTextAlignment().getVal() .intValue()); }
/** * Specifies the text vertical alignment which shall be applied to text in * this paragraph. * <p> * If the line height (before any added spacing) is larger than one or more * characters on the line, all characters will be aligned to each other as * specified by this element. * </p> * <p> * If this element is omitted on a given paragraph, its value is determined * by the setting previously set at any level of the style hierarchy (i.e. * that previous setting remains unchanged). If this setting is never * specified in the style hierarchy, then the vertical alignment of all * characters on the line shall be automatically determined by the consumer. * </p> * * @param valign the paragraph vertical alignment to apply to this * paragraph. */ public void setVerticalAlignment(TextAlignment valign) { CTPPr pr = getCTPPr(); CTTextAlignment textAlignment = pr.isSetTextAlignment() ? pr .getTextAlignment() : pr.addNewTextAlignment(); STTextAlignment.Enum en = STTextAlignment.Enum .forInt(valign.getValue()); textAlignment.setVal(en); }
/** * Returns the text vertical alignment which shall be applied to text in * this paragraph. * <p/> * If the line height (before any added spacing) is larger than one or more * characters on the line, all characters will be aligned to each other as * specified by this element. * </p> * <p/> * If this element is omitted on a given paragraph, its value is determined * by the setting previously set at any level of the style hierarchy (i.e. * that previous setting remains unchanged). If this setting is never * specified in the style hierarchy, then the vertical alignment of all * characters on the line shall be automatically determined by the consumer. * </p> * * @return the vertical alignment of this paragraph. */ public TextAlignment getVerticalAlignment() { CTPPr pr = getCTPPr(); return (pr == null || !pr.isSetTextAlignment()) ? TextAlignment.AUTO : TextAlignment.valueOf(pr.getTextAlignment().getVal() .intValue()); }
/** * Returns the text vertical alignment which shall be applied to text in * this paragraph. * <p> * If the line height (before any added spacing) is larger than one or more * characters on the line, all characters will be aligned to each other as * specified by this element. * </p> * <p> * If this element is omitted on a given paragraph, its value is determined * by the setting previously set at any level of the style hierarchy (i.e. * that previous setting remains unchanged). If this setting is never * specified in the style hierarchy, then the vertical alignment of all * characters on the line shall be automatically determined by the consumer. * </p> * * @return the vertical alignment of this paragraph. */ public TextAlignment getVerticalAlignment() { CTPPr pr = getCTPPr(); return (pr == null || !pr.isSetTextAlignment()) ? TextAlignment.AUTO : TextAlignment.valueOf(pr.getTextAlignment().getVal() .intValue()); }
CTTextAlignment alignment = xwpfParagraphProperties.getTextAlignment();
/** * Specifies the text vertical alignment which shall be applied to text in * this paragraph. * <p> * If the line height (before any added spacing) is larger than one or more * characters on the line, all characters will be aligned to each other as * specified by this element. * </p> * <p> * If this element is omitted on a given paragraph, its value is determined * by the setting previously set at any level of the style hierarchy (i.e. * that previous setting remains unchanged). If this setting is never * specified in the style hierarchy, then the vertical alignment of all * characters on the line shall be automatically determined by the consumer. * </p> * * @param valign the paragraph vertical alignment to apply to this * paragraph. */ public void setVerticalAlignment(TextAlignment valign) { CTPPr pr = getCTPPr(); CTTextAlignment textAlignment = pr.isSetTextAlignment() ? pr .getTextAlignment() : pr.addNewTextAlignment(); STTextAlignment.Enum en = STTextAlignment.Enum .forInt(valign.getValue()); textAlignment.setVal(en); }
/** * Specifies the text vertical alignment which shall be applied to text in * this paragraph. * <p/> * If the line height (before any added spacing) is larger than one or more * characters on the line, all characters will be aligned to each other as * specified by this element. * </p> * <p/> * If this element is omitted on a given paragraph, its value is determined * by the setting previously set at any level of the style hierarchy (i.e. * that previous setting remains unchanged). If this setting is never * specified in the style hierarchy, then the vertical alignment of all * characters on the line shall be automatically determined by the consumer. * </p> * * @param valign the paragraph vertical alignment to apply to this * paragraph. */ public void setVerticalAlignment(TextAlignment valign) { CTPPr pr = getCTPPr(); CTTextAlignment textAlignment = pr.isSetTextAlignment() ? pr .getTextAlignment() : pr.addNewTextAlignment(); STTextAlignment.Enum en = STTextAlignment.Enum .forInt(valign.getValue()); textAlignment.setVal(en); }
CTTextAlignment alignment = xwpfParagraphProperties.getTextAlignment();
CTTextAlignment textAligment = ppr.getTextAlignment(); if ( textAligment != null )