com.aspose.note

Class RichText

    • Constructor Detail

      • RichText

        @Deprecated
        public RichText(Document document)
        Deprecated. Obsolete since 22.1 release. Use other constructors instead.

        Initializes a new instance of the RichText class.

        Parameters:
        document - The parent document of the rich text.
      • RichText

        public RichText()

        Initializes a new instance of the RichText class.

    • Method Detail

      • getLastModifiedTime

        public Date getLastModifiedTime()

        Gets the last modified time.

      • setLastModifiedTime

        public void setLastModifiedTime(Date value)

        Sets the last modified time.

      • getText

        public final String getText()

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

      • setText

        public final void setText(String value)

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

      • getLength

        public final int getLength()
      • 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.

      • setParagraphStyle

        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.

      • getAlignment

        public int getAlignment()

        Gets the alignment.

        Returns:
        The HorizontalAlignment.
      • setAlignment

        public void setAlignment(int value)

        Sets the alignment.

      • getSpaceBefore

        public Float getSpaceBefore()

        Gets the minimum amount of space before.

      • setSpaceBefore

        public void setSpaceBefore(Float value)

        Sets the minimum amount of space before.

      • setSpaceBefore

        public void setSpaceBefore(float value)
      • getSpaceAfter

        public Float getSpaceAfter()

        Gets the minimum amount of space after.

      • setSpaceAfter

        public void setSpaceAfter(Float value)

        Sets the minimum amount of space after.

      • setSpaceAfter

        public void setSpaceAfter(float value)
      • getLineSpacing

        public Float getLineSpacing()

        Gets the line spacing.

      • setLineSpacing

        public void setLineSpacing(Float value)

        Sets the line spacing.

      • setLineSpacing

        public void setLineSpacing(float value)
      • getStyles

        public com.aspose.ms.System.Collections.Generic.IGenericEnumerable<TextStyle> getStyles()
        Deprecated. Obsolete since 22.5 release. Use getTextRuns.

        Gets the styles.

      • getTextRuns

        public final com.aspose.ms.System.Collections.Generic.IGenericEnumerable<TextRun> getTextRuns()
      • getTags

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

        Gets the list of all tags of a paragraph.

        Specified by:
        getTags in interface ITaggable
      • insert

        public final RichText insert(int startIndex,
                                     String value)

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

        Parameters:
        startIndex - The start index.
        value - The value.
        Returns:
        The RichText.
        Throws:
        IllegalArgumentException
      • insert

        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:
        startIndex - The start index.
        value - The value.
        style - The style.
        Returns:
        The RichText.
        Throws:
        IllegalArgumentException
      • appendFront

        public RichText appendFront(String value)

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

        Parameters:
        value - The added value.
        Returns:
        The RichText.
      • appendFront

        public RichText appendFront(String value,
                                    TextStyle style)

        Adds a string to the front.

        Parameters:
        value - The added value.
        style - The style of added string.
        Returns:
        The RichText.
      • append

        public final RichText append(String value,
                                     TextStyle style)

        Adds a string to the end.

        Parameters:
        value - The added value.
        style - The style of added string.
        Returns:
        The RichText.
      • append

        public RichText append(String value)

        Adds a string to the last text range.

        Parameters:
        value - The added value.
        Returns:
        The RichText.
      • remove

        public final RichText remove(int startIndex,
                                     int count)

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

        Parameters:
        startIndex - The start index.
        count - The count.
        Returns:
        The RichText.
        Throws:
        IllegalArgumentException
      • remove

        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:
        startIndex - The start index.
        Returns:
        The RichText.
        Throws:
        IllegalArgumentException
      • replace

        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:
        oldChar - The old char.
        newChar - The new char.
        Returns:
        The RichText.
      • trim

        public final RichText trim(char... trimChars)

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

        Parameters:
        trimChars - The trim chars.
        Returns:
        The RichText.
      • trim

        public final RichText trim(char trimChar)

        Removes all leading and trailing instances of a character.

        Parameters:
        trimChar - The trim char.
        Returns:
        The RichText.
      • trim

        public final RichText trim()

        Removes all leading and trailing white-space characters.

        Returns:
        The RichText.
      • trimStart

        public final RichText trimStart(char... trimChars)

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

        Parameters:
        trimChars - The trim chars.
        Returns:
        The RichText.
      • trimStart

        public final RichText trimStart(char trimChar)

        Removes all the leading occurrences of a specified character.

        Parameters:
        trimChar - The trim char.
        Returns:
        The RichText.
      • trimStart

        public final RichText trimStart()

        Removes all the leading white-space characters.

        Returns:
        The RichText.
      • trimEnd

        public final RichText trimEnd(char... trimChars)

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

        Parameters:
        trimChars - The trim chars.
        Returns:
        The RichText.
      • trimEnd

        public final RichText trimEnd(char trimChar)

        Removes all the trailing occurrences of a character.

        Parameters:
        trimChar - The trim char.
        Returns:
        The RichText.
      • trimEnd

        public final RichText trimEnd()

        Removes all the trailing white-space characters.

        Returns:
        The RichText.
      • indexOf

        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:
        value - The value.
        startIndex - The starting search position
        count - The count.
        comparisonType - The type of search to use for the specified string
        Returns:
        The int.
      • indexOf_Rename_Namesake

        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:
        value - The value.
        startIndex - The starting search position
        comparisonType - The type of search to use for the specified string
        Returns:
        The int.
      • indexOf

        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:
        value - The value.
        startIndex - The starting search position
        count - The count.
        Returns:
        The int.
      • indexOf

        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:
        value - The value.
        comparisonType - The type of search to use for the specified string
        Returns:
        The int.
      • indexOf

        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:
        value - The value.
        startIndex - The starting search position
        count - The count.
        Returns:
        The int.
      • indexOf

        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:
        value - The value.
        startIndex - The starting search position
        Returns:
        The int.
      • indexOf

        public final int indexOf(String value)

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

        Parameters:
        value - The value.
        Returns:
        The int.
      • indexOf

        public final int indexOf(char value)

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

        Parameters:
        value - The value.
        Returns:
        The int.
      • indexOf

        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:
        value - The value.
        startIndex - The starting search position
        Returns:
        The int.
      • clear

        public final RichText clear()

        Clears content of this instance.

        Returns:
        The RichText.
      • iterator

        public com.aspose.ms.System.Collections.Generic.IGenericEnumerator<Character> iterator()
        Specified by:
        iterator in interface com.aspose.ms.System.Collections.Generic.IGenericEnumerable<Character>
        Specified by:
        iterator in interface com.aspose.ms.System.Collections.IEnumerable<Character>
        Specified by:
        iterator in interface Iterable<Character>