Package org.openxmlformats.schemas.wordprocessingml.x2006.main

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


        runs = new ArrayList<XWPFRun>();
        buildRunsInOrderFromXml(paragraph);

        // Look for bits associated with the runs
        for(XWPFRun run : runs) {
            CTR r = run.getCTR();

            // Check for bits that only apply when attached to a core document
            // TODO Make this nicer by tracking the XWPFFootnotes directly
            XmlCursor c = r.newCursor();
            c.selectPath("child::*");
            while (c.toNextSelection()) {
                XmlObject o = c.getObject();
                if(o instanceof CTFtnEdnRef) {
                    CTFtnEdnRef ftn = (CTFtnEdnRef)o;
View Full Code Here


            startChar = startPos.getChar();
        int beginRunPos = 0, candCharPos = 0;
        boolean newList = false;
        for (int runPos=startRun; runPos<paragraph.getRList().size(); runPos++) {
            int beginTextPos = 0,beginCharPos = 0, textPos = 0,  charPos = 0;   
            CTR ctRun = paragraph.getRArray(runPos);
            XmlCursor c = ctRun.newCursor();
            c.selectPath("./*");
            while(c.toNextSelection()){
                XmlObject o = c.getObject();
                if(o instanceof CTText){
                    if(textPos>=startText){
View Full Code Here

     * @param pos
     * @return  the inserted run
     */
    public XWPFRun insertNewRun(int pos){
         if (pos >= 0 && pos <= paragraph.sizeOfRArray()) {
            CTR ctRun = paragraph.insertNewR(pos);
            XWPFRun newRun = new XWPFRun(ctRun, this);
            runs.add(pos, newRun);
            return newRun;
         }
         return null;
View Full Code Here

    CTTabStop tab = tabs.addNewTab();
    tab.setVal(STTabJc.RIGHT);
    tab.setLeader(STTabTlc.DOT);
    tab.setPos(new BigInteger("8290"));
    pPr.addNewRPr().addNewNoProof();
    CTR run = p.addNewR();
    run.addNewRPr().addNewNoProof();
    run.addNewT().setStringValue(title);
    run = p.addNewR();
    run.addNewRPr().addNewNoProof();
    run.addNewTab();
    run = p.addNewR();
    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.setStringValue(" PAGEREF _Toc" + bookmarkRef + " \\h ");
    p.addNewR().addNewRPr().addNewNoProof();
    run = p.addNewR();
    run.addNewRPr().addNewNoProof();
    run.addNewFldChar().setFldCharType(STFldCharType.SEPARATE);
    // page number run
    run = p.addNewR();
    run.addNewRPr().addNewNoProof();
    run.addNewT().setStringValue(Integer.valueOf(page).toString());
    run = p.addNewR();
    run.addNewRPr().addNewNoProof();
    run.addNewFldChar().setFldCharType(STFldCharType.END);
  }
View Full Code Here

        XWPFDocument doc = new XWPFDocument();
        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

    assertNull(policy.getDefaultHeader());
    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

        iruns = new ArrayList<IRunElement>();
        buildRunsInOrderFromXml(paragraph);

        // Look for bits associated with the runs
        for(XWPFRun run : runs) {
            CTR r = run.getCTR();

            // Check for bits that only apply when attached to a core document
            // TODO Make this nicer by tracking the XWPFFootnotes directly
            XmlCursor c = r.newCursor();
            c.selectPath("child::*");
            while (c.toNextSelection()) {
                XmlObject o = c.getObject();
                if(o instanceof CTFtnEdnRef) {
                    CTFtnEdnRef ftn = (CTFtnEdnRef)o;
View Full Code Here

     * @param pos
     * @return  the inserted run
     */
    public XWPFRun insertNewRun(int pos){
        if (pos >= 0 && pos <= paragraph.sizeOfRArray()) {
            CTR ctRun = paragraph.insertNewR(pos);
            XWPFRun newRun = new XWPFRun(ctRun, this);
           
            // To update the iruns, find where we're going
            // in the normal runs, and go in there
            int iPos = iruns.size();
View Full Code Here

        int beginRunPos = 0, candCharPos = 0;
        boolean newList = false;
        CTR[] rArray = paragraph.getRArray();
        for (int runPos=startRun; runPos<rArray.length; runPos++) {
            int beginTextPos = 0,beginCharPos = 0, textPos = 0,  charPos = 0;   
            CTR ctRun = rArray[runPos];
            XmlCursor c = ctRun.newCursor();
            c.selectPath("./*");
            while(c.toNextSelection()){
                XmlObject o = c.getObject();
                if(o instanceof CTText){
                    if(textPos>=startText){
View Full Code Here

       c.dispose();
      
       // Look for bits associated with the runs
       for(XWPFRun run : runs) {
          CTR r = run.getCTR();
         
          // Check for bits that only apply when
          //  attached to a core document
          // TODO Make this nicer by tracking the XWPFFootnotes directly
          if(document != null) {
             c = r.newCursor();
             c.selectPath("child::*");
             while (c.toNextSelection()) {
                XmlObject o = c.getObject();
                if(o instanceof CTFtnEdnRef) {
                   CTFtnEdnRef ftn = (CTFtnEdnRef)o;
View Full Code Here

TOP

Related Classes of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTR

Copyright © 2018 www.massapicom. 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.