public static interface RichTextArea.Formatter extends RichTextArea.ExtendedFormatter
This interface is used to access full formatting options, when available.
If the implementation supports full formatting, then
RichTextArea.getFormatter() will return an instance of this class.
The formatter will format the user selected text in the
RichTextArea. As a result, it will only work reliably if the
RichTextArea is attached, visible to on the page, and has been
focused at least once. If you just want to initialize the content of the
RichTextArea, use RichTextArea.setHTML(String) instead.
| Modifier and Type | Method and Description |
|---|---|
void |
createLink(java.lang.String url)
Creates a link to the supplied URL.
|
java.lang.String |
getBackColor()
Gets the background color.
|
java.lang.String |
getForeColor()
Gets the foreground color.
|
void |
insertHorizontalRule()
Inserts a horizontal rule.
|
void |
insertHTML(java.lang.String html)
Inserts generic html.
|
void |
insertImage(java.lang.String url)
Inserts an image element.
|
void |
insertOrderedList()
Starts an numbered list.
|
void |
insertUnorderedList()
Starts an bulleted list.
|
boolean |
isBold()
Is the current region bold?
|
boolean |
isItalic()
Is the current region italic?
|
boolean |
isStrikethrough()
Is the current region strikethrough?
|
boolean |
isSubscript()
Is the current region subscript?
|
boolean |
isSuperscript()
Is the current region superscript?
|
boolean |
isUnderlined()
Is the current region underlined?
|
void |
leftIndent()
Left indent.
|
void |
redo()
Redo an action that was just undone.
|
void |
removeFormat()
Removes all formatting on the selected text.
|
void |
removeLink()
Removes any link from the selected text.
|
void |
rightIndent()
Right indent.
|
void |
selectAll()
Selects all the text.
|
void |
setBackColor(java.lang.String color)
Sets the background color.
|
void |
setFontName(java.lang.String name)
Sets the font name.
|
void |
setFontSize(RichTextArea.FontSize fontSize)
Sets the font size.
|
void |
setForeColor(java.lang.String color)
Sets the foreground color.
|
void |
setJustification(RichTextArea.Justification justification)
Sets the justification.
|
void |
toggleBold()
Toggles bold.
|
void |
toggleItalic()
Toggles italic.
|
void |
toggleStrikethrough()
Toggles strikethrough.
|
void |
toggleSubscript()
Toggles subscript.
|
void |
toggleSuperscript()
Toggles superscript.
|
void |
toggleUnderline()
Toggles underline.
|
void |
undo()
Undo the last action.
|
void createLink(java.lang.String url)
createLink in interface RichTextArea.ExtendedFormatterurl - the URL to be linked tojava.lang.String getBackColor()
getBackColor in interface RichTextArea.BasicFormatterjava.lang.String getForeColor()
getForeColor in interface RichTextArea.BasicFormattervoid insertHorizontalRule()
insertHorizontalRule in interface RichTextArea.ExtendedFormattervoid insertHTML(java.lang.String html)
html - the HTML to insertvoid insertImage(java.lang.String url)
insertImage in interface RichTextArea.ExtendedFormatterurl - the url of the image to be insertedvoid insertOrderedList()
insertOrderedList in interface RichTextArea.ExtendedFormattervoid insertUnorderedList()
insertUnorderedList in interface RichTextArea.ExtendedFormatterboolean isBold()
isBold in interface RichTextArea.BasicFormatterboolean isItalic()
isItalic in interface RichTextArea.BasicFormatterboolean isStrikethrough()
isStrikethrough in interface RichTextArea.ExtendedFormatterboolean isSubscript()
isSubscript in interface RichTextArea.BasicFormatterboolean isSuperscript()
isSuperscript in interface RichTextArea.BasicFormatterboolean isUnderlined()
isUnderlined in interface RichTextArea.BasicFormattervoid leftIndent()
leftIndent in interface RichTextArea.ExtendedFormattervoid redo()
void removeFormat()
removeFormat in interface RichTextArea.ExtendedFormattervoid removeLink()
removeLink in interface RichTextArea.ExtendedFormattervoid rightIndent()
rightIndent in interface RichTextArea.ExtendedFormattervoid selectAll()
selectAll in interface RichTextArea.BasicFormattervoid setBackColor(java.lang.String color)
setBackColor in interface RichTextArea.BasicFormattercolor - the new background colorvoid setFontName(java.lang.String name)
setFontName in interface RichTextArea.BasicFormattername - the new font namevoid setFontSize(RichTextArea.FontSize fontSize)
setFontSize in interface RichTextArea.BasicFormatterfontSize - the new font sizevoid setForeColor(java.lang.String color)
setForeColor in interface RichTextArea.BasicFormattercolor - the new foreground colorvoid setJustification(RichTextArea.Justification justification)
setJustification in interface RichTextArea.BasicFormatterjustification - the new justificationvoid toggleBold()
toggleBold in interface RichTextArea.BasicFormattervoid toggleItalic()
toggleItalic in interface RichTextArea.BasicFormattervoid toggleStrikethrough()
toggleStrikethrough in interface RichTextArea.ExtendedFormattervoid toggleSubscript()
toggleSubscript in interface RichTextArea.BasicFormattervoid toggleSuperscript()
toggleSuperscript in interface RichTextArea.BasicFormattervoid toggleUnderline()
toggleUnderline in interface RichTextArea.BasicFormattervoid undo()