Modifier and Type | Class and Description |
---|---|
static class |
XWPFTableCell.XWPFVertAlign |
Modifier and Type | Field and Description |
---|---|
protected java.util.List<IBodyElement> |
bodyElements |
protected java.util.List<XWPFParagraph> |
paragraphs |
protected IBody |
part |
protected java.util.List<XWPFTable> |
tables |
Constructor and Description |
---|
XWPFTableCell(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTc cell,
XWPFTableRow tableRow,
IBody part)
If a table cell does not include at least one block-level element, then this document shall be considered corrupt
|
Modifier and Type | Method and Description |
---|---|
XWPFParagraph |
addParagraph()
Add a Paragraph to this Table Cell
|
void |
addParagraph(XWPFParagraph p)
add a Paragraph to this TableCell
|
java.util.List<IBodyElement> |
getBodyElements()
returns an Iterator with paragraphs and tables
|
java.lang.String |
getColor()
Get cell color.
|
org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTc |
getCTTc() |
XWPFParagraph |
getParagraph(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP p)
Returns the paragraph corresponding to the provided
CTP . |
XWPFParagraph |
getParagraphArray(int pos)
Returns the paragraph that of position pos
|
java.util.List<XWPFParagraph> |
getParagraphs()
returns a list of paragraphs
|
POIXMLDocumentPart |
getPart()
get the to which the TableCell belongs
|
BodyType |
getPartType()
get the PartType of the body, for example
DOCUMENT, HEADER, FOOTER, FOOTNOTE,
|
XWPFTable |
getTable(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl ctTable)
get a table by its CTTbl-Object
|
XWPFTable |
getTableArray(int pos)
Returns the table at position pos
|
XWPFTableCell |
getTableCell(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTc cell)
get the TableCell which belongs to the TableCell
|
XWPFTableRow |
getTableRow() |
java.util.List<XWPFTable> |
getTables()
Return the table(s) that holds the text
of the IBodyPart, for complex cases
where a paragraph isn't used.
|
protected org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTcPr |
getTcPr()
Get the cell properties for the cell.
|
java.lang.String |
getText() |
java.lang.String |
getTextRecursively()
extracts all text recursively through embedded tables and embedded SDTs
|
XWPFTableCell.XWPFVertAlign |
getVerticalAlignment()
Get the vertical alignment of the cell.
|
int |
getWidth() |
double |
getWidthDecimal()
Get the table width as a decimal value.
|
TableWidthType |
getWidthType()
Get the width type for the table, as an
STTblWidth.Enum value. |
XWPFDocument |
getXWPFDocument()
Return XWPFDocument
|
XWPFParagraph |
insertNewParagraph(org.apache.xmlbeans.XmlCursor cursor)
add a new paragraph at position of the cursor
|
XWPFTable |
insertNewTbl(org.apache.xmlbeans.XmlCursor cursor)
inserts a new Table at the cursor position.
|
void |
insertTable(int pos,
XWPFTable table)
inserts an existing XWPFTable to the arrays bodyElements and tables
|
void |
removeParagraph(int pos)
removes a paragraph of this tablecell
|
void |
removeTable(int pos)
removes a table of this table cell
|
void |
setColor(java.lang.String rgbStr)
Set cell color.
|
void |
setParagraph(XWPFParagraph p) |
void |
setText(java.lang.String text) |
void |
setVerticalAlignment(XWPFTableCell.XWPFVertAlign vAlign)
Set the vertical alignment of the cell.
|
void |
setWidth(java.lang.String widthValue)
Set the width to the value "auto", an integer value (20ths of a point), or a percentage ("nn.nn%").
|
void |
setWidthType(TableWidthType widthType)
Set the width value type for the table.
|
protected java.util.List<XWPFParagraph> paragraphs
protected java.util.List<XWPFTable> tables
protected java.util.List<IBodyElement> bodyElements
protected IBody part
public XWPFTableCell(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTc cell, XWPFTableRow tableRow, IBody part)
@Internal public org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTc getCTTc()
public java.util.List<IBodyElement> getBodyElements()
getBodyElements
in interface IBody
IBody.getBodyElements()
public void setParagraph(XWPFParagraph p)
public java.util.List<XWPFParagraph> getParagraphs()
getParagraphs
in interface IBody
public XWPFParagraph addParagraph()
public void addParagraph(XWPFParagraph p)
p
- the paragraph which has to be addedpublic void removeParagraph(int pos)
pos
- The position in the list of paragraphs, 0-basedpublic XWPFParagraph getParagraph(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP p)
IBody
CTP
.getParagraph
in interface IBody
p
- is instance of CTP and is searching for an XWPFParagraphCTP
, or null
if there is no corresponding paragraph in
this body.public XWPFTableRow getTableRow()
public java.lang.String getColor()
public void setColor(java.lang.String rgbStr)
rgbStr
- - the desired cell color, in the hex form "RRGGBB".public XWPFTableCell.XWPFVertAlign getVerticalAlignment()
null
if no vertical alignment is set.public void setVerticalAlignment(XWPFTableCell.XWPFVertAlign vAlign)
vAlign
- - the desired alignment enum valuepublic XWPFParagraph insertNewParagraph(org.apache.xmlbeans.XmlCursor cursor)
insertNewParagraph
in interface IBody
cursor
- The XmlCursor structure created with XmlBeanspublic XWPFTable insertNewTbl(org.apache.xmlbeans.XmlCursor cursor)
IBody
insertNewTbl
in interface IBody
public XWPFParagraph getParagraphArray(int pos)
IBody
getParagraphArray
in interface IBody
IBody.getParagraphArray(int)
public POIXMLDocumentPart getPart()
getPart
in interface IBody
IBody.getPart()
public BodyType getPartType()
IBody
getPartType
in interface IBody
IBody.getPartType()
public XWPFTable getTable(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl ctTable)
getTable
in interface IBody
IBody.getTable(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl)
public XWPFTable getTableArray(int pos)
IBody
getTableArray
in interface IBody
IBody.getTableArray(int)
public java.util.List<XWPFTable> getTables()
IBody
getTables
in interface IBody
IBody.getTables()
public void insertTable(int pos, XWPFTable table)
insertTable
in interface IBody
IBody.insertTable(int, org.apache.poi.xwpf.usermodel.XWPFTable)
public void removeTable(int pos)
pos
- The position in the list of tables, 0-basedpublic java.lang.String getText()
public void setText(java.lang.String text)
public java.lang.String getTextRecursively()
public XWPFTableCell getTableCell(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTc cell)
getTableCell
in interface IBody
public XWPFDocument getXWPFDocument()
IBody
getXWPFDocument
in interface IBody
public double getWidthDecimal()
If the width type is DXA or AUTO, then the value will always have a fractional part of zero (because these values are really integers). If the with type is percentage, then value may have a non-zero fractional part.
public TableWidthType getWidthType()
STTblWidth.Enum
value.
A table width can be specified as an absolute measurement (an integer
number of twips), a percentage, or the value "AUTO".public void setWidth(java.lang.String widthValue)
widthValue
- String matching one of "auto", [0-9]+, or [0-9]+(\.[0-9]+)%.protected org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTcPr getTcPr()
public void setWidthType(TableWidthType widthType)
If the width type is changed from the current type and the currently-set value is not consistent with the new width type, the value is reset to the default value for the specified width type.
widthType
- Width typepublic int getWidth()
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.