use of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRPr in project poi by apache.
the class XWPFRun method setEmbossed.
public void setEmbossed(boolean value) {
CTRPr pr = run.isSetRPr() ? run.getRPr() : run.addNewRPr();
CTOnOff emboss = pr.isSetEmboss() ? pr.getEmboss() : pr.addNewEmboss();
emboss.setVal(value ? STOnOff.TRUE : STOnOff.FALSE);
}
use of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRPr in project poi by apache.
the class TestXWPFRun method testSetGetStrike.
@Test
public void testSetGetStrike() {
CTRPr rpr = ctRun.addNewRPr();
rpr.addNewStrike().setVal(STOnOff.TRUE);
XWPFRun run = new XWPFRun(ctRun, irb);
assertEquals(true, run.isStrikeThrough());
run.setStrikeThrough(false);
assertEquals(STOnOff.FALSE, rpr.getStrike().getVal());
}
use of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRPr in project poi by apache.
the class TestXWPFRun method testSetGetFontFamily.
@Test
public void testSetGetFontFamily() {
CTRPr rpr = ctRun.addNewRPr();
rpr.addNewRFonts().setAscii("Times New Roman");
XWPFRun run = new XWPFRun(ctRun, irb);
assertEquals("Times New Roman", run.getFontFamily());
run.setFontFamily("Verdana");
assertEquals("Verdana", rpr.getRFonts().getAscii());
}
use of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRPr in project poi by apache.
the class TestXWPFRun method testCTOnOff.
/*
* bug 59208
* Purpose: test all valid boolean-like values
* exercise isCTOnOff(CTOnOff) through all valid permutations
*/
@Test
public void testCTOnOff() {
CTRPr rpr = ctRun.addNewRPr();
CTOnOff bold = rpr.addNewB();
XWPFRun run = new XWPFRun(ctRun, irb);
// True values: "true", "1", "on"
bold.setVal(STOnOff.TRUE);
assertEquals(true, run.isBold());
bold.setVal(STOnOff.X_1);
assertEquals(true, run.isBold());
bold.setVal(STOnOff.ON);
assertEquals(true, run.isBold());
// False values: "false", "0", "off"
bold.setVal(STOnOff.FALSE);
assertEquals(false, run.isBold());
bold.setVal(STOnOff.X_0);
assertEquals(false, run.isBold());
bold.setVal(STOnOff.OFF);
assertEquals(false, run.isBold());
}
use of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRPr in project Gargoyle by callakrsos.
the class KrXWPFRun method setFontFamily.
@Override
public void setFontFamily(String fontFamily) {
CTR run = getCTR();
CTRPr pr = run.isSetRPr() ? run.getRPr() : run.addNewRPr();
CTFonts fonts = pr.isSetRFonts() ? pr.getRFonts() : pr.addNewRFonts();
fonts.setHAnsi(fontFamily);
fonts.setEastAsia(fontFamily);
fonts.setAscii(fontFamily);
super.setFontFamily(fontFamily);
}
Aggregations