/** * get a table by its CTTbl-Object * * @see org.apache.poi.xwpf.usermodel.IBody#getTable(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl) */ public XWPFTable getTable(CTTbl ctTable) { for (int i = 0; i < tables.size(); i++) { if (getTables().get(i).getCTTbl() == ctTable) return getTables().get(i); } return null; }
private void init() { List<XWPFTable> tables = this.getTables(); if (null == tables) return; else allTables.addAll(tables); List<XWPFTableRow> rows = null; List<XWPFTableCell> cells = null; List<XWPFTable> cellTables = null; for (XWPFTable table : tables) { rows = table.getRows(); if (null == rows) continue; for (XWPFTableRow row : rows) { cells = row.getTableCells(); if (null == cells) continue; for (XWPFTableCell cell : cells) { cellTables = cell.getTables(); if (null != cellTables) allTables.addAll(cellTables); } } } }
void visitTable(XWPFTable table) { if (null == table) return; List<XWPFTableRow> rows = table.getRows(); if (null == rows) return; for (XWPFTableRow row : rows) { List<XWPFTableCell> cells = row.getTableCells(); if (null == cells) continue; for (XWPFTableCell cell : cells) { visitParagraphs(cell.getParagraphs()); visitTables(cell.getTables()); } } }
/** * get a table by its CTTbl-Object * @see org.apache.poi.xwpf.usermodel.IBody#getTable(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl) */ public XWPFTable getTable(CTTbl ctTable) { for(int i=0; i<tables.size(); i++){ if(getTables().get(i).getCTTbl() == ctTable) return getTables().get(i); } return null; }
/** * get a table by its CTTbl-Object * * @see org.apache.poi.xwpf.usermodel.IBody#getTable(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl) */ public XWPFTable getTable(CTTbl ctTable) { for (int i = 0; i < tables.size(); i++) { if (getTables().get(i).getCTTbl() == ctTable) return getTables().get(i); } return null; }