Example usage for org.apache.poi.xwpf.usermodel XWPFParagraph getStyle

List of usage examples for org.apache.poi.xwpf.usermodel XWPFParagraph getStyle

Introduction

In this page you can find the example usage for org.apache.poi.xwpf.usermodel XWPFParagraph getStyle.

Prototype

public String getStyle() 

Source Link

Usage

From source file:de.knowwe.include.export.ExportModel.java

License:Open Source License

public ExportModel(ExportManager manager, InputStream templateStream, ProgressListener progressListener)
        throws IOException {
    // create new document based on template
    this.manager = manager;
    this.exporters = manager.createExporters();
    this.document = new XWPFDocument(templateStream);
    this.progressListener = progressListener;

    // delete all undesired example content
    int index = 0;
    for (IBodyElement element : document.getBodyElements()) {
        if (element instanceof XWPFParagraph) {
            XWPFParagraph paragraph = (XWPFParagraph) element;
            if (Strings.equalsIgnoreCase(paragraph.getStyle(), "StartDelete")) {
                break;
            }/*  w  ww  .ja  v  a 2 s. c  o m*/
        }
        index++;
    }
    while (document.getBodyElements().size() > index) {
        document.removeBodyElement(index);
    }
}