Search in sources :

Example 21 with CTRPr

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

the class XWPFRun method setCapitalized.

public void setCapitalized(boolean value) {
    CTRPr pr = run.isSetRPr() ? run.getRPr() : run.addNewRPr();
    CTOnOff caps = pr.isSetCaps() ? pr.getCaps() : pr.addNewCaps();
    caps.setVal(value ? STOnOff.TRUE : STOnOff.FALSE);
}
Also used : CTRPr(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRPr) CTOnOff(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTOnOff)

Example 22 with CTRPr

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

the class XWPFRun method setColor.

/**
     * Set text color.
     *
     * @param rgbStr - the desired color, in the hex form "RRGGBB".
     */
public void setColor(String rgbStr) {
    CTRPr pr = run.isSetRPr() ? run.getRPr() : run.addNewRPr();
    CTColor color = pr.isSetColor() ? pr.getColor() : pr.addNewColor();
    color.setVal(rgbStr);
}
Also used : CTRPr(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRPr) CTColor(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTColor)

Example 23 with CTRPr

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

the class XWPFRun method setShadow.

public void setShadow(boolean value) {
    CTRPr pr = run.isSetRPr() ? run.getRPr() : run.addNewRPr();
    CTOnOff shadow = pr.isSetShadow() ? pr.getShadow() : pr.addNewShadow();
    shadow.setVal(value ? STOnOff.TRUE : STOnOff.FALSE);
}
Also used : CTRPr(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRPr) CTOnOff(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTOnOff)

Example 24 with CTRPr

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

the class TestXWPFRun method testSetGetUnderline.

@Test
public void testSetGetUnderline() {
    CTRPr rpr = ctRun.addNewRPr();
    rpr.addNewU().setVal(STUnderline.DASH);
    XWPFRun run = new XWPFRun(ctRun, irb);
    assertEquals(UnderlinePatterns.DASH.getValue(), run.getUnderline().getValue());
    run.setUnderline(UnderlinePatterns.NONE);
    assertEquals(STUnderline.NONE.intValue(), rpr.getU().getVal().intValue());
}
Also used : CTRPr(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRPr) Test(org.junit.Test)

Example 25 with CTRPr

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

the class TestXWPFRun method testSetGetVAlign.

@Test
public void testSetGetVAlign() {
    CTRPr rpr = ctRun.addNewRPr();
    rpr.addNewVertAlign().setVal(STVerticalAlignRun.SUBSCRIPT);
    XWPFRun run = new XWPFRun(ctRun, irb);
    assertEquals(VerticalAlign.SUBSCRIPT, run.getSubscript());
    run.setSubscript(VerticalAlign.BASELINE);
    assertEquals(STVerticalAlignRun.BASELINE, rpr.getVertAlign().getVal());
}
Also used : CTRPr(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRPr) Test(org.junit.Test)

Aggregations

CTRPr (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRPr)31 CTOnOff (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTOnOff)10 Test (org.junit.Test)9 BigInteger (java.math.BigInteger)4 CTFonts (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFonts)3 CTColor (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTColor)2 CTHpsMeasure (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTHpsMeasure)2 CTR (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTR)2 CTLock (com.microsoft.schemas.office.office.CTLock)1 CTFormulas (com.microsoft.schemas.vml.CTFormulas)1 CTGroup (com.microsoft.schemas.vml.CTGroup)1 CTH (com.microsoft.schemas.vml.CTH)1 CTHandles (com.microsoft.schemas.vml.CTHandles)1 CTPath (com.microsoft.schemas.vml.CTPath)1 CTShape (com.microsoft.schemas.vml.CTShape)1 CTShapetype (com.microsoft.schemas.vml.CTShapetype)1 CTTextPath (com.microsoft.schemas.vml.CTTextPath)1 XWPFParagraph (org.apache.poi.xwpf.usermodel.XWPFParagraph)1 XmlString (org.apache.xmlbeans.XmlString)1 CTP (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP)1