Search in sources :

Example 1 with CTLanguage

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;
}
Also used : Text(org.docx4j.wml.Text) P(org.docx4j.wml.P) CTLanguage(org.docx4j.wml.CTLanguage) R(org.docx4j.wml.R) PPr(org.docx4j.wml.PPr) U(org.docx4j.wml.U) RPr(org.docx4j.wml.RPr) ParaRPr(org.docx4j.wml.ParaRPr) ParaRPr(org.docx4j.wml.ParaRPr) Jc(org.docx4j.wml.Jc)

Aggregations

CTLanguage (org.docx4j.wml.CTLanguage)1 Jc (org.docx4j.wml.Jc)1 P (org.docx4j.wml.P)1 PPr (org.docx4j.wml.PPr)1 ParaRPr (org.docx4j.wml.ParaRPr)1 R (org.docx4j.wml.R)1 RPr (org.docx4j.wml.RPr)1 Text (org.docx4j.wml.Text)1 U (org.docx4j.wml.U)1