Examples of CTRegularTextRun


Examples of org.openxmlformats.schemas.drawingml.x2006.main.CTRegularTextRun

        XSSFWorkbook wb = (XSSFWorkbook)getDrawing().getParent().getParent();
        str.setStylesTableReference(wb.getStylesSource());

        CTTextParagraph p = CTTextParagraph.Factory.newInstance();
        if(str.numFormattingRuns() == 0){
            CTRegularTextRun r = p.addNewR();
            CTTextCharacterProperties rPr = r.addNewRPr();
            rPr.setLang("en-US");
            rPr.setSz(1100);
            r.setT(str.getString());

        } else {
            for (int i = 0; i < str.getCTRst().sizeOfRArray(); i++) {
                CTRElt lt = str.getCTRst().getRArray(i);
                CTRPrElt ltPr = lt.getRPr();
                if(ltPr == null) ltPr = lt.addNewRPr();

                CTRegularTextRun r = p.addNewR();
                CTTextCharacterProperties rPr = r.addNewRPr();
                rPr.setLang("en-US");

                applyAttributes(ltPr, rPr);

                r.setT(lt.getT());
            }
        }
       
        clearText();               
        ctShape.getTxBody().setPArray(new CTTextParagraph[]{p});
View Full Code Here

Examples of org.openxmlformats.schemas.drawingml.x2006.main.CTRegularTextRun

    public XSSFTextParagraph addNewTextParagraph(XSSFRichTextString str) {
        CTTextBody txBody = ctShape.getTxBody();
        CTTextParagraph p = txBody.addNewP();
      
        if(str.numFormattingRuns() == 0){
            CTRegularTextRun r = p.addNewR();
            CTTextCharacterProperties rPr = r.addNewRPr();
            rPr.setLang("en-US");
            rPr.setSz(1100);
            r.setT(str.getString());

        } else {
            for (int i = 0; i < str.getCTRst().sizeOfRArray(); i++) {
                CTRElt lt = str.getCTRst().getRArray(i);
                CTRPrElt ltPr = lt.getRPr();
                if(ltPr == null) ltPr = lt.addNewRPr();

                CTRegularTextRun r = p.addNewR();
                CTTextCharacterProperties rPr = r.addNewRPr();
                rPr.setLang("en-US");

                applyAttributes(ltPr, rPr);

                r.setT(lt.getT());
            }
        }
       
        // Note: the XSSFTextParagraph constructor will create its required XSSFTextRuns from the provided CTTextParagraph
        XSSFTextParagraph paragraph = new XSSFTextParagraph(p, ctShape);
View Full Code Here

Examples of org.openxmlformats.schemas.drawingml.x2006.main.CTRegularTextRun

        _runs = new ArrayList<XSLFTextRun>();
        _shape = shape;

        for(XmlObject ch : _p.selectPath("*")){
            if(ch instanceof CTRegularTextRun){
                CTRegularTextRun r = (CTRegularTextRun)ch;
                _runs.add(new XSLFTextRun(r, this));
            } else if (ch instanceof CTTextLineBreak){
                CTTextLineBreak br = (CTTextLineBreak)ch;
                CTRegularTextRun r = CTRegularTextRun.Factory.newInstance();
                r.setRPr(br.getRPr());
                r.setT("\n");
                _runs.add(new XSLFTextRun(r, this));
            } else if (ch instanceof CTTextField){
                CTTextField f = (CTTextField)ch;
                CTRegularTextRun r = CTRegularTextRun.Factory.newInstance();
                r.setRPr(f.getRPr());
                r.setT(f.getT());
                _runs.add(new XSLFTextRun(r, this));
            }
        }
    }
View Full Code Here

Examples of org.openxmlformats.schemas.drawingml.x2006.main.CTRegularTextRun

    public Iterator<XSLFTextRun> iterator(){
        return _runs.iterator();
    }

    public XSLFTextRun addNewTextRun(){
        CTRegularTextRun r = _p.addNewR();
        r.addNewRPr();
        XSLFTextRun run = new XSLFTextRun(r, this);
        _runs.add(run);
        return run;
    }
View Full Code Here

Examples of org.openxmlformats.schemas.drawingml.x2006.main.CTRegularTextRun

                    XmlCursor c = paras[j].newCursor();
                    c.selectPath("./*");
                    while (c.toNextSelection()) {
                        XmlObject o = c.getObject();
                        if(o instanceof CTRegularTextRun){
                            CTRegularTextRun txrun = (CTRegularTextRun)o;
                            text.append( txrun.getT() );
                        } else if (o instanceof CTTextLineBreak){
                            text.append('\n');
                        }
                    }
                   
View Full Code Here

Examples of org.openxmlformats.schemas.drawingml.x2006.main.CTRegularTextRun

        XmlCursor c = p.newCursor();
        c.selectPath("./*");
        while (c.toNextSelection()) {
            XmlObject o = c.getObject();
            if (o instanceof CTRegularTextRun) {
                CTRegularTextRun txrun = (CTRegularTextRun) o;
                text.append(txrun.getT());
            } else if (o instanceof CTTextLineBreak) {
                text.append('\n');
            }
        }

View Full Code Here

Examples of org.openxmlformats.schemas.drawingml.x2006.main.CTRegularTextRun

        XSSFWorkbook wb = (XSSFWorkbook)getDrawing().getParent().getParent();
        str.setStylesTableReference(wb.getStylesSource());

        CTTextParagraph p = CTTextParagraph.Factory.newInstance();
        if(str.numFormattingRuns() == 0){
            CTRegularTextRun r = p.addNewR();
            CTTextCharacterProperties rPr = r.addNewRPr();
            rPr.setLang("en-US");
            rPr.setSz(1100);
            r.setT(str.getString());

        } else {
            for (int i = 0; i < str.getCTRst().sizeOfRArray(); i++) {
                CTRElt lt = str.getCTRst().getRArray(i);
                CTRPrElt ltPr = lt.getRPr();
                if(ltPr == null) ltPr = lt.addNewRPr();

                CTRegularTextRun r = p.addNewR();
                CTTextCharacterProperties rPr = r.addNewRPr();
                rPr.setLang("en-US");

                applyAttributes(ltPr, rPr);

                r.setT(lt.getT());
            }
        }
        ctShape.getTxBody().setPArray(new CTTextParagraph[]{p});

    }
View Full Code Here

Examples of org.openxmlformats.schemas.drawingml.x2006.main.CTRegularTextRun

        XmlCursor c = p.newCursor();
        c.selectPath("./*");
        while (c.toNextSelection()) {
            XmlObject o = c.getObject();
            if (o instanceof CTRegularTextRun) {
                CTRegularTextRun txrun = (CTRegularTextRun) o;
                text.append(txrun.getT());
            } else if (o instanceof CTTextLineBreak) {
                text.append('\n');
            }
        }

View Full Code Here

Examples of org.openxmlformats.schemas.drawingml.x2006.main.CTRegularTextRun

        XmlCursor c = p.newCursor();
        c.selectPath("./*");
        while (c.toNextSelection()) {
            XmlObject o = c.getObject();
            if (o instanceof CTRegularTextRun) {
                CTRegularTextRun txrun = (CTRegularTextRun) o;
                text.append(txrun.getT());
            } else if (o instanceof CTTextLineBreak) {
                text.append('\n');
            }
        }
       
View Full Code Here

Examples of org.openxmlformats.schemas.drawingml.x2006.main.CTRegularTextRun

    public Iterator<XSLFTextRun> iterator(){
        return _runs.iterator();
    }

    public XSLFTextRun addNewTextRun(){
        CTRegularTextRun r = _p.addNewR();
        r.addNewRPr();
        XSLFTextRun run = new XSLFTextRun(r, this);
        _runs.add(run);
        return run;
    }
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.