public class RichTextArea extends FocusWidget implements HasHTML, HasInitializeHandlers, HasSafeHtml
getBasicFormatter()
and getExtendedFormatter()
. A browser that does not support rich text editing at all will return
null
for both of these, while one that supports only the basic
functionality will return null
for the latter.
Modifier and Type | Class and Description |
---|---|
static interface |
RichTextArea.BasicFormatter
Deprecated.
use
RichTextArea.Formatter instead |
static interface |
RichTextArea.ExtendedFormatter
Deprecated.
use
RichTextArea.Formatter instead |
static class |
RichTextArea.FontSize
Font size enumeration.
|
static interface |
RichTextArea.Formatter
This interface is used to access full formatting options, when available.
|
static class |
RichTextArea.Justification
Justification enumeration.
|
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
DEBUG_ID_PREFIX
Constructor and Description |
---|
RichTextArea()
Creates a new, blank
RichTextArea object with no stylesheet. |
Modifier and Type | Method and Description |
---|---|
HandlerRegistration |
addInitializeHandler(InitializeHandler handler)
Adds an
InitializeEvent handler. |
RichTextArea.BasicFormatter |
getBasicFormatter()
Deprecated.
use
getFormatter() instead |
RichTextArea.ExtendedFormatter |
getExtendedFormatter()
Deprecated.
use
getFormatter() instead |
RichTextArea.Formatter |
getFormatter()
Gets the rich text formatting interface.
|
String |
getHTML()
Gets this object's contents as HTML.
|
String |
getText()
Gets this object's text.
|
boolean |
isEnabled()
Gets whether this widget is enabled.
|
protected void |
onAttach()
This method is called when a widget is attached to the browser's document.
|
protected void |
onDetach()
This method is called when a widget is detached from the browser's
document.
|
void |
setEnabled(boolean enabled)
Sets whether this widget is enabled.
|
void |
setFocus(boolean focused)
Explicitly focus/unfocus this widget.
|
void |
setHTML(SafeHtml html)
Sets this object's contents via known-safe HTML.
|
void |
setHTML(String html)
Sets this object's contents via HTML.
|
void |
setText(String text)
Sets this object's text.
|
addBlurHandler, addClickHandler, addClickListener, addDoubleClickHandler, addDragEndHandler, addDragEnterHandler, addDragHandler, addDragLeaveHandler, addDragOverHandler, addDragStartHandler, addDropHandler, addFocusHandler, addFocusListener, addGestureChangeHandler, addGestureEndHandler, addGestureStartHandler, addKeyboardListener, addKeyDownHandler, addKeyPressHandler, addKeyUpHandler, addMouseDownHandler, addMouseListener, addMouseMoveHandler, addMouseOutHandler, addMouseOverHandler, addMouseUpHandler, addMouseWheelHandler, addMouseWheelListener, addTouchCancelHandler, addTouchEndHandler, addTouchMoveHandler, addTouchStartHandler, getFocusImpl, getTabIndex, removeClickListener, removeFocusListener, removeKeyboardListener, removeMouseListener, removeMouseWheelListener, setAccessKey, setTabIndex
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onBrowserEvent, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString
fireEvent
public RichTextArea()
RichTextArea
object with no stylesheet.public HandlerRegistration addInitializeHandler(InitializeHandler handler)
HasInitializeHandlers
InitializeEvent
handler.addInitializeHandler
in interface HasInitializeHandlers
handler
- the handler@Deprecated public RichTextArea.BasicFormatter getBasicFormatter()
getFormatter()
insteadRichTextArea
is attached, visible on the
page, and has been focused by the user.null
if basic formatting is not supported@Deprecated public RichTextArea.ExtendedFormatter getExtendedFormatter()
getFormatter()
insteadRichTextArea
is attached, visible on the page, and
has been focused by the user.null
if full formatting is not supportedpublic RichTextArea.Formatter getFormatter()
RichTextArea
is attached, visible on the page, and
has been focused by the user.null
if full formatting is not supportedpublic String getHTML()
HasHTML
public boolean isEnabled()
FocusWidget
isEnabled
in interface HasEnabled
isEnabled
in class FocusWidget
true
if the widget is enabledpublic void setEnabled(boolean enabled)
FocusWidget
setEnabled
in interface HasEnabled
setEnabled
in class FocusWidget
enabled
- true
to enable the widget, false
to disable itpublic void setFocus(boolean focused)
Focusable
GWTTestCase#delayTestFinish
for more information on how to do this.setFocus
in interface Focusable
setFocus
in class FocusWidget
focused
- whether this widget should take focus or release itpublic void setHTML(String html)
HasHTML
HasText.setText(String)
whenever possible.public void setHTML(SafeHtml html)
HasSafeHtml
The object will behave exactly the same as when a widget's
HasHTML.setHTML(String)
method is
invoked; however the SafeHtml
passed to this method observes the
contract that it can be used in an HTML context without causing unsafe
script execution. Thus, unlike
HasHTML.setHTML(String)
, using this
method cannot result in Cross-Site Scripting security vulnerabilities.
setHTML
in interface HasSafeHtml
html
- the object's new HTML, represented as a SafeHtml
objectpublic void setText(String text)
HasText
protected void onAttach()
Widget
This method is called when a widget is attached to the browser's document.
To receive notification after a Widget has been added to the document,
override the Widget.onLoad()
method or use Widget.addAttachHandler(com.google.gwt.event.logical.shared.AttachEvent.Handler)
.
It is strongly recommended that you override Widget.onLoad()
or
Widget.doAttachChildren()
instead of this method to avoid inconsistencies
between logical and physical attachment states.
Subclasses that override this method must call
super.onAttach()
to ensure that the Widget has been attached
to its underlying Element.
onAttach
in class FocusWidget
Widget.onLoad()
,
Widget.doAttachChildren()
protected void onDetach()
Widget
This method is called when a widget is detached from the browser's
document. To receive notification before a Widget is removed from the
document, override the Widget.onUnload()
method or use Widget.addAttachHandler(com.google.gwt.event.logical.shared.AttachEvent.Handler)
.
It is strongly recommended that you override Widget.onUnload()
or
Widget.doDetachChildren()
instead of this method to avoid inconsistencies
between logical and physical attachment states.
Subclasses that override this method must call
super.onDetach()
to ensure that the Widget has been detached
from the underlying Element. Failure to do so will result in application
memory leaks due to circular references between DOM Elements and JavaScript
objects.
onDetach
in class Widget
Widget.onUnload()
,
Widget.doDetachChildren()
Copyright © 2018. All rights reserved.