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(String url)
Creates a link to the supplied URL.
|
String |
getBackColor()
Gets the background color.
|
String |
getForeColor()
Gets the foreground color.
|
void |
insertHorizontalRule()
Inserts a horizontal rule.
|
void |
insertHTML(String html)
Inserts generic html.
|
void |
insertImage(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(String color)
Sets the background color.
|
void |
setFontName(String name)
Sets the font name.
|
void |
setFontSize(RichTextArea.FontSize fontSize)
Sets the font size.
|
void |
setForeColor(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(String url)
createLink
in interface RichTextArea.ExtendedFormatter
url
- the URL to be linked toString getBackColor()
getBackColor
in interface RichTextArea.BasicFormatter
String getForeColor()
getForeColor
in interface RichTextArea.BasicFormatter
void insertHorizontalRule()
insertHorizontalRule
in interface RichTextArea.ExtendedFormatter
void insertHTML(String html)
html
- the HTML to insertvoid insertImage(String url)
insertImage
in interface RichTextArea.ExtendedFormatter
url
- the url of the image to be insertedvoid insertOrderedList()
insertOrderedList
in interface RichTextArea.ExtendedFormatter
void insertUnorderedList()
insertUnorderedList
in interface RichTextArea.ExtendedFormatter
boolean isBold()
isBold
in interface RichTextArea.BasicFormatter
boolean isItalic()
isItalic
in interface RichTextArea.BasicFormatter
boolean isStrikethrough()
isStrikethrough
in interface RichTextArea.ExtendedFormatter
boolean isSubscript()
isSubscript
in interface RichTextArea.BasicFormatter
boolean isSuperscript()
isSuperscript
in interface RichTextArea.BasicFormatter
boolean isUnderlined()
isUnderlined
in interface RichTextArea.BasicFormatter
void leftIndent()
leftIndent
in interface RichTextArea.ExtendedFormatter
void redo()
void removeFormat()
removeFormat
in interface RichTextArea.ExtendedFormatter
void removeLink()
removeLink
in interface RichTextArea.ExtendedFormatter
void rightIndent()
rightIndent
in interface RichTextArea.ExtendedFormatter
void selectAll()
selectAll
in interface RichTextArea.BasicFormatter
void setBackColor(String color)
setBackColor
in interface RichTextArea.BasicFormatter
color
- the new background colorvoid setFontName(String name)
setFontName
in interface RichTextArea.BasicFormatter
name
- the new font namevoid setFontSize(RichTextArea.FontSize fontSize)
setFontSize
in interface RichTextArea.BasicFormatter
fontSize
- the new font sizevoid setForeColor(String color)
setForeColor
in interface RichTextArea.BasicFormatter
color
- the new foreground colorvoid setJustification(RichTextArea.Justification justification)
setJustification
in interface RichTextArea.BasicFormatter
justification
- the new justificationvoid toggleBold()
toggleBold
in interface RichTextArea.BasicFormatter
void toggleItalic()
toggleItalic
in interface RichTextArea.BasicFormatter
void toggleStrikethrough()
toggleStrikethrough
in interface RichTextArea.ExtendedFormatter
void toggleSubscript()
toggleSubscript
in interface RichTextArea.BasicFormatter
void toggleSuperscript()
toggleSuperscript
in interface RichTextArea.BasicFormatter
void toggleUnderline()
toggleUnderline
in interface RichTextArea.BasicFormatter
void undo()
Copyright © 2018. All rights reserved.