Class CMARichText


  • public class CMARichText
    extends CMARichNode
    A leaf element of the rich text node graph: Render a given text with the given markings.
    • Constructor Detail

      • CMARichText

        public CMARichText​(@NonNull
                           java.lang.CharSequence value,
                           @NonNull
                           java.util.List<CMARichMark> marks)
        Create a value with the given marks.
        Parameters:
        value - the value to be displayed.
        marks - the marks to be used if any.
        Throws:
        java.lang.NullPointerException - if one of the arguments is null.
      • CMARichText

        public CMARichText​(@NonNull
                           java.lang.String value)
        Create a text with the given marks.
        Parameters:
        value - the text to be displayed.
        Throws:
        java.lang.NullPointerException - if value is null.
    • Method Detail

      • getValue

        @NonNull
        public java.lang.CharSequence getValue()
        Returns:
        the value text of this node.
      • setValue

        @NonNull
        public CMARichText setValue​(@NonNull
                                    java.lang.CharSequence value)
        Update the value of this text.
        Parameters:
        value - the new value of the text.
        Returns:
        this instance for chaining.
      • getMarks

        @NonNull
        public java.util.List<CMARichMark> getMarks()
        Returns:
        the currently setup marks of this text.
      • addMarks

        @NonNull
        public CMARichText addMarks​(@NonNull
                                    CMARichMark... marks)
        Adds the given marks to this texts marks.
        Parameters:
        marks - defines which marks to be added.
        Returns:
        this instance for chaining.
        Throws:
        java.lang.NullPointerException - if marks is null.
      • setMarks

        @NonNull
        public CMARichText setMarks​(@NonNull
                                    java.util.List<CMARichMark> marks)
        Updates the marks of this text.
        Parameters:
        marks - defines which marks to be used.
        Returns:
        this instance for chaining.
        Throws:
        java.lang.NullPointerException - if marks is null.