public class FormattedTextBuilder
extends java.lang.Object
Constructor and Description |
---|
FormattedTextBuilder() |
Modifier and Type | Method and Description |
---|---|
void |
append(char c)
Append a character.
|
void |
append(java.lang.String text)
Append a string of text.
|
void |
apply(ControlChar c)
Apply a control char for formatting.
|
void |
cancel(java.lang.Class<? extends ControlChar> controlClass,
boolean stopAfterFirst)
Cancel the active control char of the specified class.
|
void |
cancelAll()
Cancel all active formatting.
|
java.lang.String |
done()
Finish building the text string.
|
boolean |
isActive(java.lang.Class<? extends ControlChar> controlClass)
Test whether or not a control character is already active.
|
java.lang.String |
toString()
Return the formatted string in its current state.
|
public void append(java.lang.String text)
text
- string of textpublic void append(char c)
c
- characterpublic void apply(ControlChar c)
c
- the control charpublic boolean isActive(java.lang.Class<? extends ControlChar> controlClass)
controlClass
- the class of control charpublic void cancel(java.lang.Class<? extends ControlChar> controlClass, boolean stopAfterFirst)
controlClass
- the class of control charstopAfterFirst
- stop after the first occurrencepublic void cancelAll()
public java.lang.String done()
public java.lang.String toString()
done()
was not yet called, it will print an intermediate state
of the formatted text.)toString
in class java.lang.Object
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.