Package com.google.gwt.user.client.ui
Interface RichTextArea.Formatter
-
- All Superinterfaces:
RichTextArea.BasicFormatter
,RichTextArea.ExtendedFormatter
- Enclosing class:
- RichTextArea
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 theRichTextArea
is attached, visible to on the page, and has been focused at least once. If you just want to initialize the content of theRichTextArea
, useRichTextArea.setHTML(String)
instead.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method 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.
-
-
-
Method Detail
-
createLink
void createLink(java.lang.String url)
Creates a link to the supplied URL.- Specified by:
createLink
in interfaceRichTextArea.ExtendedFormatter
- Parameters:
url
- the URL to be linked to
-
getBackColor
java.lang.String getBackColor()
Gets the background color.- Specified by:
getBackColor
in interfaceRichTextArea.BasicFormatter
- Returns:
- the background color
-
getForeColor
java.lang.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
void insertHTML(java.lang.String html)
Inserts generic html.- Parameters:
html
- the HTML to insert
-
insertImage
void insertImage(java.lang.String url)
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
void setBackColor(java.lang.String color)
Sets the background color.- Specified by:
setBackColor
in interfaceRichTextArea.BasicFormatter
- Parameters:
color
- the new background color
-
setFontName
void setFontName(java.lang.String name)
Sets the font name.- Specified by:
setFontName
in interfaceRichTextArea.BasicFormatter
- Parameters:
name
- the new font name
-
setFontSize
void setFontSize(RichTextArea.FontSize fontSize)
Sets the font size.- Specified by:
setFontSize
in interfaceRichTextArea.BasicFormatter
- Parameters:
fontSize
- the new font size
-
setForeColor
void setForeColor(java.lang.String color)
Sets the foreground color.- Specified by:
setForeColor
in interfaceRichTextArea.BasicFormatter
- Parameters:
color
- the new foreground color
-
setJustification
void setJustification(RichTextArea.Justification justification)
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.
-
-