org.docx4j.wml.TrPr Java Examples

The following examples show how to use org.docx4j.wml.TrPr. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WmlElementUtils.java    From docx4j-template with Apache License 2.0 5 votes vote down vote up
/**
 * @Description:设置tr高度
 */
public static void setTrHeight(Tr tr, String heigth) {
    TrPr trPr = getTrPr(tr);
    CTHeight ctHeight = new CTHeight();
    ctHeight.setVal(new BigInteger(heigth));
    TrHeight trHeight = new TrHeight(ctHeight);
    trHeight.set(trPr);
}
 
Example #2
Source File: Docx4j_工具类_S3_Test.java    From docx4j-template with Apache License 2.0 5 votes vote down vote up
/**
 * @Description:设置tr高度
 */
public void setTrHeight(Tr tr, String heigth) {
    TrPr trPr = getTrPr(tr);
    CTHeight ctHeight = new CTHeight();
    ctHeight.setVal(new BigInteger(heigth));
    TrHeight trHeight = new TrHeight(ctHeight);
    trHeight.set(trPr);
}
 
Example #3
Source File: Docx4J_例子2.java    From docx4j-template with Apache License 2.0 5 votes vote down vote up
public void setTableTrHeight(ObjectFactory factory, Tr tr, String heigth) {
	TrPr trPr = tr.getTrPr();
	if (trPr == null) {
		trPr = factory.createTrPr();
	}
	CTHeight ctHeight = new CTHeight();
	ctHeight.setVal(new BigInteger(heigth));
	TrHeight trHeight = new TrHeight(ctHeight);
	trHeight.set(trPr);
	tr.setTrPr(trPr);
}
 
Example #4
Source File: Docx4J_简单例子2.java    From docx4j-template with Apache License 2.0 5 votes vote down vote up
public void setTableTrHeight(ObjectFactory factory,Tr tr,String heigth){  
    TrPr trPr=tr.getTrPr();  
    if(trPr==null){  
        trPr=factory.createTrPr();  
    }  
    CTHeight ctHeight=new CTHeight();  
    ctHeight.setVal(new BigInteger(heigth));  
    TrHeight trHeight=new TrHeight(ctHeight);  
    trHeight.set(trPr);  
    tr.setTrPr(trPr);  
}
 
Example #5
Source File: SessionAwareAbstractTableWriter.java    From docx-html-editor with GNU Affero General Public License v3.0 5 votes vote down vote up
protected void createRowProperties(List<Property> properties, TrPr trPr, boolean includeDefaultHeight) {
JAXBElement<CTHeight> trHeight = (trPr != null ? 
			(JAXBElement<CTHeight>)getElement(trPr.getCnfStyleOrDivIdOrGridBefore(), "trHeight") : 
			null);
	if (trHeight != null) {
		properties.add(new TrHeight(trHeight.getValue()));
	}
}
 
Example #6
Source File: FOExporterVisitorGenerator.java    From docx4j-export-FO with Apache License 2.0 4 votes vote down vote up
protected static void createFoAttributes(TrPr trPr, Element foBlockElement){
	if (trPr == null) {
		return;
	}
	applyFoAttributes(PropertyFactory.createProperties(trPr), foBlockElement);
}
 
Example #7
Source File: XsltFOFunctions.java    From docx4j-export-FO with Apache License 2.0 4 votes vote down vote up
private static void createFoAttributes(TrPr trPr, Element foBlockElement){
	if (trPr == null) {
		return;
	}
	applyFoAttributes(PropertyFactory.createProperties(trPr), foBlockElement);
}
 
Example #8
Source File: RoundtripXHTMLImporter.java    From docx-html-editor with GNU Affero General Public License v3.0 2 votes vote down vote up
@Override
  protected void setupTrPr(org.docx4j.org.xhtmlrenderer.newtable.TableRowBox trBox, Tr tr) {

/*
 * Reinstate
 * 
 * 	context.getWmlPackage().setUserData(rowId+"#Pr", trPr );
	context.getWmlPackage().setUserData(rowId+"#PrEx", tblPrEx );
	
	as set by SessionAwareAbstractTableWriter
	
 */

String id = trBox.getElement().getAttribute("id");

if (id==null ) {
	log.debug("no id on tr " );
	
} else {
	log.debug("processing tr with id " + id);

	// TrPr
	Object o = wordMLPackage.getUserData(id+"#Pr");
	if (o==null) {
		
		log.debug("no #Pr UserData on tr with id " + id);
	
	} else {
		tr.setTrPr((TrPr)o);
	}

	Object o2 = wordMLPackage.getUserData(id+"#PrEx");
	if (o2==null) {
		
		log.debug("no #PrEx UserData on tr with id " + id);
	
	} else {
		tr.setTblPrEx((CTTblPrEx)o2);
	}
	
	if (o!=null || o2 !=null) return;
	
}

super.setupTrPr( trBox,  tr);		
  }
 
Example #9
Source File: SessionAwareAbstractTableWriter.java    From docx-html-editor with GNU Affero General Public License v3.0 2 votes vote down vote up
protected void createCellProperties(List<Property> properties, TrPr trPr) {
	
}