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

  1. Object
  2. 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

text String
the characters; null or empty adds nothing
style TextStyle
their style

Returns

this builder

append

public RichText.Builder append(Inline object, TextStyle style)
Appends an inline object.

Parameters

object Inline
the object; null adds nothing
style TextStyle
the style of its character

Returns

this builder

append

public RichText.Builder append(RichText text)
Appends every run of a text.

Parameters

text RichText
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