public class TextRun extends Object
The class representing a piece of text with associated style.
Constructor and Description |
---|
TextRun()
Initializes a new instance of the
TextRun class with empty text and default style. |
TextRun(String text)
Initializes a new instance of the
TextRun class with default style. |
TextRun(String text,
TextStyle style)
Initializes a new instance of the
TextRun class. |
TextRun(TextStyle style)
Initializes a new instance of the
TextRun class with empty text. |
Modifier and Type | Method and Description |
---|---|
int |
getLength()
Gets the length of the associated text.
|
TextStyle |
getStyle()
Gets the style.
|
String |
getText()
Gets the text.
|
void |
setStyle(TextStyle value)
Sets the style.
|
void |
setText(String value)
Sets the text.
|
public TextRun(String text, TextStyle style)
Initializes a new instance of the TextRun
class.
text
- The associated text.style
- The style.public TextRun(String text)
Initializes a new instance of the TextRun
class with default style.
text
- The associated text.public TextRun(TextStyle style)
Initializes a new instance of the TextRun
class with empty text.
style
- The style.public TextRun()
Initializes a new instance of the TextRun
class with empty text and default style.
public final String getText()
Gets the text.
public final void setText(String value)
Sets the text.
public final TextStyle getStyle()
Gets the style.
public final void setStyle(TextStyle value)
Sets the style.
public final int getLength()
Gets the length of the associated text.