Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.
public static final class RichText.Builder
- Object
- RichText.Builder
Accumulates runs into a
RichText.Constructors
public Builder() |
Methods
public RichText.Builder append(String text, TextStyle style) | Appends a run, merging it into the previous one when the styles are equal. |
public RichText.Builder append(Inline object, TextStyle style) | Appends an inline object. |
public RichText.Builder append(RichText text) | Appends every run of a text. |
public int length() | The number of characters appended so far. |
public RichText build() | The text built so far. |
Inherited methods
Constructor details
Builder
public Builder()Method details
append
public RichText.Builder append(String text, TextStyle style)Appends a run, merging it into the previous one when the styles are equal. An
OBJECT character in plain text is replaced by a space: only append(Inline, ...)
places objects.Parameters
textString- the characters; null or empty adds nothing
styleTextStyle- their style
Returns
this builder
append
public RichText.Builder append(Inline object, TextStyle style)Appends an inline object.
Parameters
objectInline- the object; null adds nothing
styleTextStyle- the style of its character
Returns
this builder
append
public RichText.Builder append(RichText text)Appends every run of a text.
Parameters
textRichText- the text to append
Returns
this builder
length
public int length()The number of characters appended so far.
Returns
the length
build
public RichText build()The text built so far.
Returns
an immutable text