Examples of CTText


Examples of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTText

        CTTbl table = CTTbl.Factory.newInstance();
        CTRow row = table.addNewTr();
        CTTc cell = row.addNewTc();
        CTP paragraph = cell.addNewP();
        CTR run = paragraph.addNewR();
        CTText text = run.addNewT();
        text.setStringValue("finally I can write!");

        XWPFTable xtab = new XWPFTable(table, doc);
        assertEquals("finally I can write!\n", xtab.getText());
    }
View Full Code Here

Examples of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTText

     * @param value the literal text which shall be displayed in the document
     * @param pos - position in the text array (NB: 0 based)
     */
    public void setText(String value, int pos) {
  if(pos > run.sizeOfTArray()) throw new ArrayIndexOutOfBoundsException("Value too large for the parameter position in XWPFRun.setText(String value,int pos)");
        CTText t = (pos < run.sizeOfTArray() && pos >= 0) ? run.getTArray(pos) : run.addNewT();
        t.setStringValue(value);
        preserveSpaces(t);
    }
View Full Code Here

Examples of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTText

     * @param value the literal text which shall be displayed in the document
     * @param pos - position in the text array (NB: 0 based)
     */
    public void setText(String value, int pos) {
  if(pos > run.sizeOfTArray()) throw new ArrayIndexOutOfBoundsException("Value too large for the parameter position in XWPFRun.setText(String value,int pos)");
        CTText t = (pos < run.sizeOfTArray() && pos >= 0) ? run.getTArray(pos) : run.addNewT();
        t.setStringValue(value);
        preserveSpaces(t);
    }
View Full Code Here

Examples of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTText

    assertNull(policy.getFirstPageHeader());
    assertNull(policy.getDefaultFooter());

    CTP ctP1 = CTP.Factory.newInstance();
    CTR ctR1 = ctP1.addNewR();
    CTText t = ctR1.addNewT();
    t.setStringValue("Paragraph in header");

    // Commented MB 23 May 2010
    //CTP ctP2 = CTP.Factory.newInstance();
    //CTR ctR2 = ctP2.addNewR();
    //CTText t2 = ctR2.addNewT();
    //t2.setStringValue("Second paragraph.. for footer");
   
    // Create two paragraphs for insertion into the footer.
    // Previously only one was inserted MB 23 May 2010
    CTP ctP2 = CTP.Factory.newInstance();
    CTR ctR2 = ctP2.addNewR();
    CTText t2 = ctR2.addNewT();
    t2.setStringValue("First paragraph for the footer");
   
    CTP ctP3 = CTP.Factory.newInstance();
    CTR ctR3 = ctP3.addNewR();
    CTText t3 = ctR3.addNewT();
    t3.setStringValue("Second paragraph for the footer");

    XWPFParagraph p1 = new XWPFParagraph(ctP1, sampleDoc);
    XWPFParagraph[] pars = new XWPFParagraph[1];
    pars[0] = p1;
View Full Code Here

Examples of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTText

        CTTbl table = CTTbl.Factory.newInstance();
        CTRow row = table.addNewTr();
        CTTc cell = row.addNewTc();
        CTP paragraph = cell.addNewP();
        CTR run = paragraph.addNewR();
        CTText text = run.addNewT();
        text.setStringValue("finally I can write!");

        XWPFTable xtab = new XWPFTable(null, table);
        assertEquals("finally I can write!\n", xtab.getText());
    }
View Full Code Here

Examples of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTText

    run.addNewRPr().addNewNoProof();
    run.addNewFldChar().setFldCharType(STFldCharType.BEGIN);
    // pageref run
    run = p.addNewR();
    run.addNewRPr().addNewNoProof();
    CTText text = run.addNewInstrText();
    text.setSpace(Space.PRESERVE);
    // bookmark reference
    text.set(" PAGEREF _Toc" + bookmarkRef + " \\h ");
    p.addNewR().addNewRPr().addNewNoProof();
    run = p.addNewR();
    run.addNewRPr().addNewNoProof();
    run.addNewFldChar().setFldCharType(STFldCharType.SEPARATE);
    // page number run
View Full Code Here

Examples of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTText

     * @param value the literal text which shall be displayed in the document
     * @param pos - position in the text array (NB: 0 based)
     */
    public void setText(String value, int pos) {
  if(pos > run.sizeOfTArray()) throw new ArrayIndexOutOfBoundsException("Value too large for the parameter position in XWPFRun.setText(String value,int pos)");
        CTText t = (pos < run.sizeOfTArray() && pos >= 0) ? run.getTArray(pos) : run.addNewT();
        t.setStringValue(value);
    }
View Full Code Here

Examples of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTText

     * @param value the literal text which shall be displayed in the document
     * @param pos - position in the text array (NB: 0 based)
     */
    public void setText(String value, int pos) {
        if(pos > run.sizeOfTArray()) throw new ArrayIndexOutOfBoundsException("Value too large for the parameter position in XWPFRun.setText(String value,int pos)");
        CTText t = (pos < run.sizeOfTArray() && pos >= 0) ? run.getTArray(pos) : run.addNewT();
        t.setStringValue(value);
        preserveSpaces(t);
    }
View Full Code Here

Examples of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTText

        assertNull(policy.getFirstPageHeader());
        assertNull(policy.getDefaultFooter());

        CTP ctP1 = CTP.Factory.newInstance();
        CTR ctR1 = ctP1.addNewR();
        CTText t = ctR1.addNewT();
        String tText = "Paragraph in header";
        t.setStringValue(tText);

        // Commented MB 23 May 2010
        //CTP ctP2 = CTP.Factory.newInstance();
        //CTR ctR2 = ctP2.addNewR();
        //CTText t2 = ctR2.addNewT();
        //t2.setStringValue("Second paragraph.. for footer");

        // Create two paragraphs for insertion into the footer.
        // Previously only one was inserted MB 23 May 2010
        CTP ctP2 = CTP.Factory.newInstance();
        CTR ctR2 = ctP2.addNewR();
        CTText t2 = ctR2.addNewT();
        t2.setStringValue("First paragraph for the footer");

        CTP ctP3 = CTP.Factory.newInstance();
        CTR ctR3 = ctP3.addNewR();
        CTText t3 = ctR3.addNewT();
        t3.setStringValue("Second paragraph for the footer");

        XWPFParagraph p1 = new XWPFParagraph(ctP1, sampleDoc);
        XWPFParagraph[] pars = new XWPFParagraph[1];
        pars[0] = p1;
View Full Code Here

Examples of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTText

     * @param value the literal text which shall be displayed in the document
     * @param pos - position in the text array (NB: 0 based)
     */
    public void setText(String value, int pos) {
        if(pos > run.sizeOfTArray()) throw new ArrayIndexOutOfBoundsException("Value too large for the parameter position in XWPFRun.setText(String value,int pos)");
        CTText t = (pos < run.sizeOfTArray() && pos >= 0) ? run.getTArray(pos) : run.addNewT();
        t.setStringValue(value);
        preserveSpaces(t);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.