当前位置: 首页>>代码示例>>Java>>正文


Java CTBorder类代码示例

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


CTBorder类属于org.docx4j.wml包,在下文中一共展示了CTBorder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addBorders

import org.docx4j.wml.CTBorder; //导入依赖的package包/类
/** 
 *  本方法给表格添加边框 
 */  
public void addBorders(Tbl table) {  
    table.setTblPr(new TblPr());  
    CTBorder border = new CTBorder();  
    border.setColor("auto");  
    border.setSz(new BigInteger("4"));  
    border.setSpace(new BigInteger("0"));  
    border.setVal(STBorder.SINGLE);  
   
    TblBorders borders = new TblBorders();  
    borders.setBottom(border);  
    borders.setLeft(border);  
    borders.setRight(border);  
    borders.setTop(border);  
    borders.setInsideH(border);  
    borders.setInsideV(border);  
    table.getTblPr().setTblBorders(borders);  
}
 
开发者ID:vindell,项目名称:docx4j-template,代码行数:21,代码来源:WordprocessingMLPackageRender.java

示例2: setParagraghBorders

import org.docx4j.wml.CTBorder; //导入依赖的package包/类
/**
 * @Description: 设置段落边框样式
 */
public void setParagraghBorders(P p, CTBorder topBorder,
        CTBorder bottomBorder, CTBorder leftBorder, CTBorder rightBorder) {
    PPr ppr = getPPr(p);
    PBdr pBdr = new PBdr();
    if (topBorder != null) {
        pBdr.setTop(topBorder);
    }
    if (bottomBorder != null) {
        pBdr.setBottom(bottomBorder);
    }
    if (leftBorder != null) {
        pBdr.setLeft(leftBorder);
    }
    if (rightBorder != null) {
        pBdr.setRight(rightBorder);
    }
    ppr.setPBdr(pBdr);
}
 
开发者ID:vindell,项目名称:docx4j-template,代码行数:22,代码来源:Docx4j_工具类_S3_Test.java

示例3: addRPrBorderStyle

import org.docx4j.wml.CTBorder; //导入依赖的package包/类
/**
 * @Description: 设置字符边框
 */
public void addRPrBorderStyle(RPr runProperties, String size,
        STBorder bordType, String space, String color) {
    CTBorder value = new CTBorder();
    if (StringUtils.isNotBlank(color)) {
        value.setColor(color);
    }
    if (StringUtils.isNotBlank(size)) {
        value.setSz(new BigInteger(size));
    }
    if (StringUtils.isNotBlank(space)) {
        value.setSpace(new BigInteger(space));
    }
    if (bordType != null) {
        value.setVal(bordType);
    }
    runProperties.setBdr(value);
}
 
开发者ID:vindell,项目名称:docx4j-template,代码行数:21,代码来源:Docx4j_工具类_S3_Test.java

示例4: setDocumentBorders

import org.docx4j.wml.CTBorder; //导入依赖的package包/类
/**
 * @Description: 设置页面边框
 */
public void setDocumentBorders(WordprocessingMLPackage wordPackage,
        ObjectFactory factory, CTBorder top, CTBorder right,
        CTBorder bottom, CTBorder left) {
    SectPr sectPr = getDocSectPr(wordPackage);
    PgBorders pgBorders = sectPr.getPgBorders();
    if (pgBorders == null) {
        pgBorders = factory.createSectPrPgBorders();
        sectPr.setPgBorders(pgBorders);
    }
    if (top != null) {
        pgBorders.setTop(top);
    }
    if (right != null) {
        pgBorders.setRight(right);
    }
    if (bottom != null) {
        pgBorders.setBottom(bottom);
    }
    if (left != null) {
        pgBorders.setLeft(left);
    }
}
 
开发者ID:vindell,项目名称:docx4j-template,代码行数:26,代码来源:Docx4j_工具类_S3_Test.java

示例5: addBorders

import org.docx4j.wml.CTBorder; //导入依赖的package包/类
/**
 *  本方法为表格添加边框
 */
private static void addBorders(Tbl table) {
    table.setTblPr(new TblPr());
    CTBorder border = new CTBorder();
    border.setColor("auto");
    border.setSz(new BigInteger("4"));
    border.setSpace(new BigInteger("0"));
    border.setVal(STBorder.SINGLE);
 
    TblBorders borders = new TblBorders();
    borders.setBottom(border);
    borders.setLeft(border);
    borders.setRight(border);
    borders.setTop(border);
    borders.setInsideH(border);
    borders.setInsideV(border);
    table.getTblPr().setTblBorders(borders);
}
 
开发者ID:vindell,项目名称:docx4j-template,代码行数:21,代码来源:TableWithMergedCells.java

示例6: addBorders

import org.docx4j.wml.CTBorder; //导入依赖的package包/类
public void addBorders(Tbl table, String borderSize) {
	table.setTblPr(new TblPr());
	CTBorder border = new CTBorder();
	border.setColor("auto");
	border.setSz(new BigInteger(borderSize));
	border.setSpace(new BigInteger("0"));
	border.setVal(STBorder.SINGLE);
	TblBorders borders = new TblBorders();
	borders.setBottom(border);
	borders.setLeft(border);
	borders.setRight(border);
	borders.setTop(border);
	borders.setInsideH(border);
	borders.setInsideV(border);
	table.getTblPr().setTblBorders(borders);
}
 
开发者ID:vindell,项目名称:docx4j-template,代码行数:17,代码来源:Docx4J_例子2.java

示例7: addBorders

import org.docx4j.wml.CTBorder; //导入依赖的package包/类
public void addBorders(Tbl table, String borderSize) {  
    table.setTblPr(new TblPr());  
    CTBorder border = new CTBorder();  
    border.setColor("auto");  
    border.setSz(new BigInteger(borderSize));  
    border.setSpace(new BigInteger("0"));  
    border.setVal(STBorder.SINGLE);  
    TblBorders borders = new TblBorders();  
    borders.setBottom(border);  
    borders.setLeft(border);  
    borders.setRight(border);  
    borders.setTop(border);  
    borders.setInsideH(border);  
    borders.setInsideV(border);  
    table.getTblPr().setTblBorders(borders);  
}
 
开发者ID:vindell,项目名称:docx4j-template,代码行数:17,代码来源:Docx4J_简单例子2.java

示例8: addBorders

import org.docx4j.wml.CTBorder; //导入依赖的package包/类
/**
 *  本方法给表格添加边框
 */
private static void addBorders(Tbl table) {
    table.setTblPr(new TblPr());
    CTBorder border = new CTBorder();
    border.setColor("auto");
    border.setSz(new BigInteger("4"));
    border.setSpace(new BigInteger("0"));
    border.setVal(STBorder.SINGLE);
 
    TblBorders borders = new TblBorders();
    borders.setBottom(border);
    borders.setLeft(border);
    borders.setRight(border);
    borders.setTop(border);
    borders.setInsideH(border);
    borders.setInsideV(border);
    table.getTblPr().setTblBorders(borders);
}
 
开发者ID:vindell,项目名称:docx4j-template,代码行数:21,代码来源:TableWithStyledContent.java

示例9: addBorders

import org.docx4j.wml.CTBorder; //导入依赖的package包/类
private static void addBorders(Tbl table) {
    table.setTblPr(new TblPr());
    CTBorder border = new CTBorder();
    border.setColor("auto");
    border.setSz(new BigInteger("4"));
    border.setSpace(new BigInteger("0"));
    border.setVal(STBorder.SINGLE);
 
    TblBorders borders = new TblBorders();
    borders.setBottom(border);
    borders.setLeft(border);
    borders.setRight(border);
    borders.setTop(border);
    borders.setInsideH(border);
    borders.setInsideV(border);
    table.getTblPr().setTblBorders(borders);
}
 
开发者ID:vindell,项目名称:docx4j-template,代码行数:18,代码来源:TableWithBorders.java

示例10: createHorizontalLine

import org.docx4j.wml.CTBorder; //导入依赖的package包/类
public static P createHorizontalLine() {

		org.docx4j.wml.ObjectFactory wmlObjectFactory = new org.docx4j.wml.ObjectFactory();

		// Create object for p
		P p = wmlObjectFactory.createP();
		// Create object for pPr
		PPr ppr = wmlObjectFactory.createPPr();
		p.setPPr(ppr);
		// Create object for pBdr
		PPrBase.PBdr pprbasepbdr = wmlObjectFactory.createPPrBasePBdr();
		ppr.setPBdr(pprbasepbdr);
		// Create object for bottom
		CTBorder border = wmlObjectFactory.createCTBorder();
		pprbasepbdr.setBottom(border);
		border.setVal(org.docx4j.wml.STBorder.SINGLE);
		border.setSz(BigInteger.valueOf(6));
		border.setColor("auto");
		border.setSpace(BigInteger.valueOf(1));

		return p;
	}
 
开发者ID:ShapeChange,项目名称:ShapeChange,代码行数:23,代码来源:DocxUtil.java

示例11: appendNoneBordersAndShading

import org.docx4j.wml.CTBorder; //导入依赖的package包/类
protected void appendNoneBordersAndShading(List<Property> tableProperties) {
CTBorder ctBrdr = null;
CTShd shd = Context.getWmlObjectFactory().createCTShd();
	ctBrdr = Context.getWmlObjectFactory().createCTBorder();
	ctBrdr.setVal(STBorder.NONE);
	tableProperties.add(new BorderLeft(ctBrdr));
	ctBrdr = Context.getWmlObjectFactory().createCTBorder();
	ctBrdr.setVal(STBorder.NONE);
	tableProperties.add(new BorderRight(ctBrdr));
	ctBrdr = Context.getWmlObjectFactory().createCTBorder();
	ctBrdr.setVal(STBorder.NONE);
	tableProperties.add(new BorderTop(ctBrdr));
	ctBrdr = Context.getWmlObjectFactory().createCTBorder();
	ctBrdr.setVal(STBorder.NONE);
	tableProperties.add(new BorderBottom(ctBrdr));
	shd.setColor("auto");
	shd.setFill("auto");
	shd.setVal(STShd.CLEAR);
	tableProperties.add(new Shading(shd));
}
 
开发者ID:plutext,项目名称:docx-html-editor,代码行数:21,代码来源:SessionAwareAbstractTableWriter.java

示例12: addBorders

import org.docx4j.wml.CTBorder; //导入依赖的package包/类
/**
 * Add border to table
 * @param table
 */
private static void addBorders(Tbl table) {
	table.setTblPr(new TblPr());
	CTBorder border = new CTBorder();
	border.setColor("auto");
	border.setSz(new BigInteger("4"));
	border.setSpace(new BigInteger("0"));
	border.setVal(STBorder.SINGLE);
	TblBorders borders = new TblBorders();
	borders.setBottom(border);
	borders.setLeft(border);
	borders.setRight(border);
	borders.setTop(border);
	borders.setInsideH(border);
	borders.setInsideV(border);
	table.getTblPr().setTblBorders(borders);
}
 
开发者ID:trackplus,项目名称:Genji,代码行数:21,代码来源:TableWithBorders.java

示例13: ctBorder

import org.docx4j.wml.CTBorder; //导入依赖的package包/类
public static CTBorder ctBorder(String color,BigInteger border_width,BigInteger border_space) {
    CTBorder border = new CTBorder();
    border.setColor(color);
    border.setSz(border_width);
    border.setSpace(border_space);
    border.setVal(STBorder.SINGLE);
    return border;
}
 
开发者ID:vindell,项目名称:docx4j-template,代码行数:9,代码来源:BorderUtils.java

示例14: tblBorders

import org.docx4j.wml.CTBorder; //导入依赖的package包/类
public static TblBorders tblBorders(CTBorder border) {
    TblBorders borders = new TblBorders();
    borders.setBottom(border);
    borders.setLeft(border);
    borders.setRight(border);
    borders.setTop(border);
    borders.setInsideH(border);
    borders.setInsideV(border);
    return borders;
}
 
开发者ID:vindell,项目名称:docx4j-template,代码行数:11,代码来源:BorderUtils.java

示例15: main

import org.docx4j.wml.CTBorder; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
	Docx4J_例子2 t = new Docx4J_例子2();
	WordprocessingMLPackage wordMLPackage = t
			.createWordprocessingMLPackage();
	MainDocumentPart mp = wordMLPackage.getMainDocumentPart();
	ObjectFactory factory = Context.getWmlObjectFactory();

	Relationship relationship = t.createHeaderPart(wordMLPackage, mp,
			factory, false, "3");
	relationship = t.createTextHeaderPart(wordMLPackage, mp, factory,
			"我是页眉,独乐乐不如众乐乐", true, "3", JcEnumeration.CENTER);
	t.addParagraphTest(wordMLPackage, mp, factory);
	t.addPageBreak(wordMLPackage, factory, STBrType.PAGE);
	t.createHeaderReference(wordMLPackage, mp, factory, relationship);
	t.createNormalTableTest(wordMLPackage, mp, factory);
	t.addPageBreak(wordMLPackage, factory, STBrType.TEXT_WRAPPING);
	t.createTableTest(wordMLPackage, mp, factory);
	t.addPageBreak(wordMLPackage, factory, STBrType.TEXT_WRAPPING);
	P paragraph=factory.createP();
	CTBorder topBorder=new CTBorder() ;
	topBorder.setSpace(new BigInteger("1"));
	topBorder.setSz(new BigInteger("2"));
	topBorder.setVal(STBorder.WAVE);
	t.createParagraghLine(wordMLPackage, mp, factory, paragraph, topBorder, topBorder, topBorder, topBorder);
	mp.addObject(paragraph);
	t.createHyperlink(wordMLPackage, mp, factory,paragraph,
			"mailto:[email protected]?subject=docx4j测试", "联系我","微软雅黑","24",JcEnumeration.CENTER);
	
	// 页脚
	// relationship = t.createFooterPart(wordMLPackage, mp, factory,
	// false,"3");
	// relationship = t.createTextFooterPart(wordMLPackage, mp,
	// factory,"我是页脚", true, "3", JcEnumeration.CENTER);
	relationship = t.createFooterPageNumPart(wordMLPackage, mp, factory,
			false, "3", JcEnumeration.CENTER);
	t.createFooterReference(wordMLPackage, mp, factory, relationship);
	t.saveWordPackage(wordMLPackage, new File(
			"f:/saveFile/temp/s7_simple.docx"));
}
 
开发者ID:vindell,项目名称:docx4j-template,代码行数:40,代码来源:Docx4J_例子2.java


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