public class XWPFParagraph extends java.lang.Object implements IBodyElement, IRunBody, ISDTContents, Paragraph
A Paragraph within a Document, Table, Header etc.
A paragraph has a lot of styling information, but the actual text (possibly along with more styling) is held on the child XWPFRun
s.
Modifier and Type | Field and Description |
---|---|
protected XWPFDocument |
document
For access to the document's hyperlink, comments, tables etc
(用于访问文档的超链接、评论、表格等)
|
protected java.util.List<IRunElement> |
iruns |
protected IBody |
part |
protected java.util.List<XWPFRun> |
runs |
Constructor and Description |
---|
XWPFParagraph(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP prgrph, IBody part) |
Modifier and Type | Method and Description |
---|---|
void |
addFootnoteReference(XWPFAbstractFootnoteEndnote footnote)
Add a new run with a reference to the specified footnote.
(添加一个引用指定脚注的新运行。)
|
protected void |
addRun(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTR run)
add a new run at the end of the position of the content of parameter run
(在参数run的内容的末尾添加一个新的run)
|
void |
addRun(XWPFRun r)
adds a new Run to the Paragraph
(在段落中添加一个新的运行)
|
XWPFFieldRun |
createFieldRun()
Appends a new field run to this paragraph
(追加一个新的字段运行到这个段落)
|
XWPFHyperlinkRun |
createHyperlinkRun(java.lang.String uri)
Appends a new hyperlink run to this paragraph
(将新的超链接附加到此段落)
|
XWPFRun |
createRun()
Appends a new run to this paragraph
(将新的运行附加到本段)
|
ParagraphAlignment |
getAlignment()
Returns the paragraph alignment which shall be applied to text in this paragraph.
(返回应用于本段文本的段落对齐方式。)
|
IBody |
getBody() |
Borders |
getBorderBetween()
Specifies the border which shall be displayed between each paragraph in a set of paragraphs which have the same set of paragraph border settings.
(指定应在具有相同段落边框设置的一组段落中的每个段落之间显示的边框。)
|
Borders |
getBorderBottom()
Specifies the border which shall be displayed below a set of paragraphs which have the same set of paragraph border settings.
(指定应显示在具有相同段落边框设置的一组段落下方的边框。)
|
Borders |
getBorderLeft()
Specifies the border which shall be displayed on the left side of the page around the specified paragraph.
(指定在页面左侧围绕指定段落显示的边框。)
|
Borders |
getBorderRight()
Specifies the border which shall be displayed on the right side of the page around the specified paragraph.
(指定应在页面右侧围绕指定段落显示的边框。)
|
Borders |
getBorderTop()
Specifies the border which shall be displayed above a set of paragraphs which have the same set of paragraph border settings.
(指定应显示在具有相同段落边框设置的一组段落上方的边框。)
|
org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP |
getCTP() |
XWPFDocument |
getDocument() |
BodyElementType |
getElementType()
returns the type of the BodyElement Paragraph
(返回 BodyElement 段落的类型)
|
int |
getFirstLineIndent() |
int |
getFontAlignment() |
java.lang.String |
getFootnoteText()
Returns the footnote text of the paragraph
(返回段落的脚注文本)
|
int |
getIndentationFirstLine()
Specifies the additional indentation which shall be applied to the first line of the parent paragraph.
(指定应用于父段落第一行的附加缩进。)
|
int |
getIndentationHanging()
Specifies the indentation which shall be removed from the first line of the parent paragraph, by moving the indentation on the first line back towards the beginning of the direction of text flow.
(通过将第一行上的缩进移回文本流方向的开头,指定应从父段落的第一行删除的缩进。)
|
int |
getIndentationLeft()
Specifies the indentation which shall be placed between the left text margin for this paragraph and the left edge of that paragraph's content in a left to right paragraph, and the right text margin and the right edge of that paragraph's text in a right to left paragraph
(指定应放置在该段落的左文本边距和从左到右段落中该段落内容的左边缘之间以及从右到左段落中的右文本边距和该段落文本的右边缘之间的缩进)
|
int |
getIndentationLeftChars()
Get the indentation which is placed at the left/start of this paragraph
(获取位于本段左侧/开头的缩进)
|
int |
getIndentationRight()
Specifies the indentation which shall be placed between the right text margin for this paragraph and the right edge of that paragraph's content in a left to right paragraph, and the right text margin and the right edge of that paragraph's text in a right to left paragraph
(指定应放置在该段落的右文本边距和从左到右段落中该段落内容的右边缘之间以及从右到左段落中的右文本边距和该段落文本的右边缘之间的缩进)
|
int |
getIndentationRightChars()
Get the indentation which is placed at the right/end of this paragraph
(获取位于本段右侧/末尾的缩进)
|
int |
getIndentFromLeft() |
int |
getIndentFromRight() |
java.util.List<IRunElement> |
getIRuns()
Return literal runs and sdt/content control objects.
(返回文字运行和 sdt/内容控制对象。)
|
java.lang.String |
getNumFmt()
Returns numbering format for this paragraph, eg bullet or lowerLetter.
(返回此段落的编号格式,例如项目符号或 lowerLetter。)
|
java.math.BigInteger |
getNumID()
If style exist for this paragraph NumId of the paragraph will be returned.
(如果该段落存在样式,则返回该段落的 NumId。)
|
java.math.BigInteger |
getNumIlvl()
Returns Ilvl of the numeric style for this paragraph.
(返回此段落的数字样式的 Ilvl。)
|
java.lang.String |
getNumLevelText()
Returns the text that should be used around the paragraph level numbers.
(返回应该在段落级别编号周围使用的文本。)
|
java.math.BigInteger |
getNumStartOverride()
Gets the numstartOverride for the paragraph numbering for this paragraph.
(获取此段落的段落编号的 numstartOverride。)
|
java.lang.String |
getParagraphText()
Returns the text of the paragraph, but not of any objects in the paragraph
(返回段落的文本,但不返回段落中的任何对象)
|
POIXMLDocumentPart |
getPart()
returns the part of the bodyElement
(返回 bodyElement 的部分)
|
BodyType |
getPartType()
returns the partType of the bodyPart which owns the bodyElement
(返回拥有 bodyElement 的 bodyPart 的 partType)
|
java.lang.String |
getPictureText()
Returns any text from any suitable pictures in the paragraph
(从段落中任何合适的图片返回任何文本)
|
XWPFRun |
getRun(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTR r)
return the XWPFRun-Element which owns the CTR run-Element
(返回拥有 CTR 运行元素的 XWPFRun 元素)
|
java.util.List<XWPFRun> |
getRuns() |
int |
getSpacingAfter()
Specifies the spacing that should be added after the last line in this paragraph in the document in absolute units.
(以绝对单位指定应在文档中此段落的最后一行之后添加的间距。)
|
int |
getSpacingAfterLines()
Specifies the spacing that should be added after the last line in this paragraph in the document in absolute units.
(以绝对单位指定应在文档中此段落的最后一行之后添加的间距。)
|
int |
getSpacingBefore()
Specifies the spacing that should be added above the first line in this paragraph in the document in absolute units.
(以绝对单位指定应在文档中此段落的第一行上方添加的间距。)
|
int |
getSpacingBeforeLines()
Specifies the spacing that should be added before the first line in this paragraph in the document in line units.
(指定应在文档中此段落的第一行之前添加的间距(以行为单位)。)
|
double |
getSpacingBetween()
Return the spacing between lines of a paragraph.
(返回段落的行间距。)
|
LineSpacingRule |
getSpacingLineRule()
Specifies how the spacing between lines is calculated as stored in the line attribute.
(指定如何计算线之间的间距以存储在线属性中。)
|
java.lang.String |
getStyle() |
java.lang.String |
getStyleID()
Return styleID of the paragraph if style exist for this paragraph if not, null will be returned
(如果该段落存在样式,则返回该段落的styleID 如果不存在,则返回null)
|
java.lang.String |
getText()
Return the textual content of the paragraph, including text from pictures and sdt elements in it.
(返回段落的文本内容,包括图片中的文本和其中的 sdt 元素。)
|
java.lang.String |
getText(TextSegment segment)
get a Text
(获得一段文本)
|
TextAlignment |
getVerticalAlignment()
Returns the text vertical alignment which shall be applied to text in this paragraph.
(返回应用于本段文本的文本垂直对齐方式。)
|
XWPFFieldRun |
insertNewFieldRun(int pos)
insert a new field Run in all runs
(在所有运行中插入一个新字段运行)
|
XWPFHyperlinkRun |
insertNewHyperlinkRun(int pos, java.lang.String uri)
insert a new hyperlink Run in all runs
(在所有运行中插入一个新的超链接运行)
|
XWPFRun |
insertNewRun(int pos)
insert a new Run in all runs
(在所有运行中插入一个新的运行)
|
boolean |
isEmpty() |
boolean |
isKeepNext()
Indicates whether this paragraph should be kept on the same page as the next one.
(指示此段落是否应与下一个段落保持在同一页面上。)
|
boolean |
isPageBreak()
Specifies that when rendering this document in a paginated view, the contents of this paragraph are rendered on the start of a new page in the document.
(指定在分页视图中呈现此文档时,此段落的内容将呈现在文档中新页面的开头。)
|
boolean |
isWordWrap() |
boolean |
isWordWrapped()
This element specifies whether a consumer shall break Latin text which exceeds the text extents of a line by breaking the word across two lines (breaking on the character level) or by moving the word to the following line (breaking on the word level).
(此元素指定消费者是否应通过将单词分成两行(在字符级别中断)或将单词移动到下一行(在单词级别中断)来中断超出行文本范围的拉丁文本。)
|
boolean |
removeRun(int pos)
removes a Run at the position pos in the paragraph
(删除段落中位置 pos 的 Run)
|
TextSegment |
searchText(java.lang.String searched, PositionInParagraph startPos)
this methods parse the paragraph and search for the string searched.
(此方法解析段落并搜索搜索到的字符串。)
|
void |
setAlignment(ParagraphAlignment align)
Specifies the paragraph alignment which shall be applied to text in this paragraph.
(指定应用于此段落中的文本的段落对齐方式。)
|
void |
setBorderBetween(Borders border)
Specifies the border which shall be displayed between each paragraph in a set of paragraphs which have the same set of paragraph border settings.
(指定应在具有相同段落边框设置的一组段落中的每个段落之间显示的边框。)
|
void |
setBorderBottom(Borders border)
Specifies the border which shall be displayed below a set of paragraphs which have the same set of paragraph border settings.
(指定应显示在具有相同段落边框设置的一组段落下方的边框。)
|
void |
setBorderLeft(Borders border)
Specifies the border which shall be displayed on the left side of the page around the specified paragraph.
(指定在页面左侧围绕指定段落显示的边框。)
|
void |
setBorderRight(Borders border)
Specifies the border which shall be displayed on the right side of the page around the specified paragraph.
(指定应在页面右侧围绕指定段落显示的边框。)
|
void |
setBorderTop(Borders border)
Specifies the border which shall be displayed above a set of paragraphs which have the same set of paragraph border settings.
(指定应显示在具有相同段落边框设置的一组段落上方的边框。)
|
void |
setFirstLineIndent(int first) |
void |
setFontAlignment(int align) |
void |
setIndentationFirstLine(int indentation)
Specifies the additional indentation which shall be applied to the first line of the parent paragraph.
(指定应用于父段落第一行的附加缩进。)
|
void |
setIndentationHanging(int indentation)
Specifies the indentation which shall be removed from the first line of the parent paragraph, by moving the indentation on the first line back towards the beginning of the direction of text flow.
(通过将第一行上的缩进移回文本流方向的开头,指定应从父段落的第一行删除的缩进。)
|
void |
setIndentationLeft(int indentation)
Specifies the indentation which shall be placed between the left text margin for this paragraph and the left edge of that paragraph's content in a left to right paragraph, and the right text margin and the right edge of that paragraph's text in a right to left paragraph
(指定应放置在该段落的左文本边距和从左到右段落中该段落内容的左边缘之间以及从右到左段落中的右文本边距和该段落文本的右边缘之间的缩进)
|
void |
setIndentationLeftChars(int indentation)
Specifies the indentation which shall be placed at the left/start of this paragraph
(指定应放置在本段左侧/开头的缩进)
|
void |
setIndentationRight(int indentation)
Specifies the indentation which shall be placed between the right text margin for this paragraph and the right edge of that paragraph's content in a left to right paragraph, and the right text margin and the right edge of that paragraph's text in a right to left paragraph
(指定应放置在该段落的右文本边距和从左到右段落中该段落内容的右边缘之间以及从右到左段落中的右文本边距和该段落文本的右边缘之间的缩进)
|
void |
setIndentationRightChars(int indentation)
Specifies the indentation which shall be placed at the right/end of this paragraph
(指定应放置在本段右侧/末尾的缩进)
|
void |
setIndentFromLeft(int dxaLeft) |
void |
setIndentFromRight(int dxaRight) |
void |
setKeepNext(boolean keepNext)
Sets this paragraph to be kept on the same page as the next one or not.
(设置此段落是否与下一个段落保持在同一页面上。)
|
void |
setNumID(java.math.BigInteger numPos)
setNumID of Paragraph
(段落的 setNumID)
|
void |
setNumILvl(java.math.BigInteger iLvl)
setNumILvl of Paragraph
(段落的 setNumILvl)
|
void |
setPageBreak(boolean pageBreak)
Specifies that when rendering this document in a paginated view, the contents of this paragraph are rendered on the start of a new page in the document.
(指定在分页视图中呈现此文档时,此段落的内容将呈现在文档中新页面的开头。)
|
void |
setSpacingAfter(int spaces)
Specifies the spacing that should be added after the last line in this paragraph in the document in absolute units.
(以绝对单位指定应在文档中此段落的最后一行之后添加的间距。)
|
void |
setSpacingAfterLines(int spaces)
Specifies the spacing that should be added after the last line in this paragraph in the document in line units.
(指定应在文档中此段落的最后一行之后添加的间距(以行为单位)。)
|
void |
setSpacingBefore(int spaces)
Specifies the spacing that should be added above the first line in this paragraph in the document in absolute units.
(以绝对单位指定应在文档中此段落的第一行上方添加的间距。)
|
void |
setSpacingBeforeLines(int spaces)
Specifies the spacing that should be added before the first line in this paragraph in the document in line units.
(指定应在文档中此段落的第一行之前添加的间距(以行为单位)。)
|
void |
setSpacingBetween(double spacing)
Sets the spacing between lines in a paragraph
(设置段落中的行间距)
|
void |
setSpacingBetween(double spacing, LineSpacingRule rule)
Sets the spacing between lines in a paragraph
(设置段落中的行间距)
|
void |
setSpacingLineRule(LineSpacingRule rule)
Specifies how the spacing between lines is calculated as stored in the line attribute.
(指定如何计算线之间的间距以存储在线属性中。)
|
void |
setStyle(java.lang.String styleId)
Set the style ID for the paragraph
(设置段落的样式 ID)
|
void |
setVerticalAlignment(TextAlignment valign)
Specifies the text vertical alignment which shall be applied to text in this paragraph.
(指定应用于本段文本的文本垂直对齐方式。)
|
void |
setWordWrap(boolean wrap)
Deprecated.
(已弃用。)
|
void |
setWordWrapped(boolean wrap)
This element specifies whether a consumer shall break Latin text which exceeds the text extents of a line by breaking the word across two lines (breaking on the character level) or by moving the word to the following line (breaking on the word level).
(此元素指定消费者是否应通过将单词分成两行(在字符级别中断)或将单词移动到下一行(在单词级别中断)来中断超出行文本范围的拉丁文本。)
|
protected IBody part
protected XWPFDocument document
protected java.util.List<XWPFRun> runs
protected java.util.List<IRunElement> iruns
public XWPFParagraph(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP prgrph, IBody part)
@Internal public org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP getCTP()
public java.util.List<XWPFRun> getRuns()
public java.util.List<IRunElement> getIRuns()
public boolean isEmpty()
public XWPFDocument getDocument()
getDocument
in interface
IRunBody
(接口 IRunBody 中的 getDocument)
public java.lang.String getText()
public java.lang.String getStyleID()
public java.math.BigInteger getNumID()
public void setNumID(java.math.BigInteger numPos)
numPos
-
(numPos -)
public void setNumILvl(java.math.BigInteger iLvl)
iLvl
-
(iLvl -)
public java.math.BigInteger getNumIlvl()
public java.lang.String getNumFmt()
public java.lang.String getNumLevelText()
public java.math.BigInteger getNumStartOverride()
public boolean isKeepNext()
public void setKeepNext(boolean keepNext)
public java.lang.String getParagraphText()
public java.lang.String getPictureText()
public java.lang.String getFootnoteText()
public ParagraphAlignment getAlignment()
If this element is not set on a given paragraph, its value is determined by the setting previously set at any level of the style hierarchy (i.e. that previous setting remains unchanged). If this setting is never specified in the style hierarchy, then no alignment is applied to the paragraph.
(返回应用于本段文本的段落对齐方式。如果该元素未在给定段落上设置,则其值由先前在样式层次结构的任何级别设置的设置确定(即先前的设置保持不变)。如果从未在样式层次结构中指定此设置,则不会对段落应用对齐方式。)public void setAlignment(ParagraphAlignment align)
If this element is not set on a given paragraph, its value is determined by the setting previously set at any level of the style hierarchy (i.e. that previous setting remains unchanged). If this setting is never specified in the style hierarchy, then no alignment is applied to the paragraph.
(指定应用于此段落中的文本的段落对齐方式。如果该元素未在给定段落上设置,则其值由先前在样式层次结构的任何级别设置的设置确定(即先前的设置保持不变)。如果从未在样式层次结构中指定此设置,则不会对段落应用对齐方式。)align
- the paragraph alignment to apply to this paragraph.
(align - 应用于此段落的段落对齐方式。)
public int getFontAlignment()
getFontAlignment
in interface
Paragraph
(接口 Paragraph 中的 getFontAlignment)
getAlignment()
is suggested
(建议使用原始对齐值 getAlignment())
public void setFontAlignment(int align)
setFontAlignment
in interface
Paragraph
(接口 Paragraph 中的 setFontAlignment)
public TextAlignment getVerticalAlignment()
If the line height (before any added spacing) is larger than one or more characters on the line, all characters will be aligned to each other as specified by this element.
If this element is omitted on a given paragraph, its value is determined by the setting previously set at any level of the style hierarchy (i.e. that previous setting remains unchanged). If this setting is never specified in the style hierarchy, then the vertical alignment of all characters on the line shall be automatically determined by the consumer.
(返回应用于本段文本的文本垂直对齐方式。如果行高(在任何添加的间距之前)大于行上的一个或多个字符,则所有字符将按照此元素的指定相互对齐。如果在给定段落中省略此元素,则其值由先前在样式层次结构的任何级别设置的设置确定(即先前的设置保持不变)。如果在样式层次结构中从未指定此设置,则行上所有字符的垂直对齐方式应由消费者自动确定。)public void setVerticalAlignment(TextAlignment valign)
If the line height (before any added spacing) is larger than one or more characters on the line, all characters will be aligned to each other as specified by this element.
If this element is omitted on a given paragraph, its value is determined by the setting previously set at any level of the style hierarchy (i.e. that previous setting remains unchanged). If this setting is never specified in the style hierarchy, then the vertical alignment of all characters on the line shall be automatically determined by the consumer.
(指定应用于本段文本的文本垂直对齐方式。如果行高(在任何添加的间距之前)大于行上的一个或多个字符,则所有字符将按照此元素的指定相互对齐。如果在给定段落中省略此元素,则其值由先前在样式层次结构的任何级别设置的设置确定(即先前的设置保持不变)。如果在样式层次结构中从未指定此设置,则行上所有字符的垂直对齐方式应由消费者自动确定。)valign
- the paragraph vertical alignment to apply to this paragraph.
(valign - 应用于该段落的段落垂直对齐。)
public Borders getBorderTop()
setBorderTop(Borders)
,
a list of all types of borders
public void setBorderTop(Borders border)
To determine if any two adjoining paragraphs shall have an individual top and bottom border or a between border, the set of borders on the two adjoining paragraphs are compared. If the border information on those two paragraphs is identical for all possible paragraphs borders, then the between border is displayed. Otherwise, the final paragraph shall use its bottom border and the following paragraph shall use its top border, respectively. If this border specifies a space attribute, that value determines the space above the text (ignoring any spacing above) which should be left before this border is drawn, specified in points.
If this element is omitted on a given paragraph, its value is determined by the setting previously set at any level of the style hierarchy (i.e. that previous setting remains unchanged). If this setting is never specified in the style hierarchy, then no between border shall be applied above identical paragraphs.
This border can only be a line border. (指定应显示在具有相同段落边框设置的一组段落上方的边框。为了确定任何两个相邻段落是否应具有单独的顶部和底部边界或中间边界,比较两个相邻段落上的边界集。如果这两个段落的边框信息对于所有可能的段落边框都相同,则显示中间边框。否则,最后一段应使用其底部边框,下一段应分别使用其顶部边框。如果此边框指定了一个空格属性,则该值确定在绘制此边框之前应保留的文本上方的空间(忽略上方的任何间距),以磅为单位。如果在给定段落中省略此元素,则其值由先前在样式层次结构的任何级别设置的设置确定(即先前的设置保持不变)。如果在样式层次结构中从未指定此设置,则不应在相同段落上方应用边框。此边框只能是线边框。)border
- one of the defined Border styles, see
Borders
(边框 - 定义的边框样式之一,请参阅边框)
for a list of all types of borders
public Borders getBorderBottom()
setBorderBottom(Borders)
,
a list of all types of borders
public void setBorderBottom(Borders border)
To determine if any two adjoining paragraphs shall have an individual top and bottom border or a between border, the set of borders on the two adjoining paragraphs are compared. If the border information on those two paragraphs is identical for all possible paragraphs borders, then the between border is displayed. Otherwise, the final paragraph shall use its bottom border and the following paragraph shall use its top border, respectively. If this border specifies a space attribute, that value determines the space after the bottom of the text (ignoring any space below) which should be left before this border is drawn, specified in points.
If this element is omitted on a given paragraph, its value is determined by the setting previously set at any level of the style hierarchy (i.e. that previous setting remains unchanged). If this setting is never specified in the style hierarchy, then no between border shall be applied below identical paragraphs.
This border can only be a line border. (指定应显示在具有相同段落边框设置的一组段落下方的边框。为了确定任何两个相邻段落是否应具有单独的顶部和底部边界或中间边界,比较两个相邻段落上的边界集。如果这两个段落的边框信息对于所有可能的段落边框都相同,则显示中间边框。否则,最后一段应使用其底部边框,下一段应分别使用其顶部边框。如果此边框指定了空格属性,则该值确定文本底部之后的空格(忽略下方的任何空格),该空格应在绘制此边框之前留下,以磅为单位。如果在给定段落中省略此元素,则其值由先前在样式层次结构的任何级别设置的设置确定(即先前的设置保持不变)。如果在样式层次结构中从未指定此设置,则不应在相同段落下方应用边框。此边框只能是线边框。)border
- one of the defined Border styles, see
Borders
(边框 - 定义的边框样式之一,请参阅边框)
a list of all types of borders
public Borders getBorderLeft()
setBorderLeft(Borders)
,
for a list of all possible borders
public void setBorderLeft(Borders border)
To determine if any two adjoining paragraphs should have a left border which spans the full line height or not, the left border shall be drawn between the top border or between border at the top (whichever would be rendered for the current paragraph), and the bottom border or between border at the bottom (whichever would be rendered for the current paragraph).
If this element is omitted on a given paragraph, its value is determined by the setting previously set at any level of the style hierarchy (i.e. that previous setting remains unchanged). If this setting is never specified in the style hierarchy, then no left border shall be applied.
This border can only be a line border. (指定在页面左侧围绕指定段落显示的边框。为了确定任何两个相邻段落是否应该有一个跨越整个行高的左边框,左边框应在顶部边框之间或顶部边框之间绘制(以当前段落呈现的为准),并且底部边框或底部边框之间(以当前段落呈现的为准)。如果在给定段落中省略此元素,则其值由先前在样式层次结构的任何级别设置的设置确定(即先前的设置保持不变)。如果在样式层次结构中从未指定此设置,则不应应用左边框。此边框只能是线边框。)border
- one of the defined Border styles, see
Borders
(边框 - 定义的边框样式之一,请参阅边框)
for a list of all possible borders
public Borders getBorderRight()
setBorderRight(Borders)
,
for a list of all possible borders
public void setBorderRight(Borders border)
To determine if any two adjoining paragraphs should have a right border which spans the full line height or not, the right border shall be drawn between the top border or between border at the top (whichever would be rendered for the current paragraph), and the bottom border or between border at the bottom (whichever would be rendered for the current paragraph).
If this element is omitted on a given paragraph, its value is determined by the setting previously set at any level of the style hierarchy (i.e. that previous setting remains unchanged). If this setting is never specified in the style hierarchy, then no right border shall be applied.
This border can only be a line border. (指定应在页面右侧围绕指定段落显示的边框。要确定任何两个相邻段落是否应具有跨越整个行高的右边框,应在顶部边框或顶部边框之间绘制右边框(以当前段落呈现的为准),并且底部边框或底部边框之间(以当前段落呈现的为准)。如果在给定段落中省略此元素,则其值由先前在样式层次结构的任何级别设置的设置确定(即先前的设置保持不变)。如果在样式层次结构中从未指定此设置,则不应应用右边框。此边框只能是线边框。)border
- one of the defined Border styles, see
Borders
(边框 - 定义的边框样式之一,请参阅边框)
for a list of all possible borders
public Borders getBorderBetween()
setBorderBetween(Borders)
,
for a list of all possible borders
public void setBorderBetween(Borders border)
To determine if any two adjoining paragraphs should have a between border or an individual top and bottom border, the set of borders on the two adjoining paragraphs are compared. If the border information on those two paragraphs is identical for all possible paragraphs borders, then the between border is displayed. Otherwise, each paragraph shall use its bottom and top border, respectively. If this border specifies a space attribute, that value is ignored - this border is always located at the bottom of each paragraph with an identical following paragraph, taking into account any space after the line pitch.
If this element is omitted on a given paragraph, its value is determined by the setting previously set at any level of the style hierarchy (i.e. that previous setting remains unchanged). If this setting is never specified in the style hierarchy, then no between border shall be applied between identical paragraphs.
This border can only be a line border. (指定应在具有相同段落边框设置的一组段落中的每个段落之间显示的边框。为了确定任何两个相邻段落是否应具有中间边框或单独的上下边框,对两个相邻段落上的边框集进行比较。如果这两个段落的边框信息对于所有可能的段落边框都相同,则显示中间边框。否则,每个段落应分别使用其底部和顶部边框。如果此边框指定了空格属性,则忽略该值 - 此边框始终位于每个段落的底部,并具有相同的后续段落,同时考虑到行距后的任何空格。如果在给定段落中省略此元素,则其值由先前在样式层次结构的任何级别设置的设置确定(即先前的设置保持不变)。如果从未在样式层次结构中指定此设置,则不应在相同段落之间应用边框。此边框只能是线边框。)border
- one of the defined Border styles, see
Borders
(边框 - 定义的边框样式之一,请参阅边框)
for a list of all possible borders
public boolean isPageBreak()
If this element is omitted on a given paragraph, its value is determined by the setting previously set at any level of the style hierarchy (i.e. that previous setting remains unchanged). If this setting is never specified in the style hierarchy, then this property shall not be applied. Since the paragraph is specified to start on a new page, it begins page two even though it could have fit on page one.
(指定在分页视图中呈现此文档时,此段落的内容将呈现在文档中新页面的开头。如果在给定段落中省略此元素,则其值由先前在样式层次结构的任何级别设置的设置确定(即先前的设置保持不变)。如果从未在样式层次结构中指定此设置,则不应应用此属性。由于该段落被指定在新页面上开始,因此它从第二页开始,即使它本来可以放在第一页上。)public void setPageBreak(boolean pageBreak)
If this element is omitted on a given paragraph, its value is determined by the setting previously set at any level of the style hierarchy (i.e. that previous setting remains unchanged). If this setting is never specified in the style hierarchy, then this property shall not be applied. Since the paragraph is specified to start on a new page, it begins page two even though it could have fit on page one.
(指定在分页视图中呈现此文档时,此段落的内容将呈现在文档中新页面的开头。如果在给定段落中省略此元素,则其值由先前在样式层次结构的任何级别设置的设置确定(即先前的设置保持不变)。如果从未在样式层次结构中指定此设置,则不应应用此属性。由于该段落被指定在新页面上开始,因此它从第二页开始,即使它本来可以放在第一页上。)pageBreak
- - boolean value
(pageBreak - - 布尔值)
public int getSpacingAfter()
public void setSpacingAfter(int spaces)
If the afterLines attribute or the afterAutoSpacing attribute is also specified, then this attribute value is ignored.
(以绝对单位指定应在文档中此段落的最后一行之后添加的间距。如果还指定了 afterLines 属性或 afterAutoSpacing 属性,则忽略此属性值。)spaces
- a positive whole number, whose contents consist of a measurement in twentieths of a point.
(空格 - 一个正整数,其内容由一个点的二十分之一测量组成。)
public int getSpacingAfterLines()
setSpacingAfterLines(int)
public void setSpacingAfterLines(int spaces)
If the afterAutoSpacing attribute is also specified, then this attribute value is ignored. If this setting is never specified in the style hierarchy, then its value shall be zero (if needed)
(指定应在文档中此段落的最后一行之后添加的间距(以行为单位)。此属性的值以行的百分之一指定。如果还指定了 afterAutoSpacing 属性,则忽略此属性值。如果此设置从未在样式层次结构中指定,则其值应为零(如果需要))spaces
- a positive whole number, whose contents consist of a measurement in hundredths of a line
(空格 - 一个正整数,其内容包含以百分之几为单位的测量值)
public int getSpacingBefore()
setSpacingBefore(int)
public void setSpacingBefore(int spaces)
If the beforeLines attribute or the beforeAutoSpacing attribute is also specified, then this attribute value is ignored.
(以绝对单位指定应在文档中此段落的第一行上方添加的间距。如果还指定了 beforeLines 属性或 beforeAutoSpacing 属性,则忽略此属性值。)spaces
- a positive whole number, whose contents consist of a measurement in twentieths of a point.
(空格 - 一个正整数,其内容由一个点的二十分之一测量组成。)
public int getSpacingBeforeLines()
setSpacingBeforeLines(int)
public void setSpacingBeforeLines(int spaces)
If the beforeAutoSpacing attribute is also specified, then this attribute value is ignored. If this setting is never specified in the style hierarchy, then its value shall be zero.
(指定应在文档中此段落的第一行之前添加的间距(以行为单位)。此属性的值以行的百分之一指定。如果还指定了 beforeAutoSpacing 属性,则忽略此属性值。如果在样式层次结构中从未指定此设置,则其值应为零。)spaces
- a positive whole number, whose contents consist of a measurement in hundredths of a line
(空格 - 一个正整数,其内容包含以百分之几为单位的测量值)
public LineSpacingRule getSpacingLineRule()
LineSpacingRule
,
setSpacingLineRule(LineSpacingRule)
public void setSpacingLineRule(LineSpacingRule rule)
rule
- one of the defined rules, see
LineSpacingRule
(rule - 定义的规则之一,参见 LineSpacingRule)
LineSpacingRule
public double getSpacingBetween()
LineSpacingRule
. If AUTO, the return value is in lines, otherwise the return value is in points
(返回段落的行间距。返回值的单位取决于 LineSpacingRule。如果为 AUTO,则返回值以行为单位,否则返回值以点为单位)
public void setSpacingBetween(double spacing, LineSpacingRule rule)
spacing
- - A double specifying spacing in inches or lines. If rule is AUTO, then spacing is in lines. Otherwise spacing is in points.
(间距 - 以英寸或线为单位的双重指定间距。如果规则为 AUTO,则间距为行。否则间距以点为单位。)
rule
- -
LineSpacingRule
indicating how spacing is interpreted. If AUTO, then spacing value is in lines, and the height depends on the font size. If AT_LEAST, then spacing value is in inches, and is the minimum size of the line. If the line height is taller, then the line expands to match. If EXACT, then spacing is the exact line height. If the text is taller than the line height, then it is clipped at the top.
(rule - - LineSpacingRule 指示如何解释间距。如果为 AUTO,则间距值以行为单位,高度取决于字体大小。如果 AT_LEAST,则间距值以英寸为单位,并且是行的最小尺寸。如果行高较高,则行扩展以匹配。如果 EXACT,则间距是确切的行高。如果文本高于行高,则在顶部剪裁。)
public void setSpacingBetween(double spacing)
spacing
- - A double specifying spacing in lines.
(间距 - 以行为单位的双倍指定间距。)
public int getIndentationLeft()
If this attribute is omitted, its value shall be assumed to be zero. Negative values are defined such that the text is moved past the text margin, positive values move the text inside the text margin.
(指定应放置在该段落的左文本边距和从左到右段落中该段落内容的左边缘之间以及从右到左段落中该段落文本的右文本边距和右边缘之间的缩进如果该属性被省略,其值应假定为零。负值被定义为使文本移动到文本边距之外,正值将文本移动到文本边距内。)public void setIndentationLeft(int indentation)
If this attribute is omitted, its value shall be assumed to be zero. Negative values are defined such that the text is moved past the text margin, positive values move the text inside the text margin.
(指定应放置在该段落的左文本边距和从左到右段落中该段落内容的左边缘之间以及从右到左段落中该段落文本的右文本边距和右边缘之间的缩进如果该属性被省略,其值应假定为零。负值被定义为使文本移动到文本边距之外,正值将文本移动到文本边距内。)indentation
- in twips
(缩进 - 缇)
public int getIndentationLeftChars()
public void setIndentationLeftChars(int indentation)
If this attribute is omitted, its value shall be assumed to be zero. if the left/start attribute is specified, then its value is ignored, and is superseded by this value.
(指定应放置在本段左侧/开头的缩进 如果省略此属性,则应假定其值为零。如果指定了 left/start 属性,则忽略其值,并由该值取代。)indentation
- this value is specified in hundredths of a character unit
(缩进 - 此值以字符单位的百分之一指定)
public int getIndentationRight()
If this attribute is omitted, its value shall be assumed to be zero. Negative values are defined such that the text is moved past the text margin, positive values move the text inside the text margin.
(指定应放置在该段落的右文本边距和从左到右段落中该段落内容的右边缘之间以及从右到左段落中的右文本边距和该段落文本的右边缘之间的缩进如果该属性被省略,其值应假定为零。负值被定义为使文本移动到文本边距之外,正值将文本移动到文本边距内。)public void setIndentationRight(int indentation)
If this attribute is omitted, its value shall be assumed to be zero. Negative values are defined such that the text is moved past the text margin, positive values move the text inside the text margin.
(指定应放置在该段落的右文本边距和从左到右段落中该段落内容的右边缘之间以及从右到左段落中的右文本边距和该段落文本的右边缘之间的缩进如果该属性被省略,其值应假定为零。负值被定义为使文本移动到文本边距之外,正值将文本移动到文本边距内。)indentation
- in twips
(缩进 - 缇)
public int getIndentationRightChars()
public void setIndentationRightChars(int indentation)
If this attribute is omitted, its value shall be assumed to be zero. if the right/end attribute is specified, then its value is ignored, and is superseded by this value.
(指定应放置在本段右侧/末尾的缩进 如果省略此属性,则应假定其值为零。如果指定了 right/end 属性,则忽略其值,并被该值取代。)indentation
- this value is specified in hundredths of a character unit
(缩进 - 此值以字符单位的百分之一指定)
public int getIndentationHanging()
public void setIndentationHanging(int indentation)
The firstLine and hanging attributes are mutually exclusive, if both are specified, then the firstLine value is ignored.
(通过将第一行的缩进移回文本流向的开头,指定应从父段落的第一行删除的缩进。此缩进是相对于为父段落中的所有其他行指定的段落缩进指定的。 firstLine 和hanging 属性是互斥的,如果两者都指定,则忽略firstLine 值。)indentation
- in twips
(缩进 - 缇)
public int getIndentationFirstLine()
public void setIndentationFirstLine(int indentation)
indentation
- in twips
(缩进 - 缇)
public int getIndentFromLeft()
getIndentFromLeft
in interface
Paragraph
(接口 Paragraph 中的 getIndentFromLeft)
public void setIndentFromLeft(int dxaLeft)
setIndentFromLeft
in interface
Paragraph
(接口 Paragraph 中的 setIndentFromLeft)
public int getIndentFromRight()
getIndentFromRight
in interface
Paragraph
(接口 Paragraph 中的 getIndentFromRight)
public void setIndentFromRight(int dxaRight)
setIndentFromRight
in interface
Paragraph
(接口 Paragraph 中的 setIndentFromRight)
public int getFirstLineIndent()
getFirstLineIndent
in interface
Paragraph
(接口 Paragraph 中的 getFirstLineIndent)
public void setFirstLineIndent(int first)
setFirstLineIndent
in interface
Paragraph
(接口 Paragraph 中的 setFirstLineIndent)
public boolean isWordWrapped()
isWordWrapped
in interface
Paragraph
(isWordWrapped 在界面段落中)
public void setWordWrapped(boolean wrap)
setWordWrapped
in interface
Paragraph
(setWordWrapped in interface Paragraph)
wrap
- - boolean
(换行 - - 布尔值)
public boolean isWordWrap()
@Deprecated public void setWordWrap(boolean wrap)
public java.lang.String getStyle()
public void setStyle(java.lang.String styleId)
styleId
- ID (not name) of the style to set for the paragraph, e.g. "Heading1" (not "Heading 1").
(styleId - 要为段落设置的样式的 ID(不是名称),例如“Heading1”(不是“Heading 1”)。)
protected void addRun(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTR run)
run
-
(跑 -)
public XWPFRun createRun()
public XWPFHyperlinkRun createHyperlinkRun(java.lang.String uri)
public XWPFFieldRun createFieldRun()
public XWPFRun insertNewRun(int pos)
pos
- The position at which the new run should be added.
(pos - 应该添加新运行的位置。)
public XWPFHyperlinkRun insertNewHyperlinkRun(int pos, java.lang.String uri)
pos
- The position at which the new run should be added.
(pos - 应该添加新运行的位置。)
uri
- hyperlink uri
(uri - 超链接 uri)
public XWPFFieldRun insertNewFieldRun(int pos)
pos
- The position at which the new run should be added.
(pos - 应该添加新运行的位置。)
public TextSegment searchText(java.lang.String searched, PositionInParagraph startPos)
searched
-
(搜索到 -)
startPos
-
(开始位置 -)
public java.lang.String getText(TextSegment segment)
segment
-
(分割 -)
public boolean removeRun(int pos)
pos
-
(邮政 -)
public BodyElementType getElementType()
getElementType
in interface
IBodyElement
(接口 IBodyElement 中的 getElementType)
IBodyElement.getElementType()
public IBody getBody()
getBody
in interface
IBodyElement
(接口 IBodyElement 中的 getBody)
public POIXMLDocumentPart getPart()
getPart
in interface
IBodyElement
(接口 IBodyElement 中的 getPart)
getPart
in interface
IRunBody
(接口 IRunBody 中的 getPart)
IBody.getPart()
public BodyType getPartType()
getPartType
in interface
IBodyElement
(接口 IBodyElement 中的 getPartType)
IBody.getPartType()
public void addRun(XWPFRun r)
r
-
(r -)
public XWPFRun getRun(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTR r)
r
-
(r -)
public void addFootnoteReference(XWPFAbstractFootnoteEndnote footnote)
footnote
- Footnote to which to add a reference.
(footnote - 要添加引用的脚注。)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.