Interface TextBuilder<T extends TextBuilder>

    • Method Detail

      • append

        default T append​(TextBuilder builder)
        Append text from given builder
        Parameters:
        builder - builder
        Returns:
        this builder
      • prepend

        default T prepend​(TextBuilder builder)
        Add text to the beginning from the given builder.
        Parameters:
        builder - builder
        Returns:
        this builder
      • prependWithNoWrap

        default T prependWithNoWrap​(java.lang.CharSequence text)
        Add text to the beginning. Added text will not be wrapped if builder supports that.
        Parameters:
        text - text to prepend
        Returns:
        this builder
      • appendWithNoWrap

        default T appendWithNoWrap​(java.lang.CharSequence text)
        Append text from the given builder. Added text will not be wrapped if builder supports that.
        Parameters:
        text - text to prepend
        Returns:
        this builder
      • setText

        default T setText​(TextBuilder builder)
        Replaces current text with the one from the given builder
        Parameters:
        builder - builder
        Returns:
        this builder
      • append

        T append​(java.lang.CharSequence text)
        Append given text
        Parameters:
        text - text to append
        Returns:
        this builder
      • prepend

        T prepend​(java.lang.CharSequence text)
        Add given text to the beginning.
        Parameters:
        text - text to append
        Returns:
        this builder
      • setColor

        default T setColor​(@CheckForNull
                           java.awt.Color color)
        Set color of the text which will be added later. Not every implementation supports that, so color can be ignored.
        Parameters:
        color - color to set. Null is used to reset previously set color
        Returns:
        this builder
      • toString

        java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        Returns:
        result string
      • toPlainText

        java.lang.String toPlainText()
        Returns:
        result string as plain text
      • isPlainTextEmpty

        default boolean isPlainTextEmpty()
        Returns:
        true if text converted to a plain is empty in this builder
      • setText

        void setText​(java.lang.CharSequence text)
        Replace current text with the given one
        Parameters:
        text - text
      • compress

        default void compress​(int textLength)
        Compress current text to the given length. This function is not supported in every implementation, so it can be ignored.
        Parameters:
        textLength - text length
      • isTextAdded

        boolean isTextAdded()
        Returns:
        true if at least one text fragment was added (even if fragment is empty)
      • isColorSupported

        default boolean isColorSupported()
        Returns:
        true if builder supports color