Class RichTextArea

    • Constructor Detail

      • RichTextArea

        public RichTextArea()
        Creates a new, blank RichTextArea object with no stylesheet.
    • Method Detail

      • getBasicFormatter

        @Deprecated
        public RichTextArea.BasicFormatter getBasicFormatter()
        Deprecated.
        use getFormatter() instead
        Gets the basic rich text formatting interface. Note that formatting can only be done when the RichTextArea is attached, visible on the page, and has been focused by the user.
        Returns:
        null if basic formatting is not supported
      • getExtendedFormatter

        @Deprecated
        public RichTextArea.ExtendedFormatter getExtendedFormatter()
        Deprecated.
        use getFormatter() instead
        Gets the full rich text formatting interface. Note that formatting can only be done when the RichTextArea is attached, visible on the page, and has been focused by the user.
        Returns:
        null if full formatting is not supported
      • getFormatter

        public RichTextArea.Formatter getFormatter()
        Gets the rich text formatting interface. Note that formatting can only be done when the RichTextArea is attached, visible on the page, and has been focused by the user.
        Returns:
        null if full formatting is not supported
      • getHTML

        public java.lang.String getHTML()
        Description copied from interface: HasHTML
        Gets this object's contents as HTML.
        Specified by:
        getHTML in interface HasHTML
        Returns:
        the object's HTML
      • getText

        public java.lang.String getText()
        Description copied from interface: HasText
        Gets this object's text.
        Specified by:
        getText in interface HasText
        Returns:
        the object's text
      • isEnabled

        public boolean isEnabled()
        Description copied from class: FocusWidget
        Gets whether this widget is enabled.
        Specified by:
        isEnabled in interface HasEnabled
        Overrides:
        isEnabled in class FocusWidget
        Returns:
        true if the widget is enabled
      • setEnabled

        public void setEnabled​(boolean enabled)
        Description copied from class: FocusWidget
        Sets whether this widget is enabled.
        Specified by:
        setEnabled in interface HasEnabled
        Overrides:
        setEnabled in class FocusWidget
        Parameters:
        enabled - true to enable the widget, false to disable it
      • setFocus

        public void setFocus​(boolean focused)
        Description copied from interface: Focusable
        Explicitly focus/unfocus this widget. Only one widget can have focus at a time, and the widget that does will receive all keyboard events. NOTE: Most browsers fire FocusEvents asynchronously. Especially within GWT tests, you'll need to make your test asynchronous to properly do verifications. See GWTTestCase#delayTestFinish for more information on how to do this.
        Specified by:
        setFocus in interface Focusable
        Overrides:
        setFocus in class FocusWidget
        Parameters:
        focused - whether this widget should take focus or release it
      • setHTML

        public void setHTML​(java.lang.String html)
        Description copied from interface: HasHTML
        Sets this object's contents via HTML. Use care when setting an object's HTML; it is an easy way to expose script-based security problems. Consider using HasText.setText(String) whenever possible.
        Specified by:
        setHTML in interface HasHTML
        Parameters:
        html - the object's new HTML
      • setHTML

        public void setHTML​(SafeHtml html)
        Description copied from interface: HasSafeHtml
        Sets this object's contents via known-safe HTML.

        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.

        Specified by:
        setHTML in interface HasSafeHtml
        Parameters:
        html - the object's new HTML, represented as a SafeHtml object
      • setText

        public void setText​(java.lang.String text)
        Description copied from interface: HasText
        Sets this object's text.
        Specified by:
        setText in interface HasText
        Parameters:
        text - the object's new text