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 theRichTextAreais 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 voidcreateLink(java.lang.String url)Creates a link to the supplied URL.java.lang.StringgetBackColor()Gets the background color.java.lang.StringgetForeColor()Gets the foreground color.voidinsertHorizontalRule()Inserts a horizontal rule.voidinsertHTML(java.lang.String html)Inserts generic html.voidinsertImage(java.lang.String url)Inserts an image element.voidinsertOrderedList()Starts an numbered list.voidinsertUnorderedList()Starts an bulleted list.booleanisBold()Is the current region bold?booleanisItalic()Is the current region italic?booleanisStrikethrough()Is the current region strikethrough?booleanisSubscript()Is the current region subscript?booleanisSuperscript()Is the current region superscript?booleanisUnderlined()Is the current region underlined?voidleftIndent()Left indent.voidredo()Redo an action that was just undone.voidremoveFormat()Removes all formatting on the selected text.voidremoveLink()Removes any link from the selected text.voidrightIndent()Right indent.voidselectAll()Selects all the text.voidsetBackColor(java.lang.String color)Sets the background color.voidsetFontName(java.lang.String name)Sets the font name.voidsetFontSize(RichTextArea.FontSize fontSize)Sets the font size.voidsetForeColor(java.lang.String color)Sets the foreground color.voidsetJustification(RichTextArea.Justification justification)Sets the justification.voidtoggleBold()Toggles bold.voidtoggleItalic()Toggles italic.voidtoggleStrikethrough()Toggles strikethrough.voidtoggleSubscript()Toggles subscript.voidtoggleSuperscript()Toggles superscript.voidtoggleUnderline()Toggles underline.voidundo()Undo the last action.
-
-
-
Method Detail
-
createLink
void createLink(java.lang.String url)
Creates a link to the supplied URL.- Specified by:
createLinkin interfaceRichTextArea.ExtendedFormatter- Parameters:
url- the URL to be linked to
-
getBackColor
java.lang.String getBackColor()
Gets the background color.- Specified by:
getBackColorin interfaceRichTextArea.BasicFormatter- Returns:
- the background color
-
getForeColor
java.lang.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
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:
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
void setBackColor(java.lang.String color)
Sets the background color.- Specified by:
setBackColorin interfaceRichTextArea.BasicFormatter- Parameters:
color- the new background color
-
setFontName
void setFontName(java.lang.String name)
Sets the font name.- Specified by:
setFontNamein interfaceRichTextArea.BasicFormatter- Parameters:
name- the new font name
-
setFontSize
void setFontSize(RichTextArea.FontSize fontSize)
Sets the font size.- Specified by:
setFontSizein interfaceRichTextArea.BasicFormatter- Parameters:
fontSize- the new font size
-
setForeColor
void setForeColor(java.lang.String color)
Sets the foreground color.- Specified by:
setForeColorin interfaceRichTextArea.BasicFormatter- Parameters:
color- the new foreground color
-
setJustification
void setJustification(RichTextArea.Justification justification)
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.
-
-