@Override public TextPlaceholder getTextPlaceholder() { Placeholder ph = getTextType(); if (ph == null) { return TextPlaceholder.BODY; } switch (ph) { case BODY: return TextPlaceholder.BODY; case TITLE: return TextPlaceholder.TITLE; case CENTERED_TITLE: return TextPlaceholder.CENTER_TITLE; default: case CONTENT: return TextPlaceholder.OTHER; } }
@SuppressWarnings("WeakerAccess") protected XSLFTextShape getTextShapeByType(Placeholder type){ for(XSLFShape shape : this.getShapes()){ if(shape instanceof XSLFTextShape) { XSLFTextShape txt = (XSLFTextShape)shape; if(txt.getTextType() == type) { return txt; } } } return null; }
/** * Copy placeholders from this layout to the destination slide * * @param slide destination slide */ @SuppressWarnings("WeakerAccess") public void copyLayout(XSLFSlide slide) { for (XSLFShape sh : getShapes()) { if (sh instanceof XSLFTextShape) { XSLFTextShape tsh = (XSLFTextShape) sh; Placeholder ph = tsh.getTextType(); if (ph == null) continue; switch (ph) { // these are special and not copied by default case DATETIME: case SLIDE_NUMBER: case FOOTER: break; default: slide.getSpTree().addNewSp().set(tsh.getXmlObject().copy()); } } } }
@Override public TextPlaceholder getTextPlaceholder() { Placeholder ph = getTextType(); if (ph == null) { return TextPlaceholder.BODY; } switch (ph) { case BODY: return TextPlaceholder.BODY; case TITLE: return TextPlaceholder.TITLE; case CENTERED_TITLE: return TextPlaceholder.CENTER_TITLE; default: case CONTENT: return TextPlaceholder.OTHER; } }
Placeholder ph = txt.getTextType(); if (skipPlaceholders && ph != null) { continue;
@SuppressWarnings("WeakerAccess") protected XSLFTextShape getTextShapeByType(Placeholder type){ for(XSLFShape shape : this.getShapes()){ if(shape instanceof XSLFTextShape) { XSLFTextShape txt = (XSLFTextShape)shape; if(txt.getTextType() == type) { return txt; } } } return null; }
protected XSLFTextShape getTextShapeByType(Placeholder type){ for(XSLFShape shape : this.getShapes()){ if(shape instanceof XSLFTextShape) { XSLFTextShape txt = (XSLFTextShape)shape; if(txt.getTextType() == type) { return txt; } } } return null; }
// create a new empty slide show XMLSlideShow ppt = new XMLSlideShow(); // add first slide XSLFSlide slide = ppt.createSlide(); // get or create notes XSLFNotes note = ppt.getNotesSlide(slide); // insert text for (XSLFTextShape shape : note.getPlaceholders()) { if (shape.getTextType() == Placeholder.BODY) { shape.setText("String"); break; } } // save [...]
/** * Copy placeholders from this layout to the destination slide * * @param slide destination slide */ public void copyLayout(XSLFSlide slide) { for (XSLFShape sh : getShapes()) { if (sh instanceof XSLFTextShape) { XSLFTextShape tsh = (XSLFTextShape) sh; Placeholder ph = tsh.getTextType(); if (ph == null) continue; switch (ph) { // these are special and not copied by default case DATETIME: case SLIDE_NUMBER: case FOOTER: break; default: slide.getSpTree().addNewSp().set(tsh.getXmlObject().copy()); } } } }
/** * Copy placeholders from this layout to the destination slide * * @param slide destination slide */ @SuppressWarnings("WeakerAccess") public void copyLayout(XSLFSlide slide) { for (XSLFShape sh : getShapes()) { if (sh instanceof XSLFTextShape) { XSLFTextShape tsh = (XSLFTextShape) sh; Placeholder ph = tsh.getTextType(); if (ph == null) continue; switch (ph) { // these are special and not copied by default case DATETIME: case SLIDE_NUMBER: case FOOTER: break; default: slide.getSpTree().addNewSp().set(tsh.getXmlObject().copy()); } } } }
if (sh instanceof XSLFTextShape) { XSLFTextShape txt = (XSLFTextShape) sh; Placeholder ph = txt.getTextType(); if (skipPlaceholders && ph != null) { continue;
Placeholder ph = txt.getTextType(); if (skipPlaceholders && ph != null) { continue;