/** * Whether the bold property shall be applied to all non-complex script * characters in the contents of this run when displayed in a document. * <p> * This formatting property is a toggle property, which specifies that its * behavior differs between its use within a style definition and its use as * direct formatting. When used as part of a style definition, setting this * property shall toggle the current state of that property as specified up * to this point in the hierarchy (i.e. applied to not applied, and vice * versa). Setting it to <code>false</code> (or an equivalent) shall * result in the current setting remaining unchanged. However, when used as * direct formatting, setting this property to true or false shall set the * absolute state of the resulting property. * </p> * <p> * If this element is not present, the default value is to leave the * formatting applied at previous level in the style hierarchy. If this * element is never applied in the style hierarchy, then bold shall not be * applied to non-complex script characters. * </p> * * @param value <code>true</code> if the bold property is applied to * this run */ @Override public void setBold(boolean value) { CTRPr pr = getRunProperties(true); CTOnOff bold = pr.isSetB() ? pr.getB() : pr.addNewB(); bold.setVal(value ? STOnOff.TRUE : STOnOff.FALSE); }
public TOC(CTSdtBlock block) { this.block = block; CTSdtPr sdtPr = block.addNewSdtPr(); CTDecimalNumber id = sdtPr.addNewId(); id.setVal(new BigInteger("4844945")); sdtPr.addNewDocPartObj().addNewDocPartGallery().setVal("Table of contents"); CTSdtEndPr sdtEndPr = block.addNewSdtEndPr(); CTRPr rPr = sdtEndPr.addNewRPr(); CTFonts fonts = rPr.addNewRFonts(); fonts.setAsciiTheme(STTheme.MINOR_H_ANSI); fonts.setEastAsiaTheme(STTheme.MINOR_H_ANSI); fonts.setHAnsiTheme(STTheme.MINOR_H_ANSI); fonts.setCstheme(STTheme.MINOR_BIDI); rPr.addNewB().setVal(STOnOff.OFF); rPr.addNewBCs().setVal(STOnOff.OFF); rPr.addNewColor().setVal("auto"); rPr.addNewSz().setVal(new BigInteger("24")); rPr.addNewSzCs().setVal(new BigInteger("24")); CTSdtContentBlock content = block.addNewSdtContent(); CTP p = content.addNewP(); p.setRsidR("00EF7E24".getBytes(LocaleUtil.CHARSET_1252)); p.setRsidRDefault("00EF7E24".getBytes(LocaleUtil.CHARSET_1252)); p.addNewPPr().addNewPStyle().setVal("TOCHeading"); p.addNewR().addNewT().setStringValue("Table of Contents"); }
public TOC(CTSdtBlock block) { this.block = block; CTSdtPr sdtPr = block.addNewSdtPr(); CTDecimalNumber id = sdtPr.addNewId(); id.setVal(new BigInteger("4844945")); sdtPr.addNewDocPartObj().addNewDocPartGallery().setVal("Table of contents"); CTSdtEndPr sdtEndPr = block.addNewSdtEndPr(); CTRPr rPr = sdtEndPr.addNewRPr(); CTFonts fonts = rPr.addNewRFonts(); fonts.setAsciiTheme(STTheme.MINOR_H_ANSI); fonts.setEastAsiaTheme(STTheme.MINOR_H_ANSI); fonts.setHAnsiTheme(STTheme.MINOR_H_ANSI); fonts.setCstheme(STTheme.MINOR_BIDI); rPr.addNewB().setVal(STOnOff.OFF); rPr.addNewBCs().setVal(STOnOff.OFF); rPr.addNewColor().setVal("auto"); rPr.addNewSz().setVal(new BigInteger("24")); rPr.addNewSzCs().setVal(new BigInteger("24")); CTSdtContentBlock content = block.addNewSdtContent(); CTP p = content.addNewP(); p.setRsidR("00EF7E24".getBytes(LocaleUtil.CHARSET_1252)); p.setRsidRDefault("00EF7E24".getBytes(LocaleUtil.CHARSET_1252)); p.addNewPPr().addNewPStyle().setVal("TOCHeading"); p.addNewR().addNewT().setStringValue("Table of Contents"); }
/** * Whether the bold property shall be applied to all non-complex script * characters in the contents of this run when displayed in a document. * <p> * This formatting property is a toggle property, which specifies that its * behavior differs between its use within a style definition and its use as * direct formatting. When used as part of a style definition, setting this * property shall toggle the current state of that property as specified up * to this point in the hierarchy (i.e. applied to not applied, and vice * versa). Setting it to <code>false</code> (or an equivalent) shall * result in the current setting remaining unchanged. However, when used as * direct formatting, setting this property to true or false shall set the * absolute state of the resulting property. * </p> * <p> * If this element is not present, the default value is to leave the * formatting applied at previous level in the style hierarchy. If this * element is never applied in the style hierarchy, then bold shall not be * applied to non-complex script characters. * </p> * * @param value <code>true</code> if the bold property is applied to * this run */ @Override public void setBold(boolean value) { CTRPr pr = getRunProperties(true); CTOnOff bold = pr.isSetB() ? pr.getB() : pr.addNewB(); bold.setVal(value ? STOnOff.TRUE : STOnOff.FALSE); }
public TOC(CTSdtBlock block) { this.block = block; CTSdtPr sdtPr = block.addNewSdtPr(); CTDecimalNumber id = sdtPr.addNewId(); id.setVal(new BigInteger("4844945")); sdtPr.addNewDocPartObj().addNewDocPartGallery().setVal("Table of contents"); CTSdtEndPr sdtEndPr = block.addNewSdtEndPr(); CTRPr rPr = sdtEndPr.addNewRPr(); CTFonts fonts = rPr.addNewRFonts(); fonts.setAsciiTheme(STTheme.MINOR_H_ANSI); fonts.setEastAsiaTheme(STTheme.MINOR_H_ANSI); fonts.setHAnsiTheme(STTheme.MINOR_H_ANSI); fonts.setCstheme(STTheme.MINOR_BIDI); rPr.addNewB().setVal(STOnOff.OFF); rPr.addNewBCs().setVal(STOnOff.OFF); rPr.addNewColor().setVal("auto"); rPr.addNewSz().setVal(new BigInteger("24")); rPr.addNewSzCs().setVal(new BigInteger("24")); CTSdtContentBlock content = block.addNewSdtContent(); CTP p = content.addNewP(); p.setRsidR("00EF7E24".getBytes()); p.setRsidRDefault("00EF7E24".getBytes()); p.addNewPPr().addNewPStyle().setVal("TOCHeading"); p.addNewR().addNewT().setStringValue("Table of Contents"); }
/** * Whether the bold property shall be applied to all non-complex script * characters in the contents of this run when displayed in a document. * <p> * This formatting property is a toggle property, which specifies that its * behavior differs between its use within a style definition and its use as * direct formatting. When used as part of a style definition, setting this * property shall toggle the current state of that property as specified up * to this point in the hierarchy (i.e. applied to not applied, and vice * versa). Setting it to <code>false</code> (or an equivalent) shall * result in the current setting remaining unchanged. However, when used as * direct formatting, setting this property to true or false shall set the * absolute state of the resulting property. * </p> * <p> * If this element is not present, the default value is to leave the * formatting applied at previous level in the style hierarchy. If this * element is never applied in the style hierarchy, then bold shall not be * applied to non-complex script characters. * </p> * * @param value <code>true</code> if the bold property is applied to * this run */ public void setBold(boolean value) { CTRPr pr = run.isSetRPr() ? run.getRPr() : run.addNewRPr(); CTOnOff bold = pr.isSetB() ? pr.getB() : pr.addNewB(); bold.setVal(value ? STOnOff.TRUE : STOnOff.FALSE); }