Example usage for org.apache.poi.xwpf.usermodel TextAlignment valueOf

List of usage examples for org.apache.poi.xwpf.usermodel TextAlignment valueOf

Introduction

In this page you can find the example usage for org.apache.poi.xwpf.usermodel TextAlignment valueOf.

Prototype

public static TextAlignment valueOf(int type) 

Source Link

Usage

From source file:apachepoitest.XWPFParagraphClone.java

License:Apache License

/**
 * Returns the text vertical alignment which shall be applied to text in
 * this paragraph.//from w ww .  ja  v a 2s  .  c o  m
 * <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());
}