/** * Construct a ThemesTable. * @param part A PackagePart. * * @since POI 3.14-Beta1 */ public ThemesTable(PackagePart part) throws IOException { super(part); try { theme = ThemeDocument.Factory.parse(part.getInputStream(), DEFAULT_XML_OPTIONS); } catch(XmlException e) { throw new IOException(e.getLocalizedMessage(), e); } }
try ThemeDocument theme = ThemeDocument.Factory.parse( in ); themeDocuments.add( theme );
try ThemeDocument theme = ThemeDocument.Factory.parse( in ); themeDocuments.add( theme );
private static List<ThemeDocument> getThemeDocuments( XWPFDocument document ) { List<ThemeDocument> themeDocuments = new ArrayList<ThemeDocument>(); for ( POIXMLDocumentPart p : document.getRelations() ) { String relationshipType = p.getPackageRelationship().getRelationshipType(); if ( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme".equals( relationshipType ) ) { try { InputStream inputStream = p.getPackagePart().getInputStream(); ThemeDocument theme = ThemeDocument.Factory.parse( inputStream ); themeDocuments.add( theme ); } catch ( Throwable e ) { e.printStackTrace(); } } } return themeDocuments; }
private static List<ThemeDocument> getThemeDocuments( XWPFDocument document ) { List<ThemeDocument> themeDocuments = new ArrayList<ThemeDocument>(); for ( POIXMLDocumentPart p : document.getRelations() ) { String relationshipType = p.getPackageRelationship().getRelationshipType(); if ( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme".equals( relationshipType ) ) { try { InputStream inputStream = p.getPackagePart().getInputStream(); ThemeDocument theme = ThemeDocument.Factory.parse( inputStream ); themeDocuments.add( theme ); } catch ( Throwable e ) { e.printStackTrace(); } } } return themeDocuments; }
private void readFrom(InputStream inputStream) throws XmlException, IOException { doc = ThemeDocument.Factory.parse(inputStream); }
/** * Construct a ThemesTable. * @param part A PackagePart. * * @since POI 3.14-Beta1 */ public ThemesTable(PackagePart part) throws IOException { super(part); try { theme = ThemeDocument.Factory.parse(part.getInputStream(), DEFAULT_XML_OPTIONS); } catch(XmlException e) { throw new IOException(e.getLocalizedMessage(), e); } }
public XSLFTheme(PackagePart part, PackageRelationship rel) throws IOException, XmlException { super(part, rel); ThemeDocument doc = ThemeDocument.Factory.parse(getPackagePart().getInputStream()); _theme = doc.getTheme(); initialize(); }
public ThemesTable(PackagePart part, PackageRelationship rel) throws IOException { super(part, rel); try { theme = ThemeDocument.Factory.parse(part.getInputStream()); } catch(XmlException e) { throw new IOException(e.getLocalizedMessage()); } }
/** * Create a new, empty ThemesTable */ public ThemesTable() { super(); theme = ThemeDocument.Factory.newInstance(); theme.addNewTheme().addNewThemeElements(); }
/** * @since POI 3.14-Beta1 */ public XSLFTheme(PackagePart part) throws IOException, XmlException { super(part); ThemeDocument doc = ThemeDocument.Factory.parse(getPackagePart().getInputStream(), DEFAULT_XML_OPTIONS); _theme = doc.getTheme(); initialize(); }
/** * Create a new, empty ThemesTable */ public ThemesTable() { super(); theme = ThemeDocument.Factory.newInstance(); theme.addNewTheme().addNewThemeElements(); }
/** * @since POI 3.14-Beta1 */ public XSLFTheme(PackagePart part) throws IOException, XmlException { super(part); ThemeDocument doc = ThemeDocument.Factory.parse(getPackagePart().getInputStream(), DEFAULT_XML_OPTIONS); _theme = doc.getTheme(); initialize(); }