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 TypeMethodDescriptionvoidcreateLink(String url) Creates a link to the supplied URL.Gets the background color.Gets the foreground color.voidInserts a horizontal rule.voidinsertHTML(String html) Inserts generic html.voidinsertImage(String url) Inserts an image element.voidStarts an numbered list.voidStarts an bulleted list.booleanisBold()Is the current region bold?booleanisItalic()Is the current region italic?booleanIs the current region strikethrough?booleanIs the current region subscript?booleanIs the current region superscript?booleanIs the current region underlined?voidLeft indent.voidredo()Redo an action that was just undone.voidRemoves all formatting on the selected text.voidRemoves any link from the selected text.voidRight indent.voidSelects all the text.voidsetBackColor(String color) Sets the background color.voidsetFontName(String name) Sets the font name.voidsetFontSize(RichTextArea.FontSize fontSize) Sets the font size.voidsetForeColor(String color) Sets the foreground color.voidsetJustification(RichTextArea.Justification justification) Sets the justification.voidToggles bold.voidToggles italic.voidToggles strikethrough.voidToggles subscript.voidToggles superscript.voidToggles underline.voidundo()Undo the last action.
-
Method Details
-
createLink
Creates a link to the supplied URL.- Specified by:
createLinkin interfaceRichTextArea.ExtendedFormatter- Parameters:
url- the URL to be linked to
-
getBackColor
String getBackColor()Gets the background color.- Specified by:
getBackColorin interfaceRichTextArea.BasicFormatter- Returns:
- the background color
-
getForeColor
String getForeColor()Gets the foreground color.- Specified by:
getForeColorin interfaceRichTextArea.BasicFormatter- Returns:
- the foreground color
-
insertHorizontalRule
void insertHorizontalRule()Inserts a horizontal rule.- Specified by:
insertHorizontalRulein interfaceRichTextArea.ExtendedFormatter
-
insertHTML
Inserts generic html.- Parameters:
html- the HTML to insert
-
insertImage
Inserts an image element.- Specified by:
insertImagein 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:
insertOrderedListin interfaceRichTextArea.ExtendedFormatter
-
insertUnorderedList
void insertUnorderedList()Starts an bulleted list. Indentation will create nested items.- Specified by:
insertUnorderedListin interfaceRichTextArea.ExtendedFormatter
-
isBold
boolean isBold()Is the current region bold?- Specified by:
isBoldin interfaceRichTextArea.BasicFormatter- Returns:
- true if the current region is bold
-
isItalic
boolean isItalic()Is the current region italic?- Specified by:
isItalicin interfaceRichTextArea.BasicFormatter- Returns:
- true if the current region is italic
-
isStrikethrough
boolean isStrikethrough()Is the current region strikethrough?- Specified by:
isStrikethroughin interfaceRichTextArea.ExtendedFormatter- Returns:
- true if the current region is strikethrough
-
isSubscript
boolean isSubscript()Is the current region subscript?- Specified by:
isSubscriptin interfaceRichTextArea.BasicFormatter- Returns:
- true if the current region is subscript
-
isSuperscript
boolean isSuperscript()Is the current region superscript?- Specified by:
isSuperscriptin interfaceRichTextArea.BasicFormatter- Returns:
- true if the current region is superscript
-
isUnderlined
boolean isUnderlined()Is the current region underlined?- Specified by:
isUnderlinedin interfaceRichTextArea.BasicFormatter- Returns:
- true if the current region is underlined
-
leftIndent
void leftIndent()Left indent.- Specified by:
leftIndentin interfaceRichTextArea.ExtendedFormatter
-
redo
void redo()Redo an action that was just undone. -
removeFormat
void removeFormat()Removes all formatting on the selected text.- Specified by:
removeFormatin interfaceRichTextArea.ExtendedFormatter
-
removeLink
void removeLink()Removes any link from the selected text.- Specified by:
removeLinkin interfaceRichTextArea.ExtendedFormatter
-
rightIndent
void rightIndent()Right indent.- Specified by:
rightIndentin interfaceRichTextArea.ExtendedFormatter
-
selectAll
void selectAll()Selects all the text.- Specified by:
selectAllin interfaceRichTextArea.BasicFormatter
-
setBackColor
Sets the background color.- Specified by:
setBackColorin interfaceRichTextArea.BasicFormatter- Parameters:
color- the new background color
-
setFontName
Sets the font name.- Specified by:
setFontNamein interfaceRichTextArea.BasicFormatter- Parameters:
name- the new font name
-
setFontSize
Sets the font size.- Specified by:
setFontSizein interfaceRichTextArea.BasicFormatter- Parameters:
fontSize- the new font size
-
setForeColor
Sets the foreground color.- Specified by:
setForeColorin interfaceRichTextArea.BasicFormatter- Parameters:
color- the new foreground color
-
setJustification
Sets the justification.- Specified by:
setJustificationin interfaceRichTextArea.BasicFormatter- Parameters:
justification- the new justification
-
toggleBold
void toggleBold()Toggles bold.- Specified by:
toggleBoldin interfaceRichTextArea.BasicFormatter
-
toggleItalic
void toggleItalic()Toggles italic.- Specified by:
toggleItalicin interfaceRichTextArea.BasicFormatter
-
toggleStrikethrough
void toggleStrikethrough()Toggles strikethrough.- Specified by:
toggleStrikethroughin interfaceRichTextArea.ExtendedFormatter
-
toggleSubscript
void toggleSubscript()Toggles subscript.- Specified by:
toggleSubscriptin interfaceRichTextArea.BasicFormatter
-
toggleSuperscript
void toggleSuperscript()Toggles superscript.- Specified by:
toggleSuperscriptin interfaceRichTextArea.BasicFormatter
-
toggleUnderline
void toggleUnderline()Toggles underline.- Specified by:
toggleUnderlinein interfaceRichTextArea.BasicFormatter
-
undo
void undo()Undo the last action.
-