/** * Clear all text from this shape */ public void clearText() { _paragraphs.clear(); CTTextBody txBody = ctShape.getTxBody(); txBody.setPArray(null); // remove any existing paragraphs }
/** * unset text from this shape */ public void clearText() { _paragraphs.clear(); CTTextBody txBody = getTextBody(true); txBody.setPArray(null); // remove any existing paragraphs }
ctShape.getTxBody().setPArray(new CTTextParagraph[] { p }); _paragraphs.add(new XSSFTextParagraph(ctShape.getTxBody().getPArray(0), ctShape));
/** * unset text from this shape */ public void clearText() { _paragraphs.clear(); CTTextBody txBody = getTextBody(true); txBody.setPArray(null); // remove any existing paragraphs }
/** * unset text from this shape */ public void clearText(){ _paragraphs.clear(); CTTextBody txBody = getTextBody(true); txBody.setPArray(null); // remove any existing paragraphs }
/** * Clear all text from this shape */ public void clearText() { _paragraphs.clear(); CTTextBody txBody = ctShape.getTxBody(); txBody.setPArray(null); // remove any existing paragraphs }
ctShape.getTxBody().setPArray(new CTTextParagraph[] { p }); _paragraphs.add(new XSSFTextParagraph(ctShape.getTxBody().getPArray(0), ctShape));
public void setText(XSSFRichTextString str){ 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}); }