Example usage for org.apache.poi.xwpf.usermodel BreakType COLUMN

List of usage examples for org.apache.poi.xwpf.usermodel BreakType COLUMN

Introduction

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

Prototype

BreakType COLUMN

To view the source code for org.apache.poi.xwpf.usermodel BreakType COLUMN.

Click Source Link

Document

Specifies that the current break shall restart itself on the next column available on the current page when the document is displayed in page view.

Usage

From source file:org.obeonetwork.m2doc.generator.M2DocEvaluator.java

License:Open Source License

/**
 * Insert the given {@link MPagination}.
 * //from  w  w  w . j  a v a2s .  c om
 * @param run
 *            the {@link XWPFRun} to insert to
 * @param mPagination
 *            the {@link MPagination}
 */
private void insertMPagination(XWPFRun run, MPagination mPagination) {
    switch (mPagination) {
    case newColumn:
        run.addBreak(BreakType.COLUMN);
        break;

    case newParagraph:
        createNewParagraph((XWPFParagraph) run.getParent());
        break;

    case newPage:
        run.addBreak(BreakType.PAGE);
        break;

    case newTableOfContent:
        CTP ctP = currentGeneratedParagraph.getCTP();
        CTSimpleField toc = ctP.addNewFldSimple();
        toc.setInstr("TOC \\h");
        toc.setDirty(STOnOff.TRUE);
        break;

    case newTextWrapping:
        run.addBreak(BreakType.TEXT_WRAPPING);
        break;

    default:
        throw new IllegalStateException("Not supported MPagination.");
    }
}