Example usage for org.apache.poi.xwpf.usermodel ParagraphAlignment getValue

List of usage examples for org.apache.poi.xwpf.usermodel ParagraphAlignment getValue

Introduction

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

Prototype

public int getValue() 

Source Link

Usage

From source file:apachepoitest.XWPFParagraphClone.java

License:Apache License

/**
 * Specifies the paragraph alignment which shall be applied to text in this
 * paragraph./*from   ww  w  . ja  v a 2 s  .  com*/
 * <p/>
 * <p/>
 * If this element is not set 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 no alignment is applied to the
 * paragraph.
 * </p>
 *
 * @param align the paragraph alignment to apply to this paragraph.
 */
public void setAlignment(ParagraphAlignment align) {
    CTPPr pr = getCTPPr();
    CTJc jc = pr.isSetJc() ? pr.getJc() : pr.addNewJc();
    STJc.Enum en = STJc.Enum.forInt(align.getValue());
    jc.setVal(en);
}