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);
}
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);
}
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);
}
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());
}
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());
}
Aggregations