public boolean isPlaceholder() { return getPlaceholderDetails().getCTPlaceholder(false) != null; }
@Override public boolean isHeaderOrFooter() { CTPlaceholder ph = _shape.getPlaceholderDetails().getCTPlaceholder(false); int phId = (ph == null ? -1 : ph.getType().intValue()); switch (phId) { case STPlaceholderType.INT_SLD_NUM: case STPlaceholderType.INT_DT: case STPlaceholderType.INT_FTR: case STPlaceholderType.INT_HDR: return true; default: return false; } }
@Override public PlaceholderSize getSize() { final CTPlaceholder ph = getCTPlaceholder(false); if (ph == null || !ph.isSetSz()) { return null; } switch (ph.getSz().intValue()) { case STPlaceholderSize.INT_FULL: return PlaceholderSize.full; case STPlaceholderSize.INT_HALF: return PlaceholderSize.half; case STPlaceholderSize.INT_QUARTER: return PlaceholderSize.quarter; default: return null; } }
private void initPlaceholders() { if(_placeholders == null) { _placeholders = new ArrayList<>(); _placeholderByIdMap = new HashMap<>(); _placeholderByTypeMap = new HashMap<>(); for(final XSLFShape sh : getShapes()){ if(sh instanceof XSLFTextShape){ final XSLFTextShape sShape = (XSLFTextShape)sh; final CTPlaceholder ph = sShape.getPlaceholderDetails().getCTPlaceholder(false); if(ph != null) { _placeholders.add(sShape); if(ph.isSetIdx()) { int idx = (int)ph.getIdx(); _placeholderByIdMap.put(idx, sShape); } if(ph.isSetType()){ _placeholderByTypeMap.put(ph.getType().intValue(), sShape); } } } } } }
@Override public void setPlaceholder(final Placeholder placeholder) { CTPlaceholder ph = getCTPlaceholder(placeholder != null); if (ph != null) { if (placeholder != null) { ph.setType(STPlaceholderType.Enum.forInt(placeholder.ooxmlId)); } else { getNvProps().unsetPh(); } } }
@Override public Placeholder getPlaceholder() { final CTPlaceholder ph = getCTPlaceholder(false); if (ph == null || !(ph.isSetType() || ph.isSetIdx())) { return null; } return Placeholder.lookupOoxml(ph.getType().intValue()); }
@Override public void setSize(final PlaceholderSize size) { final CTPlaceholder ph = getCTPlaceholder(false); if (ph == null) { return; } if (size == null) { ph.unsetSz(); return; } switch (size) { case full: ph.setSz(STPlaceholderSize.FULL); break; case half: ph.setSz(STPlaceholderSize.HALF); break; case quarter: ph.setSz(STPlaceholderSize.QUARTER); break; } }
final CTPlaceholder ph = getPlaceholderDetails().getCTPlaceholder(false); if (ph == null) { return false;
@Override public boolean isVisible() { final CTPlaceholder ph = getCTPlaceholder(false); if (ph == null || !ph.isSetType()) { return true; } final CTHeaderFooter hf = getHeaderFooter(false); if (hf == null) { return false; } final Placeholder pl = Placeholder.lookupOoxml(ph.getType().intValue()); if (pl == null) { return true; } switch (pl) { case DATETIME: return !hf.isSetDt() || hf.getDt(); case FOOTER: return !hf.isSetFtr() || hf.getFtr(); case HEADER: return !hf.isSetHdr() || hf.getHdr(); case SLIDE_NUMBER: return !hf.isSetSldNum() || hf.getSldNum(); default: return true; } }
CTPlaceholder ph = _shape.getPlaceholderDetails().getCTPlaceholder(false); String defaultStyleSelector; switch(ph == null ? -1 : ph.getType().intValue()) {
public boolean isPlaceholder() { return getPlaceholderDetails().getCTPlaceholder(false) != null; }
@Override public boolean isHeaderOrFooter() { CTPlaceholder ph = _shape.getPlaceholderDetails().getCTPlaceholder(false); int phId = (ph == null ? -1 : ph.getType().intValue()); switch (phId) { case STPlaceholderType.INT_SLD_NUM: case STPlaceholderType.INT_DT: case STPlaceholderType.INT_FTR: case STPlaceholderType.INT_HDR: return true; default: return false; } }
private void initPlaceholders() { if(_placeholders == null) { _placeholders = new ArrayList<>(); _placeholderByIdMap = new HashMap<>(); _placeholderByTypeMap = new HashMap<>(); for(final XSLFShape sh : getShapes()){ if(sh instanceof XSLFTextShape){ final XSLFTextShape sShape = (XSLFTextShape)sh; final CTPlaceholder ph = sShape.getPlaceholderDetails().getCTPlaceholder(false); if(ph != null) { _placeholders.add(sShape); if(ph.isSetIdx()) { int idx = (int)ph.getIdx(); _placeholderByIdMap.put(idx, sShape); } if(ph.isSetType()){ _placeholderByTypeMap.put(ph.getType().intValue(), sShape); } } } } } }
@Override public PlaceholderSize getSize() { final CTPlaceholder ph = getCTPlaceholder(false); if (ph == null || !ph.isSetSz()) { return null; } switch (ph.getSz().intValue()) { case STPlaceholderSize.INT_FULL: return PlaceholderSize.full; case STPlaceholderSize.INT_HALF: return PlaceholderSize.half; case STPlaceholderSize.INT_QUARTER: return PlaceholderSize.quarter; default: return null; } }
@Override public void setPlaceholder(final Placeholder placeholder) { CTPlaceholder ph = getCTPlaceholder(placeholder != null); if (ph != null) { if (placeholder != null) { ph.setType(STPlaceholderType.Enum.forInt(placeholder.ooxmlId)); } else { getNvProps().unsetPh(); } } }
@Override public Placeholder getPlaceholder() { final CTPlaceholder ph = getCTPlaceholder(false); if (ph == null || !(ph.isSetType() || ph.isSetIdx())) { return null; } return Placeholder.lookupOoxml(ph.getType().intValue()); }
@Override public void setSize(final PlaceholderSize size) { final CTPlaceholder ph = getCTPlaceholder(false); if (ph == null) { return; } if (size == null) { ph.unsetSz(); return; } switch (size) { case full: ph.setSz(STPlaceholderSize.FULL); break; case half: ph.setSz(STPlaceholderSize.HALF); break; case quarter: ph.setSz(STPlaceholderSize.QUARTER); break; } }
final CTPlaceholder ph = getPlaceholderDetails().getCTPlaceholder(false); if (ph == null) { return false;
@Override public boolean isVisible() { final CTPlaceholder ph = getCTPlaceholder(false); if (ph == null || !ph.isSetType()) { return true; } final CTHeaderFooter hf = getHeaderFooter(false); if (hf == null) { return false; } final Placeholder pl = Placeholder.lookupOoxml(ph.getType().intValue()); if (pl == null) { return true; } switch (pl) { case DATETIME: return !hf.isSetDt() || hf.getDt(); case FOOTER: return !hf.isSetFtr() || hf.getFtr(); case HEADER: return !hf.isSetHdr() || hf.getHdr(); case SLIDE_NUMBER: return !hf.isSetSldNum() || hf.getSldNum(); default: return true; } }
CTPlaceholder ph = _shape.getPlaceholderDetails().getCTPlaceholder(false); String defaultStyleSelector; switch(ph == null ? -1 : ph.getType().intValue()) {