/** * Turn separate even-and-odd headings on or off * * @param enable <code>true</code> to turn on separate even and odd headings, * <code>false</code> to turn off even and odd headings. */ public void setEvenAndOddHeadings(boolean enable) { CTOnOff onOff = CTOnOff.Factory.newInstance(); onOff.setVal(enable ? STOnOff.TRUE : STOnOff.FALSE); ctSettings.setEvenAndOddHeaders(onOff); }
/** * This element specifies whether a consumer shall break Latin text which * exceeds the text extents of a line by breaking the word across two lines * (breaking on the character level) or by moving the word to the following * line (breaking on the word level). * * @param wrap - boolean */ @Override public void setWordWrapped(boolean wrap) { CTOnOff wordWrap = getCTPPr().isSetWordWrap() ? getCTPPr() .getWordWrap() : getCTPPr().addNewWordWrap(); if (wrap) { wordWrap.setVal(STOnOff.TRUE); } else { wordWrap.unsetVal(); } }
/** * This element specifies whether a consumer shall break Latin text which * exceeds the text extents of a line by breaking the word across two lines * (breaking on the character level) or by moving the word to the following * line (breaking on the word level). * * @return boolean */ @Override public boolean isWordWrapped() { CTOnOff wordWrap = getCTPPr().isSetWordWrap() ? getCTPPr() .getWordWrap() : null; if (wordWrap != null) { return (wordWrap.getVal() == STOnOff.ON || wordWrap.getVal() == STOnOff.TRUE || wordWrap.getVal() == STOnOff.X_1) ? true : false; } return false; }
boolean isUpdateFields() { return ctSettings.isSetUpdateFields() && ctSettings.getUpdateFields().getVal() == STOnOff.TRUE; }
if (ctfldChar.getFfData() != null) { for (CTFFCheckBox checkBox : ctfldChar.getFfData().getCheckBoxList()) { if (checkBox.getDefault() != null && checkBox.getDefault().getVal() == STOnOff.X_1) { text.append("|X|"); } else {
/** * Turn mirrored margins on or off * * @param enable <code>true</code> to turn on mirrored margins, * <code>false</code> to turn off mirrored marginss. */ public void setMirrorMargins(boolean enable) { CTOnOff onOff = CTOnOff.Factory.newInstance(); onOff.setVal(enable ? STOnOff.TRUE : STOnOff.FALSE); ctSettings.setMirrorMargins(onOff); }
/** * This element specifies whether a consumer shall break Latin text which * exceeds the text extents of a line by breaking the word across two lines * (breaking on the character level) or by moving the word to the following * line (breaking on the word level). * * @param wrap - boolean */ public void setWordWrap(boolean wrap) { CTOnOff wordWrap = getCTPPr().isSetWordWrap() ? getCTPPr() .getWordWrap() : getCTPPr().addNewWordWrap(); if (wrap) wordWrap.setVal(STOnOff.TRUE); else wordWrap.unsetVal(); }
/** * Return true if the "can't split row" value is true. 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. * * @return true if rows can't be split, false otherwise. */ public boolean isCantSplitRow() { boolean isCant = false; if (ctRow.isSetTrPr()) { CTTrPr trpr = getTrPr(); if (trpr.sizeOfCantSplitArray() > 0) { CTOnOff onoff = trpr.getCantSplitArray(0); isCant = (onoff.isSetVal() ? WMLHelper.convertSTOnOffToBoolean(onoff.getVal()) : true); } } return isCant; }
/** * Specifies that when rendering this document in a paginated * view, the contents of this paragraph are rendered on the start of a new * page in the document. * <p> * If this element is omitted on a given paragraph, * its value is determined by the setting previously set at any level of the * style hierarchy (i.e. that previous setting remains unchanged). If this * setting is never specified in the style hierarchy, then this property * shall not be applied. Since the paragraph is specified to start on a new * page, it begins page two even though it could have fit on page one. * </p> * * @return boolean - if page break is set */ public boolean isPageBreak() { final CTPPr ppr = getCTPPr(); final CTOnOff ctPageBreak = ppr.isSetPageBreakBefore() ? ppr.getPageBreakBefore() : null; if (ctPageBreak == null) { return false; } return isTruelike(ctPageBreak.getVal(), false); }
/** * Enforces fields update on document open (in Word). * In the settings.xml file <br> * sets the updateSettings value to true (w:updateSettings w:val="true") * <p> * NOTICES: * <ul> * <li>Causing Word to ask on open: "This document contains fields that may refer to other files. Do you want to update the fields in this document?" * (if "Update automatic links at open" is enabled)</li> * <li>Flag is removed after saving with changes in Word </li> * </ul> */ public void setUpdateFields() { CTOnOff onOff = CTOnOff.Factory.newInstance(); onOff.setVal(STOnOff.TRUE); ctSettings.setUpdateFields(onOff); }
/** * This element specifies whether a consumer shall break Latin text which * exceeds the text extents of a line by breaking the word across two lines * (breaking on the character level) or by moving the word to the following * line (breaking on the word level). * * @param wrap - boolean */ @Override public void setWordWrapped(boolean wrap) { CTOnOff wordWrap = getCTPPr().isSetWordWrap() ? getCTPPr() .getWordWrap() : getCTPPr().addNewWordWrap(); if (wrap) { wordWrap.setVal(STOnOff.TRUE); } else { wordWrap.unsetVal(); } }
/** * This element specifies whether a consumer shall break Latin text which * exceeds the text extents of a line by breaking the word across two lines * (breaking on the character level) or by moving the word to the following * line (breaking on the word level). * * @return boolean */ public boolean isWordWrap() { CTOnOff wordWrap = getCTPPr().isSetWordWrap() ? getCTPPr() .getWordWrap() : null; if (wordWrap != null) { return (wordWrap.getVal() == STOnOff.ON || wordWrap.getVal() == STOnOff.TRUE || wordWrap.getVal() == STOnOff.X_1) ? true : false; } return false; }
/** * Specifies that when rendering this document in a paginated * view, the contents of this paragraph are rendered on the start of a new * page in the document. * <p> * If this element is omitted on a given paragraph, * its value is determined by the setting previously set at any level of the * style hierarchy (i.e. that previous setting remains unchanged). If this * setting is never specified in the style hierarchy, then this property * shall not be applied. Since the paragraph is specified to start on a new * page, it begins page two even though it could have fit on page one. * </p> * * @param pageBreak - * boolean value */ public void setPageBreak(boolean pageBreak) { CTPPr ppr = getCTPPr(); CTOnOff ctPageBreak = ppr.isSetPageBreakBefore() ? ppr .getPageBreakBefore() : ppr.addNewPageBreakBefore(); if (pageBreak) { ctPageBreak.setVal(STOnOff.TRUE); } else { ctPageBreak.setVal(STOnOff.FALSE); } }
/** * This element specifies whether a consumer shall break Latin text which * exceeds the text extents of a line by breaking the word across two lines * (breaking on the character level) or by moving the word to the following * line (breaking on the word level). * * @return boolean */ @Override public boolean isWordWrapped() { CTOnOff wordWrap = getCTPPr().isSetWordWrap() ? getCTPPr() .getWordWrap() : null; if (wordWrap != null) { return (wordWrap.getVal() == STOnOff.ON || wordWrap.getVal() == STOnOff.TRUE || wordWrap.getVal() == STOnOff.X_1) ? true : false; } return false; }