• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java BooleanDefaultTrue类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.docx4j.wml.BooleanDefaultTrue的典型用法代码示例。如果您正苦于以下问题:Java BooleanDefaultTrue类的具体用法?Java BooleanDefaultTrue怎么用?Java BooleanDefaultTrue使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



BooleanDefaultTrue类属于org.docx4j.wml包,在下文中一共展示了BooleanDefaultTrue类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
 
开发者ID:mizitch,项目名称:story-inspector,代码行数:19,代码来源:DocXReportSummaryWriter.java


示例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);
    }
}
 
开发者ID:vindell,项目名称:docx4j-template,代码行数:19,代码来源:Docx4j_工具类_S3_Test.java


示例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);
	}
}
 
开发者ID:mizitch,项目名称:story-inspector,代码行数:37,代码来源:DocXDocumentExtractor.java


示例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;
}
 
开发者ID:nextreports,项目名称:nextreports-engine,代码行数:25,代码来源:DocxExporter.java


示例5: 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;
}
 
开发者ID:vindell,项目名称:docx4j-template,代码行数:50,代码来源:Docx4J_例子2.java


示例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;  
}
 
开发者ID:vindell,项目名称:docx4j-template,代码行数:50,代码来源:Docx4J_简单例子2.java


示例7: 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;
}
 
开发者ID:mizitch,项目名称:story-inspector,代码行数:15,代码来源:DocXReportSummaryWriter.java


示例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);		
}
 
开发者ID:nextreports,项目名称:nextreports-engine,代码行数:35,代码来源:DocxExporter.java


示例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);  
}
 
开发者ID:vindell,项目名称:docx4j-template,代码行数:10,代码来源:WordprocessingMLPackageRender.java


示例10: addRPrOutlineStyle

import org.docx4j.wml.BooleanDefaultTrue; //导入依赖的package包/类
/**
 * @Description: 空心
 */
public void addRPrOutlineStyle(RPr runProperties) {
    BooleanDefaultTrue outline = new BooleanDefaultTrue();
    outline.setVal(true);
    runProperties.setOutline(outline);
}
 
开发者ID:vindell,项目名称:docx4j-template,代码行数:9,代码来源:Docx4j_工具类_S3_Test.java


示例11: addRPrImprintStyle

import org.docx4j.wml.BooleanDefaultTrue; //导入依赖的package包/类
/**
 * @Description: 阴文
 */
public void addRPrImprintStyle(RPr runProperties) {
    BooleanDefaultTrue imprint = new BooleanDefaultTrue();
    imprint.setVal(true);
    runProperties.setImprint(imprint);
}
 
开发者ID:vindell,项目名称:docx4j-template,代码行数:9,代码来源:Docx4j_工具类_S3_Test.java


示例12: addRPrEmbossStyle

import org.docx4j.wml.BooleanDefaultTrue; //导入依赖的package包/类
/**
 * @Description: 阳文
 */
public void addRPrEmbossStyle(RPr runProperties) {
    BooleanDefaultTrue emboss = new BooleanDefaultTrue();
    emboss.setVal(true);
    runProperties.setEmboss(emboss);
}
 
开发者ID:vindell,项目名称:docx4j-template,代码行数:9,代码来源:Docx4j_工具类_S3_Test.java


示例13: addRPrShadowStyle

import org.docx4j.wml.BooleanDefaultTrue; //导入依赖的package包/类
/**
 * @Description: 设置阴影
 */
public void addRPrShadowStyle(RPr runProperties) {
    BooleanDefaultTrue shadow = new BooleanDefaultTrue();
    shadow.setVal(true);
    runProperties.setShadow(shadow);
}
 
开发者ID:vindell,项目名称:docx4j-template,代码行数:9,代码来源:Docx4j_工具类_S3_Test.java


示例14: addRPrBoldStyle

import org.docx4j.wml.BooleanDefaultTrue; //导入依赖的package包/类
/**
 * @Description: 加粗
 */
public void addRPrBoldStyle(RPr runProperties) {
    BooleanDefaultTrue b = new BooleanDefaultTrue();
    b.setVal(true);
    runProperties.setB(b);
}
 
开发者ID:vindell,项目名称:docx4j-template,代码行数:9,代码来源:Docx4j_工具类_S3_Test.java


示例15: addRPrItalicStyle

import org.docx4j.wml.BooleanDefaultTrue; //导入依赖的package包/类
/**
 * @Description: 倾斜
 */
public void addRPrItalicStyle(RPr runProperties) {
    BooleanDefaultTrue b = new BooleanDefaultTrue();
    b.setVal(true);
    runProperties.setI(b);
}
 
开发者ID:vindell,项目名称:docx4j-template,代码行数:9,代码来源:Docx4j_工具类_S3_Test.java


示例16: getRPrStyle

import org.docx4j.wml.BooleanDefaultTrue; //导入依赖的package包/类
public RPr getRPrStyle(ObjectFactory factory, String fontFamily,  
        String colorVal, String fontSize, STHint sTHint, boolean isBlod,  
        boolean isItalic, boolean isStrike, boolean isUnderLine,  
        UnderlineEnumeration underLineStyle, String underLineColor,  
        boolean isHightLight, String hightLightValue, boolean isShd,  
        STShd shdValue, String shdColor, CTVerticalAlignRun stRunEnum) {  
    RPr rPr = factory.createRPr();  
    RFonts rf = new RFonts();  
    if (sTHint != null) {  
        rf.setHint(sTHint);  
    }  
    if (fontFamily != null) {  
        rf.setAscii(fontFamily);  
        rf.setEastAsia(fontFamily);  
        rf.setHAnsi(fontFamily);  
    }  
    rPr.setRFonts(rf);  
    if (colorVal != null) {  
        Color color = new Color();  
        color.setVal(colorVal);  
        rPr.setColor(color);  
    }  
    if (fontSize != null) {  
        HpsMeasure sz = new HpsMeasure();  
        sz.setVal(new BigInteger(fontSize));  
        rPr.setSz(sz);  
        rPr.setSzCs(sz);  
    }  
  
    BooleanDefaultTrue bdt = factory.createBooleanDefaultTrue();  
    if (isBlod) {  
        rPr.setB(bdt);  
    }  
    if (isItalic) {  
        rPr.setI(bdt);  
    }  
    if (isStrike) {  
        rPr.setStrike(bdt);  
    }  
    if (isUnderLine) {  
        U underline = new U();  
        if (underLineStyle != null) {  
            underline.setVal(underLineStyle);  
        }  
        if (underLineColor != null) {  
            underline.setColor(underLineColor);  
        }  
        rPr.setU(underline);  
    }  
    if (isHightLight) {  
        Highlight hight = new Highlight();  
        hight.setVal(hightLightValue);  
        rPr.setHighlight(hight);  
    }  
    if (isShd) {  
        CTShd shd = new CTShd();  
        if (shdColor != null) {  
            shd.setColor(shdColor);  
        }  
        if (shdValue != null) {  
            shd.setVal(shdValue);  
        }  
        rPr.setShd(shd);  
    }  
    if (stRunEnum != null) {  
        rPr.setVertAlign(stRunEnum);  
    }  
    return rPr;  
}
 
开发者ID:vindell,项目名称:docx4j-template,代码行数:70,代码来源:Docx4j_创建批注_S3_Test.java


示例17: addBoldStyle

import org.docx4j.wml.BooleanDefaultTrue; //导入依赖的package包/类
/**
 *  本方法给可运行块属性添加粗体属性. BooleanDefaultTrue是设置b属性的Docx4j对象, 严格
 *  来说我们不需要将值设置为true, 因为这是它的默认值.
 */
private static void addBoldStyle(RPr runProperties) {
    BooleanDefaultTrue b = new BooleanDefaultTrue();
    b.setVal(true);
    runProperties.setB(b);
}
 
开发者ID:vindell,项目名称:docx4j-template,代码行数:10,代码来源:TableWithStyledContent.java


示例18: addBoldStyle

import org.docx4j.wml.BooleanDefaultTrue; //导入依赖的package包/类
public void addBoldStyle(RPr runProperties) {  
    BooleanDefaultTrue b = new BooleanDefaultTrue();  
    b.setVal(true);  
    runProperties.setB(b);  
}
 
开发者ID:vindell,项目名称:docx4j-template,代码行数:6,代码来源:Docx4j_创建表格_S5_Test.java


示例19: addItalicStyle

import org.docx4j.wml.BooleanDefaultTrue; //导入依赖的package包/类
public void addItalicStyle(RPr runProperties) {  
    BooleanDefaultTrue b = new BooleanDefaultTrue();  
    b.setVal(true);  
    runProperties.setI(b);  
}
 
开发者ID:vindell,项目名称:docx4j-template,代码行数:6,代码来源:Docx4j_创建表格_S5_Test.java


示例20: setPageBreakBefore

import org.docx4j.wml.BooleanDefaultTrue; //导入依赖的package包/类
private void setPageBreakBefore(final P paragraph) {
	final BooleanDefaultTrue pageBreakBefore = this.wmlObjectFactory.createBooleanDefaultTrue();
	pageBreakBefore.setVal(true);
	paragraph.getPPr().setPageBreakBefore(pageBreakBefore);
}
 
开发者ID:mizitch,项目名称:story-inspector,代码行数:6,代码来源:DocXReportSummaryWriter.java



注:本文中的org.docx4j.wml.BooleanDefaultTrue类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SuggestedFix类代码示例发布时间:2022-05-23
下一篇:
Java NamedRunnable类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap