/** * adds a new TableCell at the end of this tableRow */ public XWPFTableCell addNewTableCell() { CTTc cell = ctRow.addNewTc(); XWPFTableCell tableCell = new XWPFTableCell(cell, this, table.getBody()); tableCells.add(tableCell); return tableCell; }
/** * create a new XWPFTableCell and add it to the tableCell-list of this tableRow * * @return the newly created XWPFTableCell */ public XWPFTableCell createCell() { XWPFTableCell tableCell = new XWPFTableCell(ctRow.addNewTc(), this, table.getBody()); tableCells.add(tableCell); return tableCell; }
/** * create and return a list of all XWPFTableCell * who belongs to this row * * @return a list of {@link XWPFTableCell} */ public List<XWPFTableCell> getTableCells() { if (tableCells == null) { List<XWPFTableCell> cells = new ArrayList<>(); for (CTTc tableCell : ctRow.getTcArray()) { cells.add(new XWPFTableCell(tableCell, this, table.getBody())); } //TODO: it is possible to have an SDT that contains a cell in within a row //need to modify this code so that it pulls out SDT wrappers around cells, too. this.tableCells = cells; } return tableCells; }
/** * create and return a list of all XWPFTableCell * who belongs to this row * * @return a list of {@link XWPFTableCell} */ public List<ICell> getTableICells() { List<ICell> cells = new ArrayList<>(); //Can't use ctRow.getTcList because that only gets table cells //Can't use ctRow.getSdtList because that only gets sdts that are at cell level XmlCursor cursor = ctRow.newCursor(); cursor.selectPath("./*"); while (cursor.toNextSelection()) { XmlObject o = cursor.getObject(); if (o instanceof CTTc) { cells.add(new XWPFTableCell((CTTc) o, this, table.getBody())); } else if (o instanceof CTSdtCell) { cells.add(new XWPFSDTCell((CTSdtCell) o, this, table.getBody())); } } cursor.dispose(); return cells; }
/** * adds a new TableCell at the end of this tableRow */ public XWPFTableCell addNewTableCell(){ CTTc cell = ctRow.addNewTc(); XWPFTableCell tableCell = new XWPFTableCell(cell, this, table.getBody()); tableCells.add(tableCell); return tableCell; }
/** * adds a new TableCell at the end of this tableRow */ public XWPFTableCell addNewTableCell() { CTTc cell = ctRow.addNewTc(); XWPFTableCell tableCell = new XWPFTableCell(cell, this, table.getBody()); tableCells.add(tableCell); return tableCell; }
/** * create a new XWPFTableCell and add it to the tableCell-list of this tableRow * @return the newly created XWPFTableCell */ public XWPFTableCell createCell() { XWPFTableCell tableCell = new XWPFTableCell(ctRow.addNewTc(), this, table.getBody()); tableCells.add(tableCell); return tableCell; }
/** * create a new XWPFTableCell and add it to the tableCell-list of this tableRow * * @return the newly created XWPFTableCell */ public XWPFTableCell createCell() { XWPFTableCell tableCell = new XWPFTableCell(ctRow.addNewTc(), this, table.getBody()); tableCells.add(tableCell); return tableCell; }
/** * create and return a list of all XWPFTableCell * who belongs to this row * @return a list of {@link XWPFTableCell} */ public List<XWPFTableCell> getTableCells(){ if(tableCells == null){ List<XWPFTableCell> cells = new ArrayList<XWPFTableCell>(); for (CTTc tableCell : ctRow.getTcList()) { cells.add(new XWPFTableCell(tableCell, this, table.getBody())); } this.tableCells = cells; } return tableCells; }
/** * create and return a list of all XWPFTableCell * who belongs to this row * * @return a list of {@link XWPFTableCell} */ public List<XWPFTableCell> getTableCells() { if (tableCells == null) { List<XWPFTableCell> cells = new ArrayList<>(); for (CTTc tableCell : ctRow.getTcArray()) { cells.add(new XWPFTableCell(tableCell, this, table.getBody())); } //TODO: it is possible to have an SDT that contains a cell in within a row //need to modify this code so that it pulls out SDT wrappers around cells, too. this.tableCells = cells; } return tableCells; }
/** * create and return a list of all XWPFTableCell * who belongs to this row * * @return a list of {@link XWPFTableCell} */ public List<ICell> getTableICells() { List<ICell> cells = new ArrayList<>(); //Can't use ctRow.getTcList because that only gets table cells //Can't use ctRow.getSdtList because that only gets sdts that are at cell level XmlCursor cursor = ctRow.newCursor(); cursor.selectPath("./*"); while (cursor.toNextSelection()) { XmlObject o = cursor.getObject(); if (o instanceof CTTc) { cells.add(new XWPFTableCell((CTTc) o, this, table.getBody())); } else if (o instanceof CTSdtCell) { cells.add(new XWPFSDTCell((CTSdtCell) o, this, table.getBody())); } } cursor.dispose(); return cells; }
for ( CTTc ctTc : tcList ) XWPFTableCell cell = new XWPFTableCell( ctTc, row, row.getTable().getBody() ); cellIndex = getCellIndex( cellIndex, cell ); lastCol = ( cellIndex == nbColumns );
for ( CTTc ctTc : tcList ) XWPFTableCell cell = new XWPFTableCell( ctTc, row, row.getTable().getBody() ); cellIndex = getCellIndex( cellIndex, cell ); lastCol = ( cellIndex == nbColumns );
for ( CTTc ctTc : tcList ) XWPFTableCell cell = new XWPFTableCell( ctTc, row, row.getTable().getBody() ); cellIndex = getCellIndex( cellIndex, cell ); lastCol = ( cellIndex == nbColumns );
for ( CTTc ctTc : tcList ) XWPFTableCell cell = new XWPFTableCell( ctTc, row, row.getTable().getBody() ); cellIndex = getCellIndex( cellIndex, cell ); lastCol = ( cellIndex == nbColumns - 1 );
for ( CTTc ctTc : tcList ) XWPFTableCell cell = new XWPFTableCell( ctTc, row, row.getTable().getBody() ); cellIndex = getCellIndex( cellIndex, cell ); lastCol = ( cellIndex == nbColumns - 1 );