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>

Represents a rich text.

Constructors

Constructor Description
RichText(Document document) Initializes a new instance of the RichText class.
RichText() Initializes a new instance of the RichText class.

Methods

Method Description
getLastModifiedTime() Gets the last modified time.
setLastModifiedTime(Date value) Sets the last modified time.
getText() Gets the text.
setText(String value) Sets the text.
getLength()
getParagraphStyle() Gets the paragraph style.
setParagraphStyle(ParagraphStyle value) Sets the paragraph style.
getAlignment() Gets the alignment.
setAlignment(int value) Sets the alignment.
getSpaceBefore() Gets the minimum amount of space before.
setSpaceBefore(Float value) Sets the minimum amount of space before.
setSpaceBefore(float value)
getSpaceAfter() Gets the minimum amount of space after.
setSpaceAfter(Float value) Sets the minimum amount of space after.
setSpaceAfter(float value)
getLineSpacing() Gets the line spacing.
setLineSpacing(Float value) Sets the line spacing.
setLineSpacing(float value)
getStyles() Gets the styles.
getTextRuns()
getTags() Gets the list of all tags of a paragraph.
accept(DocumentVisitor visitor) Accepts the visitor of the node.
insert(int startIndex, String value) Inserts a specified string at a specified index position in this instance.
insert(int startIndex, String value, TextStyle style) Inserts a specified string with specified style at a specified index position in this instance.
appendFront(String value) Adds a string to the front of the first text range.
appendFront(String value, TextStyle style) Adds a string to the front.
append(String value, TextStyle style) Adds a string to the end.
append(String value) Adds a string to the last text range.
remove(int startIndex, int count) Removes specified number of characters in the current instance beginning at a specified position.
remove(int startIndex) Removes all the characters in the current instance, beginning at a specified position and continuing through the last position.
replace(char oldChar, char newChar) Replaces all occurrences of a specified Unicode character in this instance with another specified Unicode character.
replace(String oldValue, String newValue) Replaces all occurrences of a specified string in the current instance with another specified string.
replace(String oldValue, String newValue, TextStyle style) Replaces all occurrences of a specified string in the current instance with another specified string in specified style.
trim(char[] trimChars) Removes all leading and trailing occurrences of a set of characters specified in an array.
trim(char trimChar) Removes all leading and trailing instances of a character.
trim() Removes all leading and trailing white-space characters.
trimStart(char[] trimChars) Removes all the leading occurrences of a set of characters specified in an array.
trimStart(char trimChar) Removes all the leading occurrences of a specified character.
trimStart() Removes all the leading white-space characters.
trimEnd(char[] trimChars) Removes all the trailing occurrences of a set of characters specified in an array.
trimEnd(char trimChar) Removes all the trailing occurrences of a character.
trimEnd() Removes all the trailing white-space characters.
indexOf(String value, int startIndex, int count, short comparisonType) Returns the zero-based index of the first occurrence of the specified string in the current instance.
indexOf_Rename_Namesake(String value, int startIndex, short comparisonType) Returns the zero-based index of the first occurrence of the specified string in the current instance.
indexOf(char value, int startIndex, int count) Returns the zero-based index of the first occurrence of the specified character in this instance.
indexOf(String value, short comparisonType) Returns the zero-based index of the first occurrence of the specified string in the current instance.
indexOf(String value, int startIndex, int count) Returns the zero-based index of the first occurrence of the specified string in this instance.
indexOf(char value, int startIndex) Returns the zero-based index of the first occurrence of the specified Unicode character in this string.
indexOf(String value) Returns the zero-based index of the first occurrence of the specified string in this instance.
indexOf(char value) Returns the zero-based index of the first occurrence of the specified Unicode character in this string.
indexOf(String value, int startIndex) Returns the zero-based index of the first occurrence of the specified string in this instance.
clear() Clears content of this instance.
iterator()

RichText(Document document)

public RichText(Document document)

Initializes a new instance of the RichText class.

Parameters:

Parameter Type Description
document Document The parent document of the rich text.

RichText()

public RichText()

Initializes a new instance of the RichText class.

getLastModifiedTime()

public Date getLastModifiedTime()

Gets the last modified time.

Returns: java.util.Date

setLastModifiedTime(Date value)

public void setLastModifiedTime(Date value)

Sets the last modified time.

Parameters:

Parameter Type Description
value java.util.Date

getText()

public final String getText()

Gets the text. The string MUST NOT contain any characters of the value 10 (line feed).

Returns: java.lang.String

setText(String value)

public final void setText(String value)

Sets the text. The string MUST NOT contain any characters of the value 10 (line feed).

Parameters:

Parameter Type Description
value java.lang.String

getLength()

public final int getLength()

Returns: int

getParagraphStyle()

public final ParagraphStyle getParagraphStyle()

Gets the paragraph style. These settings are used if there is no matching TextStyle object in getStyles collection either this object doesn’t specify a needed setting.

Returns: ParagraphStyle

setParagraphStyle(ParagraphStyle value)

public final void setParagraphStyle(ParagraphStyle value)

Sets the paragraph style. These settings are used if there is no matching TextStyle object in getStyles collection either this object doesn’t specify a needed setting.

Parameters:

Parameter Type Description
value ParagraphStyle

getAlignment()

public int getAlignment()

Gets the alignment.

Returns: int

setAlignment(int value)

public void setAlignment(int value)

Sets the alignment.

Parameters:

Parameter Type Description
value int

getSpaceBefore()

public Float getSpaceBefore()

Gets the minimum amount of space before.

Returns: java.lang.Float

setSpaceBefore(Float value)

public void setSpaceBefore(Float value)

Sets the minimum amount of space before.

Parameters:

Parameter Type Description
value java.lang.Float

setSpaceBefore(float value)

public void setSpaceBefore(float value)

Parameters:

Parameter Type Description
value float

getSpaceAfter()

public Float getSpaceAfter()

Gets the minimum amount of space after.

Returns: java.lang.Float

setSpaceAfter(Float value)

public void setSpaceAfter(Float value)

Sets the minimum amount of space after.

Parameters:

Parameter Type Description
value java.lang.Float

setSpaceAfter(float value)

public void setSpaceAfter(float value)

Parameters:

Parameter Type Description
value float

getLineSpacing()

public Float getLineSpacing()

Gets the line spacing.

Returns: java.lang.Float

setLineSpacing(Float value)

public void setLineSpacing(Float value)

Sets the line spacing.

Parameters:

Parameter Type Description
value java.lang.Float

setLineSpacing(float value)

public void setLineSpacing(float value)

Parameters:

Parameter Type Description
value float

getStyles()

public System.Collections.Generic.IGenericEnumerable<TextStyle> getStyles()

Gets the styles.

Returns: com.aspose.ms.System.Collections.Generic.IGenericEnumerable<com.aspose.note.TextStyle>

getTextRuns()

public final System.Collections.Generic.IGenericEnumerable<TextRun> getTextRuns()

Returns: com.aspose.ms.System.Collections.Generic.IGenericEnumerable<com.aspose.note.TextRun>

getTags()

public final System.Collections.Generic.List<ITag> getTags()

Gets the list of all tags of a paragraph.

Returns: com.aspose.ms.System.Collections.Generic.List<com.aspose.note.ITag>

accept(DocumentVisitor visitor)

public void accept(DocumentVisitor visitor)

Accepts the visitor of the node.

Parameters:

Parameter Type Description
visitor DocumentVisitor The object of a class derived from the DocumentVisitor.

insert(int startIndex, String value)

public final RichText insert(int startIndex, String value)

Inserts a specified string at a specified index position in this instance.

Parameters:

Parameter Type Description
startIndex int The start index.
value java.lang.String The value.

Returns: RichText - The RichText.

insert(int startIndex, String value, TextStyle style)

public final RichText insert(int startIndex, String value, TextStyle style)

Inserts a specified string with specified style at a specified index position in this instance.

Parameters:

Parameter Type Description
startIndex int The start index.
value java.lang.String The value.
style TextStyle The style.

Returns: RichText - The RichText.

appendFront(String value)

public RichText appendFront(String value)

Adds a string to the front of the first text range.

Parameters:

Parameter Type Description
value java.lang.String The added value.

Returns: RichText - The RichText.

appendFront(String value, TextStyle style)

public RichText appendFront(String value, TextStyle style)

Adds a string to the front.

Parameters:

Parameter Type Description
value java.lang.String The added value.
style TextStyle The style of added string.

Returns: RichText - The RichText.

append(String value, TextStyle style)

public final RichText append(String value, TextStyle style)

Adds a string to the end.

Parameters:

Parameter Type Description
value java.lang.String The added value.
style TextStyle The style of added string.

Returns: RichText - The RichText.

append(String value)

public RichText append(String value)

Adds a string to the last text range.

Parameters:

Parameter Type Description
value java.lang.String The added value.

Returns: RichText - The RichText.

remove(int startIndex, int count)

public final RichText remove(int startIndex, int count)

Removes specified number of characters in the current instance beginning at a specified position.

Parameters:

Parameter Type Description
startIndex int The start index.
count int The count.

Returns: RichText - The RichText.

remove(int startIndex)

public final RichText remove(int startIndex)

Removes all the characters in the current instance, beginning at a specified position and continuing through the last position.

Parameters:

Parameter Type Description
startIndex int The start index.

Returns: RichText - The RichText.

replace(char oldChar, char newChar)

public final RichText replace(char oldChar, char newChar)

Replaces all occurrences of a specified Unicode character in this instance with another specified Unicode character.

Parameters:

Parameter Type Description
oldChar char The old char.
newChar char The new char.

Returns: RichText - The RichText.

replace(String oldValue, String newValue)

public final RichText replace(String oldValue, String newValue)

Replaces all occurrences of a specified string in the current instance with another specified string.

Parameters:

Parameter Type Description
oldValue java.lang.String The old value.
newValue java.lang.String The new value.

Returns: RichText - The RichText.

replace(String oldValue, String newValue, TextStyle style)

public final RichText replace(String oldValue, String newValue, TextStyle style)

Replaces all occurrences of a specified string in the current instance with another specified string in specified style.

Parameters:

Parameter Type Description
oldValue java.lang.String The old value.
newValue java.lang.String The new value.
style TextStyle The style of the new value.

Returns: RichText - The RichText.

trim(char[] trimChars)

public final RichText trim(char[] trimChars)

Removes all leading and trailing occurrences of a set of characters specified in an array.

Parameters:

Parameter Type Description
trimChars char[] The trim chars.

Returns: RichText - The RichText.

trim(char trimChar)

public final RichText trim(char trimChar)

Removes all leading and trailing instances of a character.

Parameters:

Parameter Type Description
trimChar char The trim char.

Returns: RichText - The RichText.

trim()

public final RichText trim()

Removes all leading and trailing white-space characters.

Returns: RichText - The RichText.

trimStart(char[] trimChars)

public final RichText trimStart(char[] trimChars)

Removes all the leading occurrences of a set of characters specified in an array.

Parameters:

Parameter Type Description
trimChars char[] The trim chars.

Returns: RichText - The RichText.

trimStart(char trimChar)

public final RichText trimStart(char trimChar)

Removes all the leading occurrences of a specified character.

Parameters:

Parameter Type Description
trimChar char The trim char.

Returns: RichText - The RichText.

trimStart()

public final RichText trimStart()

Removes all the leading white-space characters.

Returns: RichText - The RichText.

trimEnd(char[] trimChars)

public final RichText trimEnd(char[] trimChars)

Removes all the trailing occurrences of a set of characters specified in an array.

Parameters:

Parameter Type Description
trimChars char[] The trim chars.

Returns: RichText - The RichText.

trimEnd(char trimChar)

public final RichText trimEnd(char trimChar)

Removes all the trailing occurrences of a character.

Parameters:

Parameter Type Description
trimChar char The trim char.

Returns: RichText - The RichText.

trimEnd()

public final RichText trimEnd()

Removes all the trailing white-space characters.

Returns: RichText - The RichText.

indexOf(String value, int startIndex, int count, short comparisonType)

public final int indexOf(String value, int startIndex, int count, short comparisonType)

Returns the zero-based index of the first occurrence of the specified string in the current instance.

Parameters:

Parameter Type Description
value java.lang.String The value.
startIndex int The starting search position
count int The count.
comparisonType short The type of search to use for the specified string

Returns: int - The int .

indexOf_Rename_Namesake(String value, int startIndex, short comparisonType)

public final int indexOf_Rename_Namesake(String value, int startIndex, short comparisonType)

Returns the zero-based index of the first occurrence of the specified string in the current instance. Parameters specify the starting search position in the current string and the type of search to use for the specified string.

Parameters:

Parameter Type Description
value java.lang.String The value.
startIndex int The starting search position
comparisonType short The type of search to use for the specified string

Returns: int - The int .

indexOf(char value, int startIndex, int count)

public final int indexOf(char value, int startIndex, int count)

Returns the zero-based index of the first occurrence of the specified character in this instance. The search starts at a specified character position and examines a specified number of character positions.

Parameters:

Parameter Type Description
value char The value.
startIndex int The starting search position
count int The count.

Returns: int - The int .

indexOf(String value, short comparisonType)

public final int indexOf(String value, short comparisonType)

Returns the zero-based index of the first occurrence of the specified string in the current instance. A parameter specifies the type of search to use for the specified string.

Parameters:

Parameter Type Description
value java.lang.String The value.
comparisonType short The type of search to use for the specified string

Returns: int - The int .

indexOf(String value, int startIndex, int count)

public final int indexOf(String value, int startIndex, int count)

Returns the zero-based index of the first occurrence of the specified string in this instance. The search starts at a specified character position and examines a specified number of character positions.

Parameters:

Parameter Type Description
value java.lang.String The value.
startIndex int The starting search position
count int The count.

Returns: int - The int .

indexOf(char value, int startIndex)

public final int indexOf(char value, int startIndex)

Returns the zero-based index of the first occurrence of the specified Unicode character in this string. The search starts at a specified character position.

Parameters:

Parameter Type Description
value char The value.
startIndex int The starting search position

Returns: int - The int .

indexOf(String value)

public final int indexOf(String value)

Returns the zero-based index of the first occurrence of the specified string in this instance.

Parameters:

Parameter Type Description
value java.lang.String The value.

Returns: int - The int .

indexOf(char value)

public final int indexOf(char value)

Returns the zero-based index of the first occurrence of the specified Unicode character in this string.

Parameters:

Parameter Type Description
value char The value.

Returns: int - The int .

indexOf(String value, int startIndex)

public final int indexOf(String value, int startIndex)

Returns the zero-based index of the first occurrence of the specified string in this instance. The search starts at a specified character position.

Parameters:

Parameter Type Description
value java.lang.String The value.
startIndex int The starting search position

Returns: int - The int .

clear()

public final RichText clear()

Clears content of this instance.

Returns: RichText - The RichText.

iterator()

public System.Collections.Generic.IGenericEnumerator<Character> iterator()

Returns: com.aspose.ms.System.Collections.Generic.IGenericEnumerator<java.lang.Character>