RichText
Inheritance: java.lang.Object, com.aspose.note.Node
All Implemented Interfaces: com.aspose.note.IOutlineElementChildNode, com.aspose.note.ITaggable, com.aspose.ms.System.Collections.Generic.IGenericEnumerable
public class RichText extends Node implements IOutlineElementChildNode, ITaggable, System.Collections.Generic.IGenericEnumerable<Character>
表示富文本。
构造函数
| 构造函数 | 描述 |
|---|---|
| RichText() | 初始化 RichText 类的新实例。 |
方法
RichText()
public RichText()
初始化 RichText 类的新实例。
accept(DocumentVisitor visitor)
public void accept(DocumentVisitor visitor)
接受节点的访问者。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| visitor | DocumentVisitor | 从 DocumentVisitor 派生的类的对象。 |
append(String value)
public RichText append(String value)
向最后的文本范围添加字符串。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 值 | java.lang.String | 添加的值。 |
Returns: RichText - The RichText.
append(String value, TextStyle style)
public final RichText append(String value, TextStyle style)
在末尾添加字符串。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 值 | java.lang.String | 添加的值。 |
| style | TextStyle | 添加字符串的样式。 |
Returns: RichText - The RichText.
appendFront(String value)
public RichText appendFront(String value)
在第一个文本范围的前面添加字符串。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 值 | java.lang.String | 添加的值。 |
Returns: RichText - The RichText.
appendFront(String value, TextStyle style)
public RichText appendFront(String value, TextStyle style)
在前面添加字符串。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 值 | java.lang.String | 添加的值。 |
| style | TextStyle | 添加字符串的样式。 |
Returns: RichText - The RichText.
clear()
public final RichText clear()
清除此实例的内容。
Returns: RichText - The RichText.
getAlignment()
public int getAlignment()
获取对齐方式。
Returns: int
getLastModifiedTime()
public Date getLastModifiedTime()
获取最后修改时间。
Returns: java.util.Date
getLength()
public final int getLength()
Returns: int
getLineSpacing()
public Float getLineSpacing()
获取行间距。
Returns: java.lang.Float
getParagraphStyle()
public final ParagraphStyle getParagraphStyle()
获取段落样式。如果在 getStyles 集合中没有匹配的 TextStyle 对象,或者此对象未指定所需设置,则使用这些设置。
Returns: ParagraphStyle
getSpaceAfter()
public Float getSpaceAfter()
获取后面的最小间距。
Returns: java.lang.Float
getSpaceBefore()
public Float getSpaceBefore()
获取前面的最小间距。
Returns: java.lang.Float
getStyles()
public System.Collections.Generic.IGenericEnumerable<TextStyle> getStyles()
获取样式。
Returns: com.aspose.ms.System.Collections.Generic.IGenericEnumerable<com.aspose.note.TextStyle>
getTags()
public final System.Collections.Generic.List<ITag> getTags()
获取段落的所有标签列表。
Returns: com.aspose.ms.System.Collections.Generic.List<com.aspose.note.ITag>
getText()
public final String getText()
获取文本。字符串不得包含值为 10(换行)的任何字符。
Returns: java.lang.String
getTextRuns()
public final System.Collections.Generic.IGenericEnumerable<TextRun> getTextRuns()
Returns: com.aspose.ms.System.Collections.Generic.IGenericEnumerable<com.aspose.note.TextRun>
indexOf(char value)
public final int indexOf(char value)
返回此字符串中指定 Unicode 字符首次出现的零基索引。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 值 | char | 该值。 |
Returns:
int - 该 int。
indexOf(char value, int startIndex)
public final int indexOf(char value, int startIndex)
返回此字符串中指定 Unicode 字符首次出现的零基索引。搜索从指定的字符位置开始。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 值 | char | 该值。 |
| startIndex | int | 起始搜索位置 |
Returns:
int - 该 int。
indexOf(char value, int startIndex, int count)
public final int indexOf(char value, int startIndex, int count)
返回此实例中指定字符首次出现的零基索引。搜索从指定的字符位置开始,并检查指定数量的字符位置。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 值 | char | 该值。 |
| startIndex | int | 起始搜索位置 |
| count | int | 计数。 |
Returns:
int - 该 int。
indexOf(String value)
public final int indexOf(String value)
返回此实例中指定字符串首次出现的零基索引。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 值 | java.lang.String | 该值。 |
Returns:
int - 该 int。
indexOf(String value, int startIndex)
public final int indexOf(String value, int startIndex)
返回此实例中指定字符串首次出现的零基索引。搜索从指定的字符位置开始。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 值 | java.lang.String | 该值。 |
| startIndex | int | 起始搜索位置 |
Returns:
int - 该 int。
indexOf(String value, int startIndex, int count)
public final int indexOf(String value, int startIndex, int count)
返回此实例中指定字符串首次出现的零基索引。搜索从指定的字符位置开始,并检查指定数量的字符位置。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 值 | java.lang.String | 该值。 |
| startIndex | int | 起始搜索位置 |
| count | int | 计数。 |
Returns:
int - 该 int。
indexOf(String value, int startIndex, int count, short comparisonType)
public final int indexOf(String value, int startIndex, int count, short comparisonType)
返回当前实例中指定字符串首次出现的零基索引。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 值 | java.lang.String | 该值。 |
| startIndex | int | 起始搜索位置 |
| count | int | 计数。 |
| comparisonType | short | 用于指定字符串的搜索类型 |
Returns:
int - 该 int。
indexOf(String value, short comparisonType)
public final int indexOf(String value, short comparisonType)
返回当前实例中指定字符串首次出现的零基索引。参数指定用于指定字符串的搜索类型。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 值 | java.lang.String | 该值。 |
| comparisonType | short | 用于指定字符串的搜索类型 |
Returns:
int - 该 int。
indexOf_Rename_Namesake(String value, int startIndex, short comparisonType)
public final int indexOf_Rename_Namesake(String value, int startIndex, short comparisonType)
返回当前实例中指定字符串首次出现的零基索引。参数指定当前字符串的起始搜索位置以及用于指定字符串的搜索类型。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 值 | java.lang.String | 该值。 |
| startIndex | int | 起始搜索位置 |
| comparisonType | short | 用于指定字符串的搜索类型 |
Returns:
int - 该 int。
insert(int startIndex, String value)
public final RichText insert(int startIndex, String value)
在此实例的指定索引位置插入指定字符串。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| startIndex | int | 起始索引。 |
| 值 | java.lang.String | 该值。 |
Returns: RichText - The RichText.
insert(int startIndex, String value, TextStyle style)
public final RichText insert(int startIndex, String value, TextStyle style)
在此实例的指定索引位置插入带有指定样式的指定字符串。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| startIndex | int | 起始索引。 |
| 值 | java.lang.String | 该值。 |
| style | TextStyle | 样式。 |
Returns: RichText - The RichText.
iterator()
public System.Collections.Generic.IGenericEnumerator<Character> iterator()
Returns: com.aspose.ms.System.Collections.Generic.IGenericEnumerator<java.lang.Character>
remove(int startIndex)
public final RichText remove(int startIndex)
从指定位置开始,删除当前实例中一直到最后位置的所有字符。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| startIndex | int | 起始索引。 |
Returns: RichText - The RichText.
remove(int startIndex, int count)
public final RichText remove(int startIndex, int count)
从指定位置开始,删除当前实例中指定数量的字符。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| startIndex | int | 起始索引。 |
| count | int | 计数。 |
Returns: RichText - The RichText.
replace(char oldChar, char newChar)
public final RichText replace(char oldChar, char newChar)
将此实例中所有指定 Unicode 字符的出现替换为另一个指定的 Unicode 字符。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| oldChar | char | 旧字符。 |
| newChar | char | 新字符。 |
Returns: RichText - The RichText.
replace(String oldValue, String newValue)
public final RichText replace(String oldValue, String newValue)
将当前实例中所有指定字符串的出现替换为另一个指定字符串。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| oldValue | java.lang.String | 旧值。 |
| newValue | java.lang.String | 新值。 |
Returns: RichText - The RichText.
replace(String oldValue, String newValue, TextStyle style)
public final RichText replace(String oldValue, String newValue, TextStyle style)
将当前实例中所有指定字符串的出现替换为另一个指定样式的指定字符串。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| oldValue | java.lang.String | 旧值。 |
| newValue | java.lang.String | 新值。 |
| style | TextStyle | 新值的样式。 |
Returns: RichText - The RichText.
setAlignment(int value)
public void setAlignment(int value)
设置对齐方式。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 值 | int |
setLastModifiedTime(Date value)
public void setLastModifiedTime(Date value)
设置最后修改时间。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 值 | java.util.Date |
setLineSpacing(float value)
public void setLineSpacing(float value)
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 值 | float |
setLineSpacing(Float value)
public void setLineSpacing(Float value)
设置行间距。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 值 | java.lang.Float |
setParagraphStyle(ParagraphStyle value)
public final void setParagraphStyle(ParagraphStyle value)
设置段落样式。如果在getStyles集合中没有匹配的 TextStyle 对象,或者此对象未指定所需设置,则使用这些设置。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| value | ParagraphStyle |
setSpaceAfter(float value)
public void setSpaceAfter(float value)
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 值 | float |
setSpaceAfter(Float value)
public void setSpaceAfter(Float value)
设置后面的最小间距。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 值 | java.lang.Float |
setSpaceBefore(float value)
public void setSpaceBefore(float value)
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 值 | float |
setSpaceBefore(Float value)
public void setSpaceBefore(Float value)
设置之前的最小空间量。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 值 | java.lang.Float |
setText(String value)
public final void setText(String value)
设置文本。字符串不得包含值为 10 的字符(换行符)。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 值 | java.lang.String |
trim()
public final RichText trim()
删除所有前导和尾随的空白字符。
Returns: RichText - The RichText.
trim(char trimChar)
public final RichText trim(char trimChar)
删除所有前导和尾随的字符实例。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| trimChar | char | 修剪字符。 |
Returns: RichText - The RichText.
trim(char[] trimChars)
public final RichText trim(char[] trimChars)
删除数组中指定的一组字符的所有前导和尾随出现。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| trimChars | char[] | 修剪字符。 |
Returns: RichText - The RichText.
trimEnd()
public final RichText trimEnd()
删除所有尾随的空白字符。
Returns: RichText - The RichText.
trimEnd(char trimChar)
public final RichText trimEnd(char trimChar)
删除字符的所有尾随出现。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| trimChar | char | 修剪字符。 |
Returns: RichText - The RichText.
trimEnd(char[] trimChars)
public final RichText trimEnd(char[] trimChars)
删除数组中指定的一组字符的所有尾随出现。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| trimChars | char[] | 修剪字符。 |
Returns: RichText - The RichText.
trimStart()
public final RichText trimStart()
删除所有前导的空白字符。
Returns: RichText - The RichText.
trimStart(char trimChar)
public final RichText trimStart(char trimChar)
删除指定字符的所有前导出现。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| trimChar | char | 修剪字符。 |
Returns: RichText - The RichText.
trimStart(char[] trimChars)
public final RichText trimStart(char[] trimChars)
删除数组中指定的一组字符的所有前导出现。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| trimChars | char[] | 修剪字符。 |