public class RichText extends Node implements IOutlineElementChildNode, ITaggable, com.aspose.ms.System.Collections.Generic.IGenericEnumerable<Character>
Represents a rich text.
Constructor and Description |
---|
RichText()
Initializes a new instance of the
RichText class. |
RichText(Document document)
Deprecated.
Obsolete since 22.1 release. Use other constructors instead.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(DocumentVisitor visitor)
Accepts the visitor of the node.
|
RichText |
append(String value)
Adds a string to the last text range.
|
RichText |
append(String value,
TextStyle style)
Adds a string to the end.
|
RichText |
appendFront(String value)
Adds a string to the front of the first text range.
|
RichText |
appendFront(String value,
TextStyle style)
Adds a string to the front.
|
RichText |
clear()
Clears content of this instance.
|
int |
getAlignment()
Gets the alignment.
|
Date |
getLastModifiedTime()
Gets the last modified time.
|
int |
getLength() |
Float |
getLineSpacing()
Gets the line spacing.
|
ParagraphStyle |
getParagraphStyle()
Gets the paragraph style.
|
Float |
getSpaceAfter()
Gets the minimum amount of space after.
|
Float |
getSpaceBefore()
Gets the minimum amount of space before.
|
com.aspose.ms.System.Collections.Generic.IGenericEnumerable<TextStyle> |
getStyles()
Deprecated.
Obsolete since 22.5 release. Use getTextRuns.
|
com.aspose.ms.System.Collections.Generic.List<ITag> |
getTags()
Gets the list of all tags of a paragraph.
|
String |
getText()
Gets the text.
|
com.aspose.ms.System.Collections.Generic.IGenericEnumerable<TextRun> |
getTextRuns() |
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.
|
int |
indexOf(char value)
Returns the zero-based index of the first occurrence of the specified Unicode character in this string.
|
int |
indexOf(char value,
int startIndex)
Returns the zero-based index of the first occurrence of the specified Unicode character in this string.
|
int |
indexOf(char value,
int startIndex,
int count)
Returns the zero-based index of the first occurrence of the specified character in this instance.
|
int |
indexOf(String value)
Returns the zero-based index of the first occurrence of the specified string in this instance.
|
int |
indexOf(String value,
int startIndex)
Returns the zero-based index of the first occurrence of the specified string in this instance.
|
int |
indexOf(String value,
int startIndex,
int count)
Returns the zero-based index of the first occurrence of the specified string in this instance.
|
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.
|
int |
indexOf(String value,
short comparisonType)
Returns the zero-based index of the first occurrence of the specified string in the current instance.
|
RichText |
insert(int startIndex,
String value)
Inserts a specified string at a specified index position in this instance.
|
RichText |
insert(int startIndex,
String value,
TextStyle style)
Inserts a specified string with specified style at a specified index position in this instance.
|
com.aspose.ms.System.Collections.Generic.IGenericEnumerator<Character> |
iterator() |
RichText |
remove(int startIndex)
Removes all the characters in the current instance, beginning at a specified position and continuing through the last position.
|
RichText |
remove(int startIndex,
int count)
Removes specified number of characters in the current instance beginning at a specified position.
|
RichText |
replace(char oldChar,
char newChar)
Replaces all occurrences of a specified Unicode character in this instance with another specified Unicode character.
|
RichText |
replace(String oldValue,
String newValue)
Replaces all occurrences of a specified string in the current instance with another specified string.
|
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.
|
void |
setAlignment(int value)
Sets the alignment.
|
void |
setLastModifiedTime(Date value)
Sets the last modified time.
|
void |
setLineSpacing(float value) |
void |
setLineSpacing(Float value)
Sets the line spacing.
|
void |
setParagraphStyle(ParagraphStyle value)
Sets the paragraph style.
|
void |
setSpaceAfter(float value) |
void |
setSpaceAfter(Float value)
Sets the minimum amount of space after.
|
void |
setSpaceBefore(float value) |
void |
setSpaceBefore(Float value)
Sets the minimum amount of space before.
|
void |
setText(String value)
Sets the text.
|
RichText |
trim()
Removes all leading and trailing white-space characters.
|
RichText |
trim(char... trimChars)
Removes all leading and trailing occurrences of a set of characters specified in an array.
|
RichText |
trim(char trimChar)
Removes all leading and trailing instances of a character.
|
RichText |
trimEnd()
Removes all the trailing white-space characters.
|
RichText |
trimEnd(char... trimChars)
Removes all the trailing occurrences of a set of characters specified in an array.
|
RichText |
trimEnd(char trimChar)
Removes all the trailing occurrences of a character.
|
RichText |
trimStart()
Removes all the leading white-space characters.
|
RichText |
trimStart(char... trimChars)
Removes all the leading occurrences of a set of characters specified in an array.
|
RichText |
trimStart(char trimChar)
Removes all the leading occurrences of a specified character.
|
getDocument, getNextSibling, getNodeType, getParentNode, getPreviousSibling, isComposite
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getNextSibling, getPreviousSibling
forEach, spliterator
@Deprecated public RichText(Document document)
Initializes a new instance of the RichText
class.
document
- The parent document of the rich text.public RichText()
Initializes a new instance of the RichText
class.
public Date getLastModifiedTime()
Gets the last modified time.
public void setLastModifiedTime(Date value)
Sets the last modified time.
public final String getText()
Gets the text. The string MUST NOT contain any characters of the value 10 (line feed).
public final void setText(String value)
Sets the text. The string MUST NOT contain any characters of the value 10 (line feed).
public final int getLength()
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.
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.
public int getAlignment()
Gets the alignment.
HorizontalAlignment
.public void setAlignment(int value)
Sets the alignment.
public Float getSpaceBefore()
Gets the minimum amount of space before.
public void setSpaceBefore(Float value)
Sets the minimum amount of space before.
public void setSpaceBefore(float value)
public Float getSpaceAfter()
Gets the minimum amount of space after.
public void setSpaceAfter(Float value)
Sets the minimum amount of space after.
public void setSpaceAfter(float value)
public Float getLineSpacing()
Gets the line spacing.
public void setLineSpacing(Float value)
Sets the line spacing.
public void setLineSpacing(float value)
public com.aspose.ms.System.Collections.Generic.IGenericEnumerable<TextStyle> getStyles()
Gets the styles.
public final com.aspose.ms.System.Collections.Generic.IGenericEnumerable<TextRun> getTextRuns()
public final com.aspose.ms.System.Collections.Generic.List<ITag> getTags()
Gets the list of all tags of a paragraph.
public void accept(DocumentVisitor visitor)
Accepts the visitor of the node.
accept
in interface INode
accept
in class Node
visitor
- The object of a class derived from the DocumentVisitor
.public final RichText insert(int startIndex, String value)
Inserts a specified string at a specified index position in this instance.
startIndex
- The start index.value
- The value.RichText
.IllegalArgumentException
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.
startIndex
- The start index.value
- The value.style
- The style.RichText
.IllegalArgumentException
public RichText appendFront(String value)
Adds a string to the front of the first text range.
value
- The added value.RichText
.public RichText appendFront(String value, TextStyle style)
Adds a string to the front.
value
- The added value.style
- The style of added string.RichText
.public final RichText append(String value, TextStyle style)
Adds a string to the end.
value
- The added value.style
- The style of added string.RichText
.public RichText append(String value)
Adds a string to the last text range.
value
- The added value.RichText
.public final RichText remove(int startIndex, int count)
Removes specified number of characters in the current instance beginning at a specified position.
startIndex
- The start index.count
- The count.RichText
.IllegalArgumentException
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.
startIndex
- The start index.RichText
.IllegalArgumentException
public final RichText replace(char oldChar, char newChar)
Replaces all occurrences of a specified Unicode character in this instance with another specified Unicode character.
oldChar
- The old char.newChar
- The new char.RichText
.public final RichText replace(String oldValue, String newValue)
Replaces all occurrences of a specified string in the current instance with another specified string.
oldValue
- The old value.newValue
- The new value.RichText
.IllegalArgumentException
IllegalArgumentException
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.
oldValue
- The old value.newValue
- The new value.style
- The style of the new value.RichText
.IllegalArgumentException
IllegalArgumentException
public final RichText trim(char... trimChars)
Removes all leading and trailing occurrences of a set of characters specified in an array.
trimChars
- The trim chars.RichText
.public final RichText trim(char trimChar)
Removes all leading and trailing instances of a character.
trimChar
- The trim char.RichText
.public final RichText trim()
Removes all leading and trailing white-space characters.
RichText
.public final RichText trimStart(char... trimChars)
Removes all the leading occurrences of a set of characters specified in an array.
trimChars
- The trim chars.RichText
.public final RichText trimStart(char trimChar)
Removes all the leading occurrences of a specified character.
trimChar
- The trim char.RichText
.public final RichText trimStart()
Removes all the leading white-space characters.
RichText
.public final RichText trimEnd(char... trimChars)
Removes all the trailing occurrences of a set of characters specified in an array.
trimChars
- The trim chars.RichText
.public final RichText trimEnd(char trimChar)
Removes all the trailing occurrences of a character.
trimChar
- The trim char.RichText
.public final RichText trimEnd()
Removes all the trailing white-space characters.
RichText
.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.
value
- The value.startIndex
- The starting search positioncount
- The count.comparisonType
- The type of search to use for the specified stringint
.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.
value
- The value.startIndex
- The starting search positioncomparisonType
- The type of search to use for the specified stringint
.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.
value
- The value.startIndex
- The starting search positioncount
- The count.int
.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.
value
- The value.comparisonType
- The type of search to use for the specified stringint
.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.
value
- The value.startIndex
- The starting search positioncount
- The count.int
.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.
value
- The value.startIndex
- The starting search positionint
.public final int indexOf(String value)
Returns the zero-based index of the first occurrence of the specified string in this instance.
value
- The value.int
.public final int indexOf(char value)
Returns the zero-based index of the first occurrence of the specified Unicode character in this string.
value
- The value.int
.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.
value
- The value.startIndex
- The starting search positionint
.public com.aspose.ms.System.Collections.Generic.IGenericEnumerator<Character> iterator()