Example usage for org.apache.poi.xssf.model ThemesTable getPackagePart

List of usage examples for org.apache.poi.xssf.model ThemesTable getPackagePart

Introduction

In this page you can find the example usage for org.apache.poi.xssf.model ThemesTable getPackagePart.

Prototype

public final PackagePart getPackagePart() 

Source Link

Document

Provides access to the underlying PackagePart

Usage

From source file:com.vaadin.addon.spreadsheet.charts.converter.xssfreader.ChartStylesReader.java

private CTBaseStyles getThemeElements() {
    if (themeElements == null) {
        ThemesTable theme = ((XSSFWorkbook) spreadsheet.getWorkbook()).getTheme();
        if (theme == null) {
            return null;
        }//from   w  w w  .  ja  v a2s  . c o  m
        ThemeDocument themeDocument;
        try {
            themeDocument = ThemeDocument.Factory.parse(theme.getPackagePart().getInputStream());
        } catch (XmlException e) {
            return null;
        } catch (IOException e) {
            return null;
        }

        themeElements = themeDocument.getTheme().getThemeElements();
    }

    return themeElements;
}