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

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

Introduction

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

Prototype

public static ParagraphAlignment valueOf(int type) 

Source Link

Usage

From source file:apachepoitest.XWPFParagraphClone.java

License:Apache License

/**
 * Returns the paragraph alignment which shall be applied to text in this
 * paragraph.//from   www. j a  v a  2s.  co  m
 * <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>
 *
 * @return the paragraph alignment of this paragraph.
 */
public ParagraphAlignment getAlignment() {
    CTPPr pr = getCTPPr();
    return pr == null || !pr.isSetJc() ? ParagraphAlignment.LEFT
            : ParagraphAlignment.valueOf(pr.getJc().getVal().intValue());
}

From source file:fr.opensagres.poi.xwpf.converter.core.openxmlformats.styles.paragraph.ParagraphAlignmentValueProvider.java

License:Open Source License

@Override
public ParagraphAlignment getValue(CTPPr pPr, XWPFStylesDocument document) {
    return pPr == null || !pPr.isSetJc() ? null : ParagraphAlignment.valueOf(pPr.getJc().getVal().intValue());
}

From source file:fr.opensagres.poi.xwpf.converter.core.openxmlformats.styles.table.TableAlignmentValueProvider.java

License:Open Source License

private ParagraphAlignment getTableAlignment(CTTblPrBase tblPr) {
    return tblPr == null || !tblPr.isSetJc() ? null
            : ParagraphAlignment.valueOf(tblPr.getJc().getVal().intValue());
}

From source file:fr.opensagres.poi.xwpf.converter.core.styles.paragraph.ParagraphAlignmentValueProvider.java

License:Open Source License

@Override
public ParagraphAlignment getValue(CTPPr ppr) {
    return ppr == null || !ppr.isSetJc() ? null : ParagraphAlignment.valueOf(ppr.getJc().getVal().intValue());
}