Search in sources :

Example 1 with CTUnderline

use of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTUnderline in project poi by apache.

the class XWPFRun method setUnderline.

/**
     * Specifies that the contents of this run should be displayed along with an
     * underline appearing directly below the character heigh
     * <p/>
     * <p/>
     * If this element is not present, the default value is to leave the
     * formatting applied at previous level in the style hierarchy. If this
     * element is never applied in the style hierarchy, then an underline shall
     * not be applied to the contents of this run.
     * </p>
     *
     * @param value -
     *              underline type
     * @see UnderlinePatterns : all possible patterns that could be applied
     */
public void setUnderline(UnderlinePatterns value) {
    CTRPr pr = run.isSetRPr() ? run.getRPr() : run.addNewRPr();
    CTUnderline underline = (pr.getU() == null) ? pr.addNewU() : pr.getU();
    underline.setVal(STUnderline.Enum.forInt(value.getValue()));
}
Also used : CTRPr(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRPr) CTUnderline(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTUnderline)

Aggregations

CTRPr (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRPr)1 CTUnderline (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTUnderline)1