public XDDFTextParagraph getParagraph(int index) { return new XDDFTextParagraph(_body.getPArray(index), this); }
/* package */ XSLFTextShape(XmlObject shape, XSLFSheet sheet) { super(shape, sheet); _paragraphs = new ArrayList<>(); CTTextBody txBody = getTextBody(false); if (txBody != null) { for (CTTextParagraph p : txBody.getPArray()) { _paragraphs.add(newTextParagraph(p)); } } }
protected XSSFSimpleShape(XSSFDrawing drawing, CTShape ctShape) { this.drawing = drawing; this.ctShape = ctShape; _paragraphs = new ArrayList<>(); // initialize any existing paragraphs - this will be the default body // paragraph in a new shape, // or existing paragraphs that have been loaded from the file CTTextBody body = ctShape.getTxBody(); if (body == null) { _textBody = null; } else { _textBody = new XDDFTextBody(this, body); for (int i = 0; i < body.sizeOfPArray(); i++) { _paragraphs.add(new XSSFTextParagraph(body.getPArray(i), ctShape)); } } }
/** * add a new paragraph run to this shape * * @return created paragraph run */ public XSLFTextParagraph addNewTextParagraph() { CTTextBody txBody = getTextBody(false); CTTextParagraph p; if (txBody == null) { txBody = getTextBody(true); p = txBody.getPArray(0); p.removeR(0); } else { p = txBody.addNewP(); } XSLFTextParagraph paragraph = newTextParagraph(p); _paragraphs.add(paragraph); return paragraph; }
_paragraphs.add(new XSSFTextParagraph(ctShape.getTxBody().getPArray(0), ctShape));
public XDDFTextParagraph getParagraph(int index) { return new XDDFTextParagraph(_body.getPArray(index), this); }
/* package */ XSLFTextShape(XmlObject shape, XSLFSheet sheet) { super(shape, sheet); _paragraphs = new ArrayList<>(); CTTextBody txBody = getTextBody(false); if (txBody != null) { for (CTTextParagraph p : txBody.getPArray()) { _paragraphs.add(newTextParagraph(p)); } } }
protected XSSFSimpleShape(XSSFDrawing drawing, CTShape ctShape) { this.drawing = drawing; this.ctShape = ctShape; _paragraphs = new ArrayList<>(); // initialize any existing paragraphs - this will be the default body // paragraph in a new shape, // or existing paragraphs that have been loaded from the file CTTextBody body = ctShape.getTxBody(); if (body == null) { _textBody = null; } else { _textBody = new XDDFTextBody(this, body); for (int i = 0; i < body.sizeOfPArray(); i++) { _paragraphs.add(new XSSFTextParagraph(body.getPArray(i), ctShape)); } } }
/** * add a new paragraph run to this shape * * @return created paragraph run */ public XSLFTextParagraph addNewTextParagraph() { CTTextBody txBody = getTextBody(false); CTTextParagraph p; if (txBody == null) { txBody = getTextBody(true); p = txBody.getPArray(0); p.removeR(0); } else { p = txBody.addNewP(); } XSLFTextParagraph paragraph = newTextParagraph(p); _paragraphs.add(paragraph); return paragraph; }
_paragraphs.add(new XSSFTextParagraph(ctShape.getTxBody().getPArray(0), ctShape));