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
(向此 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 .
(返回与提供的 CTP 对应的段落。)
|
XWPFParagraph |
getParagraphArray(int pos)
Returns the paragraph that of position pos
(返回位置 pos 的段落)
|
java.util.List<XWPFParagraph> |
getParagraphs()
returns a list of paragraphs
(返回段落列表)
|
POIXMLDocumentPart |
getPart()
get the to which the TableCell belongs
(获取 TableCell 所属的)
|
BodyType |
getPartType()
get the PartType of the body, for example DOCUMENT, HEADER, FOOTER, FOOTNOTE,
(获取正文的 PartType,例如 DOCUMENT、HEADER、FOOTER、FOOTNOTE、)
|
XWPFTable |
getTable(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl ctTable)
get a table by its CTTbl-Object
(通过其 CTTbl-Object 获取表)
|
XWPFTable |
getTableArray(int pos)
Returns the table at position pos
(返回位置 pos 的表)
|
XWPFTableCell |
getTableCell(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTc cell)
get the TableCell which belongs to the TableCell
(获取属于 TableCell 的 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.
(对于不使用段落的复杂情况,返回包含 IBodyPart 文本的表。)
|
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
(通过嵌入式表格和嵌入式 SDT 递归提取所有文本)
|
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.
(获取表格的宽度类型,作为 STTblWidth.Enum 值。)
|
XWPFDocument |
getXWPFDocument()
Return XWPFDocument
(返回 XWPF 文档)
|
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
(将现有的 XWPFTable 插入到数组 bodyElements 和表中)
|
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%").
(将宽度设置为值“auto”、整数值(点的 20 分之一)或百分比(“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)
IBody.getBodyElements()
public void setParagraph(XWPFParagraph p)
public java.util.List<XWPFParagraph> getParagraphs()
getParagraphs
in interface
IBody
(接口 IBody 中的 getParagraphs)
public XWPFParagraph addParagraph()
public void addParagraph(XWPFParagraph p)
p
- the paragraph which has to be added
(p - 必须添加的段落)
public void removeParagraph(int pos)
pos
- The position in the list of paragraphs, 0-based
(pos - 段落列表中的位置,从 0 开始)
public XWPFParagraph getParagraph(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP p)
IBody
CTP
.
(返回与提供的 CTP 对应的段落。)
getParagraph
in interface
IBody
(接口 IBody 中的 getParagraph)
p
- is instance of CTP and is searching for an XWPFParagraph
(p - 是 CTP 的实例,正在搜索 XWPFParagraph)
CTP
, or
null
if there is no corresponding paragraph in this body.
(与 CTP 对应的段落,如果此正文中没有对应的段落,则为 null。)
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".
(rgbStr - - 所需的单元格颜色,十六进制形式“RRGGBB”。)
public XWPFTableCell.XWPFVertAlign getVerticalAlignment()
null
if no vertical alignment is set.
(单元格对齐枚举值,如果未设置垂直对齐,则为 null。)
public void setVerticalAlignment(XWPFTableCell.XWPFVertAlign vAlign)
vAlign
- - the desired alignment enum value
(vAlign - - 所需的对齐枚举值)
public XWPFParagraph insertNewParagraph(org.apache.xmlbeans.XmlCursor cursor)
insertNewParagraph
in interface
IBody
(接口 IBody 中的 insertNewParagraph)
cursor
- The XmlCursor structure created with XmlBeans
(cursor - 使用 XmlBeans 创建的 XmlCursor 结构)
public XWPFTable insertNewTbl(org.apache.xmlbeans.XmlCursor cursor)
IBody
insertNewTbl
in interface
IBody
(接口 IBody 中的 insertNewTbl)
public XWPFParagraph getParagraphArray(int pos)
IBody
getParagraphArray
in interface
IBody
(接口 IBody 中的 getParagraphArray)
IBody.getParagraphArray(int)
public POIXMLDocumentPart getPart()
getPart
in interface
IBody
(接口 IBody 中的 getPart)
IBody.getPart()
public BodyType getPartType()
IBody
getPartType
in interface
IBody
(接口 IBody 中的 getPartType)
IBody.getPartType()
public XWPFTable getTable(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl ctTable)
getTable
in interface
IBody
(接口 IBody 中的 getTable)
IBody.getTable(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl)
public XWPFTable getTableArray(int pos)
IBody
getTableArray
in interface
IBody
(接口 IBody 中的 getTableArray)
IBody.getTableArray(int)
public java.util.List<XWPFTable> getTables()
IBody
getTables
in interface
IBody
(接口 IBody 中的 getTables)
IBody.getTables()
public void insertTable(int pos, XWPFTable table)
insertTable
in interface
IBody
(接口 IBody 中的 insertTable)
IBody.insertTable(int, org.apache.poi.xwpf.usermodel.XWPFTable)
public void removeTable(int pos)
pos
- The position in the list of tables, 0-based
(pos - 表格列表中的位置,从 0 开始)
public 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
(接口 IBody 中的 getTableCell)
public XWPFDocument getXWPFDocument()
IBody
getXWPFDocument
in interface
IBody
(接口 IBody 中的 getXWPFDocument)
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.
(以十进制值获取表格宽度。如果宽度类型是 DXA 或 AUTO,则该值将始终具有零的小数部分(因为这些值实际上是整数)。如果 with 类型是百分比,那么 value 可能有一个非零的小数部分。)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".
(获取表格的宽度类型,作为 STTblWidth.Enum 值。表格宽度可以指定为绝对测量值(缇的整数)、百分比或值“AUTO”。)
public void setWidth(java.lang.String widthValue)
widthValue
- String matching one of "auto", [0-9]+, or [0-9]+(\.[0-9]+)%.
(widthValue - 匹配“auto”、[0-9]+ 或 [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 type
(widthType - 宽度类型)
public int getWidth()
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.