* returns an Iterator with paragraphs and tables
* @see org.apache.poi.xwpf.usermodel.IBody#getBodyElements()
*/
+ @Override
public List<IBodyElement> getBodyElements() {
return Collections.unmodifiableList(bodyElements);
}
/**
* @see org.apache.poi.xwpf.usermodel.IBody#getParagraphs()
*/
+ @Override
public List<XWPFParagraph> getParagraphs(){
return Collections.unmodifiableList(paragraphs);
}
/**
* @see org.apache.poi.xwpf.usermodel.IBody#getTables()
*/
+ @Override
public List<XWPFTable> getTables(){
return Collections.unmodifiableList(tables);
}
/**
* @see org.apache.poi.xwpf.usermodel.IBody#getTableArray(int)
*/
+ @Override
public XWPFTable getTableArray(int pos) {
if (pos > 0 && pos < tables.size()){
return tables.get(pos);
* @return the {@link XWPFParagraph} object representing the newly inserted
* CTP object
*/
+ @Override
public XWPFParagraph insertNewParagraph(XmlCursor cursor) {
if (isCursorInBody(cursor)) {
String uri = CTP.type.getName().getNamespaceURI();
return null;
}
+ @Override
public XWPFTable insertNewTbl(XmlCursor cursor) {
if (isCursorInBody(cursor)) {
String uri = CTTbl.type.getName().getNamespaceURI();
/**
* Enable or disable revision tracking.
*
- * @param <code>true</code> to turn on revision tracking, <code>false</code> to turn off revision tracking
+ * @param enable <code>true</code> to turn on revision tracking, <code>false</code> to turn off revision tracking
*/
public void setTrackRevisions(boolean enable) {
settings.setTrackRevisions(enable);
* @param pos
* @param table
*/
+ @Override
public void insertTable(int pos, XWPFTable table) {
bodyElements.add(pos, table);
int i;
* @param p
* @return the paragraph with the CTP class p
*/
+ @Override
public XWPFParagraph getParagraph(CTP p) {
for (int i = 0; i < getParagraphs().size(); i++) {
if (getParagraphs().get(i).getCTP() == p) {
* @see org.apache.poi.xwpf.usermodel.IBody#getTable(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl)
* @return a table by its CTTbl-Object or null
*/
+ @Override
public XWPFTable getTable(CTTbl ctTbl) {
for (int i = 0; i < tables.size(); i++) {
if (getTables().get(i).getCTTbl() == ctTbl) {
* Returns the paragraph that of position pos
* @see org.apache.poi.xwpf.usermodel.IBody#getParagraphArray(int)
*/
+ @Override
public XWPFParagraph getParagraphArray(int pos) {
if (pos >= 0 && pos < paragraphs.size()) {
return paragraphs.get(pos);
* belongs.
* @see org.apache.poi.xwpf.usermodel.IBody#getPart()
*/
+ @Override
public POIXMLDocumentPart getPart() {
return this;
}
*
* @see org.apache.poi.xwpf.usermodel.IBody#getPartType()
*/
+ @Override
public BodyType getPartType() {
return BodyType.DOCUMENT;
}
* get the TableCell which belongs to the TableCell
* @param cell
*/
+ @Override
public XWPFTableCell getTableCell(CTTc cell) {
XmlCursor cursor = cell.newCursor();
cursor.toParent();
return tableRow.getTableCell(cell);
}
+ @Override
public XWPFDocument getXWPFDocument() {
return this;
}