本文整理汇总了Java中org.docx4j.wml.BooleanDefaultTrue类的典型用法代码示例。如果您正苦于以下问题:Java BooleanDefaultTrue类的具体用法?Java BooleanDefaultTrue怎么用?Java BooleanDefaultTrue使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BooleanDefaultTrue类属于org.docx4j.wml包,在下文中一共展示了BooleanDefaultTrue类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: runProperties
import org.docx4j.wml.BooleanDefaultTrue; //导入依赖的package包/类
private RPr runProperties(final String fontName, final int fontSize, final boolean bold) {
final RPr rpr = this.wmlObjectFactory.createRPr();
final RFonts font = this.wmlObjectFactory.createRFonts();
font.setAscii(fontName);
font.setHAnsi(fontName);
rpr.setRFonts(font);
final HpsMeasure size = this.wmlObjectFactory.createHpsMeasure();
size.setVal(BigInteger.valueOf(fontSize * 2));
rpr.setSz(size);
final BooleanDefaultTrue isBold = this.wmlObjectFactory.createBooleanDefaultTrue();
isBold.setVal(bold);
rpr.setB(isBold);
return rpr;
}
示例2: addRPrStrikeStyle
import org.docx4j.wml.BooleanDefaultTrue; //导入依赖的package包/类
/**
* @Description: 设置删除线样式
*/
public void addRPrStrikeStyle(RPr runProperties, boolean isStrike,
boolean isDStrike) {
// 删除线
if (isStrike) {
BooleanDefaultTrue strike = new BooleanDefaultTrue();
strike.setVal(true);
runProperties.setStrike(strike);
}
// 双删除线
if (isDStrike) {
BooleanDefaultTrue dStrike = new BooleanDefaultTrue();
dStrike.setVal(true);
runProperties.setDstrike(dStrike);
}
}
示例3: extractFormattingData
import org.docx4j.wml.BooleanDefaultTrue; //导入依赖的package包/类
/**
* Updates the provided formatting data map based on the provided data about the text run.
*
* @param run
* The provided text run
* @param childRange
* The text range this run covers
* @param formattingData
* The formatting data map to update
* @param paragraphProperties
* The docx4j paragraph properties object
* @param styleMap
* The extracted styles of the main document.
* @param mainDoc
* The main document object
*/
private void extractFormattingData(final R run, final TextRange childRange, final Map<FormattingType, Set<TextRange>> formattingData,
final PPr paragraphProperties, final Map<String, Style> styleMap, final MainDocumentPart mainDoc) {
final RPr runProperties = run.getRPr();
final BooleanDefaultTrue isBold = getRunProperty(runProperties, paragraphProperties, RPr::getB, styleMap, mainDoc);
final BooleanDefaultTrue isItalics = getRunProperty(runProperties, paragraphProperties, RPr::getI, styleMap, mainDoc);
final U underlining = getRunProperty(runProperties, paragraphProperties, RPr::getU, styleMap, mainDoc);
if (isBold != null && isBold.isVal()) {
formattingData.get(FormattingType.BOLD).add(childRange);
}
if (isItalics != null && isItalics.isVal()) {
formattingData.get(FormattingType.ITALICS).add(childRange);
}
if (underlining != null && underlining.getVal() != UnderlineEnumeration.NONE) {
formattingData.get(FormattingType.UNDERLINE).add(childRange);
}
}
示例4: createPageNumParagraph
import org.docx4j.wml.BooleanDefaultTrue; //导入依赖的package包/类
private P createPageNumParagraph() {
CTSimpleField pgnum = factory.createCTSimpleField();
pgnum.setInstr(" PAGE \\* MERGEFORMAT ");
RPr RPr = factory.createRPr();
RPr.setNoProof(new BooleanDefaultTrue());
PPr ppr = factory.createPPr();
Jc jc = factory.createJc();
jc.setVal(JcEnumeration.CENTER);
ppr.setJc(jc);
PPrBase.Spacing pprbase = factory.createPPrBaseSpacing();
pprbase.setBefore(BigInteger.valueOf(240));
pprbase.setAfter(BigInteger.valueOf(0));
ppr.setSpacing(pprbase);
R run = factory.createR();
run.getContent().add(RPr);
pgnum.getContent().add(run);
JAXBElement<CTSimpleField> fldSimple = factory.createPFldSimple(pgnum);
P para = createParagraph();
para.getContent().add(fldSimple);
para.setPPr(ppr);
return para;
}
示例5: paragraphProperties
import org.docx4j.wml.BooleanDefaultTrue; //导入依赖的package包/类
private PPr paragraphProperties(final Spacing spacing, final PBdr border, final Jc alignment, final boolean keepNext) {
final PPr ppr = this.wmlObjectFactory.createPPr();
ppr.setPBdr(border);
ppr.setSpacing(spacing);
ppr.setJc(alignment);
final BooleanDefaultTrue trueElement = this.wmlObjectFactory.createBooleanDefaultTrue();
trueElement.setVal(keepNext);
ppr.setKeepNext(trueElement);
ppr.setContextualSpacing(trueElement);
return ppr;
}
示例6: getRPr
import org.docx4j.wml.BooleanDefaultTrue; //导入依赖的package包/类
/**
* 创建字体
*
* @param isBlod
* 粗体
* @param isUnderLine
* 下划线
* @param isItalic
* 斜体
* @param isStrike
* 删除线
*/
public RPr getRPr(ObjectFactory factory, String fontFamily,
String colorVal, String fontSize, STHint sTHint, boolean isBlod,
boolean isUnderLine, boolean isItalic, boolean isStrike) {
RPr rPr = factory.createRPr();
RFonts rf = new RFonts();
rf.setHint(sTHint);
rf.setAscii(fontFamily);
rf.setHAnsi(fontFamily);
rPr.setRFonts(rf);
BooleanDefaultTrue bdt = factory.createBooleanDefaultTrue();
rPr.setBCs(bdt);
if (isBlod) {
rPr.setB(bdt);
}
if (isItalic) {
rPr.setI(bdt);
}
if (isStrike) {
rPr.setStrike(bdt);
}
if (isUnderLine) {
U underline = new U();
underline.setVal(UnderlineEnumeration.SINGLE);
rPr.setU(underline);
}
Color color = new Color();
color.setVal(colorVal);
rPr.setColor(color);
HpsMeasure sz = new HpsMeasure();
sz.setVal(new BigInteger(fontSize));
rPr.setSz(sz);
rPr.setSzCs(sz);
return rPr;
}
示例7: getRPr
import org.docx4j.wml.BooleanDefaultTrue; //导入依赖的package包/类
/**
* 创建字体
*
* @param isBlod
* 粗体
* @param isUnderLine
* 下划线
* @param isItalic
* 斜体
* @param isStrike
* 删除线
*/
public RPr getRPr(ObjectFactory factory, String fontFamily,
String colorVal, String fontSize, STHint sTHint, boolean isBlod,
boolean isUnderLine, boolean isItalic, boolean isStrike) {
RPr rPr = factory.createRPr();
RFonts rf = new RFonts();
rf.setHint(sTHint);
rf.setAscii(fontFamily);
rf.setHAnsi(fontFamily);
rPr.setRFonts(rf);
BooleanDefaultTrue bdt = factory.createBooleanDefaultTrue();
rPr.setBCs(bdt);
if (isBlod) {
rPr.setB(bdt);
}
if (isItalic) {
rPr.setI(bdt);
}
if (isStrike) {
rPr.setStrike(bdt);
}
if (isUnderLine) {
U underline = new U();
underline.setVal(UnderlineEnumeration.SINGLE);
rPr.setU(underline);
}
Color color = new Color();
color.setVal(colorVal);
rPr.setColor(color);
HpsMeasure sz = new HpsMeasure();
sz.setVal(new BigInteger(fontSize));
rPr.setSz(sz);
rPr.setSzCs(sz);
return rPr;
}
示例8: exportCell
import org.docx4j.wml.BooleanDefaultTrue; //导入依赖的package包/类
@Override
protected void exportCell(String bandName, BandElement bandElement, Object value, int gridRow, int row, int column, int cols,
int rowSpan, int colSpan, boolean isImage) {
if (newRow) {
// rowNo for a table (it is reset in createTable)
rowNo++;
// for first row in page header and page footer we do not add the table row because it will be duplicated
if ( ((!ReportLayout.PAGE_HEADER_BAND_NAME.equals(bandName) && !ReportLayout.PAGE_FOOTER_BAND_NAME.equals(bandName))) || (rowNo>1)) {
if (tableRow != null) {
if (ReportLayout.PAGE_HEADER_BAND_NAME.equals(bandName)) {
tableHeader.getContent().add(tableRow);
} else if (ReportLayout.PAGE_FOOTER_BAND_NAME.equals(bandName)) {
tableFooter.getContent().add(tableRow);
} else {
table.getContent().add(tableRow);
}
}
tableRow = factory.createTr();
}
// create table header to be available on every page
if (bean.getReportLayout().isHeaderOnEveryPage()) {
if (ReportLayout.HEADER_BAND_NAME.equals(bandName)) {
TrPr rowProperties = new TrPr();
BooleanDefaultTrue bdt = Context.getWmlObjectFactory().createBooleanDefaultTrue();
rowProperties.getCnfStyleOrDivIdOrGridBefore().add(Context.getWmlObjectFactory().createCTTrPrBaseTblHeader(bdt));
tableRow.setTrPr(rowProperties);
}
}
}
renderDocxCell(bandName,bandElement, value, gridRow, rowSpan, colSpan, isImage, column);
}
示例9: addBoldStyle
import org.docx4j.wml.BooleanDefaultTrue; //导入依赖的package包/类
/**
* 本方法给可运行块属性添加粗体属性. BooleanDefaultTrue是设置b属性的Docx4j对象, 严格
* 来说我们不需要将值设置为true, 因为这是它的默认值.
*/
public void addBoldStyle(RPr runProperties) {
BooleanDefaultTrue b = new BooleanDefaultTrue();
b.setVal(true);
runProperties.setB(b);
}
示例10: addRPrOutlineStyle
import org.docx4j.wml.BooleanDefaultTrue; //导入依赖的package包/类
/**
* @Description: 空心
*/
public void addRPrOutlineStyle(RPr runProperties) {
BooleanDefaultTrue outline = new BooleanDefaultTrue();
outline.setVal(true);
runProperties.setOutline(outline);
}
示例11: addRPrImprintStyle
import org.docx4j.wml.BooleanDefaultTrue; //导入依赖的package包/类
/**
* @Description: 阴文
*/
public void addRPrImprintStyle(RPr runProperties) {
BooleanDefaultTrue imprint = new BooleanDefaultTrue();
imprint.setVal(true);
runProperties.setImprint(imprint);
}
示例12: addRPrEmbossStyle
import org.docx4j.wml.BooleanDefaultTrue; //导入依赖的package包/类
/**
* @Description: 阳文
*/
public void addRPrEmbossStyle(RPr runProperties) {
BooleanDefaultTrue emboss = new BooleanDefaultTrue();
emboss.setVal(true);
runProperties.setEmboss(emboss);
}
示例13: addRPrShadowStyle
import org.docx4j.wml.BooleanDefaultTrue; //导入依赖的package包/类
/**
* @Description: 设置阴影
*/
public void addRPrShadowStyle(RPr runProperties) {
BooleanDefaultTrue shadow = new BooleanDefaultTrue();
shadow.setVal(true);
runProperties.setShadow(shadow);
}
示例14: addRPrBoldStyle
import org.docx4j.wml.BooleanDefaultTrue; //导入依赖的package包/类
/**
* @Description: 加粗
*/
public void addRPrBoldStyle(RPr runProperties) {
BooleanDefaultTrue b = new BooleanDefaultTrue();
b.setVal(true);
runProperties.setB(b);
}
示例15: addRPrItalicStyle
import org.docx4j.wml.BooleanDefaultTrue; //导入依赖的package包/类
/**
* @Description: 倾斜
*/
public void addRPrItalicStyle(RPr runProperties) {
BooleanDefaultTrue b = new BooleanDefaultTrue();
b.setVal(true);
runProperties.setI(b);
}