use of org.openxmlformats.schemas.drawingml.x2006.main.CTTableCell in project poi by apache.
the class XSLFTableCell method prototype.
static CTTableCell prototype() {
CTTableCell cell = CTTableCell.Factory.newInstance();
CTTableCellProperties pr = cell.addNewTcPr();
pr.addNewLnL().addNewNoFill();
pr.addNewLnR().addNewNoFill();
pr.addNewLnT().addNewNoFill();
pr.addNewLnB().addNewNoFill();
return cell;
}
use of org.openxmlformats.schemas.drawingml.x2006.main.CTTableCell in project poi by apache.
the class XSLFTableRow method addCell.
public XSLFTableCell addCell() {
CTTableCell c = _row.addNewTc();
c.set(XSLFTableCell.prototype());
XSLFTableCell cell = new XSLFTableCell(c, _table);
_cells.add(cell);
if (_table.getNumberOfColumns() < _row.sizeOfTcArray()) {
_table.getCTTable().getTblGrid().addNewGridCol().setW(Units.toEMU(100.0));
}
_table.updateRowColIndexes();
return cell;
}
use of org.openxmlformats.schemas.drawingml.x2006.main.CTTableCell in project poi by apache.
the class XSLFTableCell method getCellProperties.
protected CTTableCellProperties getCellProperties(boolean create) {
if (_tcPr == null) {
CTTableCell cell = getCell();
_tcPr = cell.getTcPr();
if (_tcPr == null && create) {
_tcPr = cell.addNewTcPr();
}
}
return _tcPr;
}
use of org.openxmlformats.schemas.drawingml.x2006.main.CTTableCell in project poi by apache.
the class XSLFTableCell method getTextBody.
@Override
protected CTTextBody getTextBody(boolean create) {
CTTableCell cell = getCell();
CTTextBody txBody = cell.getTxBody();
if (txBody == null && create) {
txBody = cell.addNewTxBody();
XSLFAutoShape.initTextBody(txBody);
}
return txBody;
}
use of org.openxmlformats.schemas.drawingml.x2006.main.CTTableCell in project poi by apache.
the class TestXSLFTableRow method addCell.
/** copied from {@link TestXSLFTable#testCreate()} */
@Test
public void addCell() {
XSLFTableCell cell = row.addCell();
assertNotNull(cell);
assertNotNull(cell.getXmlObject());
// by default table cell has no borders
CTTableCell tc = (CTTableCell) cell.getXmlObject();
assertTrue(tc.getTcPr().getLnB().isSetNoFill());
assertTrue(tc.getTcPr().getLnT().isSetNoFill());
assertTrue(tc.getTcPr().getLnL().isSetNoFill());
assertTrue(tc.getTcPr().getLnR().isSetNoFill());
}
Aggregations