Search in sources :

Example 16 with CTOnOff

use of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTOnOff in project poi by apache.

the class XWPFTableRow method setCantSplitRow.

/**
     * Controls whether to allow this table row to split across pages.
     * The logic for this attribute is a little unusual: a true value means
     * DON'T allow rows to split, false means allow rows to split.
     *
     * @param split - if true, don't allow row to be split. If false, allow
     *              row to be split.
     */
public void setCantSplitRow(boolean split) {
    CTTrPr trpr = getTrPr();
    CTOnOff onoff = (trpr.sizeOfCantSplitArray() > 0 ? trpr.getCantSplitArray(0) : trpr.addNewCantSplit());
    onoff.setVal(WMLHelper.convertBooleanToSTOnOff(split));
}
Also used : CTOnOff(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTOnOff) CTTrPr(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTrPr)

Example 17 with CTOnOff

use of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTOnOff in project poi by apache.

the class XWPFTableRow method getRepeat.

private boolean getRepeat() {
    boolean repeat = false;
    if (ctRow.isSetTrPr()) {
        CTTrPr trpr = getTrPr();
        if (trpr.sizeOfTblHeaderArray() > 0) {
            CTOnOff rpt = trpr.getTblHeaderArray(0);
            repeat = (rpt.isSetVal() ? WMLHelper.convertSTOnOffToBoolean(rpt.getVal()) : true);
        }
    }
    return repeat;
}
Also used : CTOnOff(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTOnOff) CTTrPr(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTrPr)

Aggregations

CTOnOff (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTOnOff)17 CTRPr (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRPr)10 CTTrPr (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTrPr)4 Test (org.junit.Test)3 CTP (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP)2 CTPPr (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTPPr)2