use of org.openxmlformats.schemas.wordprocessingml.x2006.main.STBorder in project poi by apache.
the class TestXWPFTable method testSetGetHBorders.
public void testSetGetHBorders() {
// instantiate the following classes so they'll get picked up by
// the XmlBean process and added to the jar file. they are required
// for the following XWPFTable methods.
CTTblBorders cttb = CTTblBorders.Factory.newInstance();
assertNotNull(cttb);
STBorder stb = STBorder.Factory.newInstance();
assertNotNull(stb);
// create a table
XWPFDocument doc = new XWPFDocument();
CTTbl ctTable = CTTbl.Factory.newInstance();
XWPFTable table = new XWPFTable(ctTable, doc);
// set inside horizontal border
table.setInsideHBorder(XWPFBorderType.SINGLE, 4, 0, "FF0000");
// get inside horizontal border components
int s = table.getInsideHBorderSize();
assertEquals(4, s);
int sp = table.getInsideHBorderSpace();
assertEquals(0, sp);
String clr = table.getInsideHBorderColor();
assertEquals("FF0000", clr);
XWPFBorderType bt = table.getInsideHBorderType();
assertEquals(XWPFBorderType.SINGLE, bt);
}
Aggregations