Class Body
java.lang.Object
io.leandev.appfuse.document.Body
- Direct Known Subclasses:
TableCell
內容容器(共用編輯面)
Word 的文件本文、頁首、頁尾、表格儲存格在 OOXML 中都是「IBody 容器」,
因此共用同一組操作:段落/表格的列舉、附加、樣板複製、定位(locator)與文字取代。
Document.body()、Document.header()、Document.footer() 皆回傳 Body;TableCell 繼承自 Body。
- Since:
- 4.0.0
-
Method Summary
Modifier and TypeMethodDescriptionappendCopyOf(Paragraph template) 附加一份樣板段落的複製(深拷貝其內容與格式)到容器末端appendCopyOf(Table template) 附加一份樣板表格的複製(深拷貝其內容與格式)到容器末端voidappendHtml(String html) 以渲染後的 HTML 子集附加富文本到容器末端在容器末端附加空段落appendParagraph(String text) 在容器末端附加段落appendParagraph(String text, String styleName) 在容器末端附加段落並套用樣板樣式appendTable(int rows, int cols) 在容器末端附加表格findCellByBookmark(String bookmark) 依書籤定位儲存格findCellByText(String text) 依文字內容定位儲存格findParagraphByBookmark(String bookmark) 依書籤定位段落findParagraphByText(String text) 依文字內容定位段落取得所有段落voidreplaceText(String target, String replacement) 跨段落、跨儲存格的文字取代(保留各段首個 run 的格式)tables()取得所有表格
-
Method Details
-
paragraphs
-
tables
-
appendParagraph
-
appendParagraph
-
appendParagraph
-
appendTable
-
appendCopyOf
-
appendCopyOf
-
appendHtml
以渲染後的 HTML 子集附加富文本到容器末端- Parameters:
html- appfuse-web RichTextEditor 輸出的 HTML 字串
-
findParagraphByText
-
findParagraphByBookmark
-
findCellByText
-
findCellByBookmark
-
replaceText
-