Package com.google.gwt.user.client.ui
Interface RichTextArea.Formatter
- All Superinterfaces:
RichTextArea.BasicFormatter
,RichTextArea.ExtendedFormatter
- Enclosing class:
RichTextArea
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.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
createLink
(String url) Creates a link to the supplied URL.Gets the background color.Gets the foreground color.void
Inserts a horizontal rule.void
insertHTML
(String html) Inserts generic html.void
insertImage
(String url) Inserts an image element.void
Starts an numbered list.void
Starts an bulleted list.boolean
isBold()
Is the current region bold?boolean
isItalic()
Is the current region italic?boolean
Is the current region strikethrough?boolean
Is the current region subscript?boolean
Is the current region superscript?boolean
Is the current region underlined?void
Left indent.void
redo()
Redo an action that was just undone.void
Removes all formatting on the selected text.void
Removes any link from the selected text.void
Right indent.void
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
Toggles bold.void
Toggles italic.void
Toggles strikethrough.void
Toggles subscript.void
Toggles superscript.void
Toggles underline.void
undo()
Undo the last action.
-
Method Details
-
createLink
Creates a link to the supplied URL.- Specified by:
createLink
in interfaceRichTextArea.ExtendedFormatter
- Parameters:
url
- the URL to be linked to
-
getBackColor
String getBackColor()Gets the background color.- Specified by:
getBackColor
in interfaceRichTextArea.BasicFormatter
- Returns:
- the background color
-
getForeColor
String getForeColor()Gets the foreground color.- Specified by:
getForeColor
in interfaceRichTextArea.BasicFormatter
- Returns:
- the foreground color
-
insertHorizontalRule
void insertHorizontalRule()Inserts a horizontal rule.- Specified by:
insertHorizontalRule
in interfaceRichTextArea.ExtendedFormatter
-
insertHTML
Inserts generic html.- Parameters:
html
- the HTML to insert
-
insertImage
Inserts an image element.- Specified by:
insertImage
in interfaceRichTextArea.ExtendedFormatter
- Parameters:
url
- the url of the image to be inserted
-
insertOrderedList
void insertOrderedList()Starts an numbered list. Indentation will create nested items.- Specified by:
insertOrderedList
in interfaceRichTextArea.ExtendedFormatter
-
insertUnorderedList
void insertUnorderedList()Starts an bulleted list. Indentation will create nested items.- Specified by:
insertUnorderedList
in interfaceRichTextArea.ExtendedFormatter
-
isBold
boolean isBold()Is the current region bold?- Specified by:
isBold
in interfaceRichTextArea.BasicFormatter
- Returns:
- true if the current region is bold
-
isItalic
boolean isItalic()Is the current region italic?- Specified by:
isItalic
in interfaceRichTextArea.BasicFormatter
- Returns:
- true if the current region is italic
-
isStrikethrough
boolean isStrikethrough()Is the current region strikethrough?- Specified by:
isStrikethrough
in interfaceRichTextArea.ExtendedFormatter
- Returns:
- true if the current region is strikethrough
-
isSubscript
boolean isSubscript()Is the current region subscript?- Specified by:
isSubscript
in interfaceRichTextArea.BasicFormatter
- Returns:
- true if the current region is subscript
-
isSuperscript
boolean isSuperscript()Is the current region superscript?- Specified by:
isSuperscript
in interfaceRichTextArea.BasicFormatter
- Returns:
- true if the current region is superscript
-
isUnderlined
boolean isUnderlined()Is the current region underlined?- Specified by:
isUnderlined
in interfaceRichTextArea.BasicFormatter
- Returns:
- true if the current region is underlined
-
leftIndent
void leftIndent()Left indent.- Specified by:
leftIndent
in interfaceRichTextArea.ExtendedFormatter
-
redo
void redo()Redo an action that was just undone. -
removeFormat
void removeFormat()Removes all formatting on the selected text.- Specified by:
removeFormat
in interfaceRichTextArea.ExtendedFormatter
-
removeLink
void removeLink()Removes any link from the selected text.- Specified by:
removeLink
in interfaceRichTextArea.ExtendedFormatter
-
rightIndent
void rightIndent()Right indent.- Specified by:
rightIndent
in interfaceRichTextArea.ExtendedFormatter
-
selectAll
void selectAll()Selects all the text.- Specified by:
selectAll
in interfaceRichTextArea.BasicFormatter
-
setBackColor
Sets the background color.- Specified by:
setBackColor
in interfaceRichTextArea.BasicFormatter
- Parameters:
color
- the new background color
-
setFontName
Sets the font name.- Specified by:
setFontName
in interfaceRichTextArea.BasicFormatter
- Parameters:
name
- the new font name
-
setFontSize
Sets the font size.- Specified by:
setFontSize
in interfaceRichTextArea.BasicFormatter
- Parameters:
fontSize
- the new font size
-
setForeColor
Sets the foreground color.- Specified by:
setForeColor
in interfaceRichTextArea.BasicFormatter
- Parameters:
color
- the new foreground color
-
setJustification
Sets the justification.- Specified by:
setJustification
in interfaceRichTextArea.BasicFormatter
- Parameters:
justification
- the new justification
-
toggleBold
void toggleBold()Toggles bold.- Specified by:
toggleBold
in interfaceRichTextArea.BasicFormatter
-
toggleItalic
void toggleItalic()Toggles italic.- Specified by:
toggleItalic
in interfaceRichTextArea.BasicFormatter
-
toggleStrikethrough
void toggleStrikethrough()Toggles strikethrough.- Specified by:
toggleStrikethrough
in interfaceRichTextArea.ExtendedFormatter
-
toggleSubscript
void toggleSubscript()Toggles subscript.- Specified by:
toggleSubscript
in interfaceRichTextArea.BasicFormatter
-
toggleSuperscript
void toggleSuperscript()Toggles superscript.- Specified by:
toggleSuperscript
in interfaceRichTextArea.BasicFormatter
-
toggleUnderline
void toggleUnderline()Toggles underline.- Specified by:
toggleUnderline
in interfaceRichTextArea.BasicFormatter
-
undo
void undo()Undo the last action.
-