use of org.docx4j.wml.CTLanguage in project TranskribusCore by Transkribus.
the class DocxBuilder method createIt.
public static P createIt() {
org.docx4j.wml.ObjectFactory wmlObjectFactory = new org.docx4j.wml.ObjectFactory();
P p = wmlObjectFactory.createP();
// Create object for pPr
PPr ppr = wmlObjectFactory.createPPr();
p.setPPr(ppr);
// Create object for rPr
ParaRPr pararpr = wmlObjectFactory.createParaRPr();
ppr.setRPr(pararpr);
// Create object for u
U u = wmlObjectFactory.createU();
pararpr.setU(u);
u.setVal(org.docx4j.wml.UnderlineEnumeration.SINGLE);
// Create object for lang
CTLanguage language = wmlObjectFactory.createCTLanguage();
pararpr.setLang(language);
language.setVal("en-AU");
// Create object for jc
Jc jc = wmlObjectFactory.createJc();
ppr.setJc(jc);
jc.setVal(org.docx4j.wml.JcEnumeration.CENTER);
// Create object for r
R r = wmlObjectFactory.createR();
p.getContent().add(r);
// Create object for rPr
RPr rpr = wmlObjectFactory.createRPr();
r.setRPr(rpr);
// Create object for u
U u2 = wmlObjectFactory.createU();
rpr.setU(u2);
u2.setVal(org.docx4j.wml.UnderlineEnumeration.SINGLE);
// Create object for lang
CTLanguage language2 = wmlObjectFactory.createCTLanguage();
rpr.setLang(language2);
language2.setVal("en-AU");
// Create object for t (wrapped in JAXBElement)
Text text = wmlObjectFactory.createText();
JAXBElement<org.docx4j.wml.Text> textWrapped = wmlObjectFactory.createRT(text);
r.getContent().add(textWrapped);
text.setValue("Underlined and centred");
return p;
}