/** * @since POI 3.14-Beta1 */ public XSLFTableStyles(PackagePart part) throws IOException, XmlException { super(part); InputStream is = getPackagePart().getInputStream(); TblStyleLstDocument styleDoc = TblStyleLstDocument.Factory.parse(is); is.close(); _tblStyleLst = styleDoc.getTblStyleLst(); List<CTTableStyle> tblStyles = _tblStyleLst.getTblStyleList(); _styles = new ArrayList<>(tblStyles.size()); for(CTTableStyle c : tblStyles){ _styles.add(new XSLFTableStyle(c)); } }
/** * Get assigned TableStyle * * @return the assigned TableStyle * * @since POI 3.15-beta2 */ protected XSLFTableStyle getTableStyle() { CTTable tab = getCTTable(); // TODO: support inline table style if (!tab.isSetTblPr() || !tab.getTblPr().isSetTableStyleId()) { return null; } String styleId = tab.getTblPr().getTableStyleId(); XSLFTableStyles styles = getSheet().getSlideShow().getTableStyles(); for (XSLFTableStyle style : styles.getStyles()) { if (style.getStyleId().equals(styleId)) { return style; } } return null; }
/** * @since POI 3.14-Beta1 */ public XSLFTableStyles(PackagePart part) throws IOException, XmlException { super(part); InputStream is = getPackagePart().getInputStream(); TblStyleLstDocument styleDoc = TblStyleLstDocument.Factory.parse(is); is.close(); _tblStyleLst = styleDoc.getTblStyleLst(); List<CTTableStyle> tblStyles = _tblStyleLst.getTblStyleList(); _styles = new ArrayList<>(tblStyles.size()); for(CTTableStyle c : tblStyles){ _styles.add(new XSLFTableStyle(c)); } }
/** * Get assigned TableStyle * * @return the assigned TableStyle * * @since POI 3.15-beta2 */ protected XSLFTableStyle getTableStyle() { CTTable tab = getCTTable(); // TODO: support inline table style if (!tab.isSetTblPr() || !tab.getTblPr().isSetTableStyleId()) { return null; } String styleId = tab.getTblPr().getTableStyleId(); XSLFTableStyles styles = getSheet().getSlideShow().getTableStyles(); for (XSLFTableStyle style : styles.getStyles()) { if (style.getStyleId().equals(styleId)) { return style; } } return null; }
public XSLFTableStyles(PackagePart part, PackageRelationship rel) throws IOException, XmlException { super(part, rel); _tblStyleLst = CTTableStyleList.Factory.parse(getPackagePart().getInputStream()); _styles = new ArrayList<XSLFTableStyle>(_tblStyleLst.sizeOfTblStyleArray()); for(CTTableStyle c : _tblStyleLst.getTblStyleList()){ _styles.add(new XSLFTableStyle(c)); } }