org.xwiki.gwt.user.client.ui.rta
Class RichTextArea

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.google.gwt.user.client.ui.FocusWidget
              extended by com.google.gwt.user.client.ui.RichTextArea
                  extended by org.xwiki.gwt.user.client.ui.rta.RichTextArea
All Implemented Interfaces:
com.google.gwt.event.dom.client.HasAllFocusHandlers, com.google.gwt.event.dom.client.HasAllKeyHandlers, com.google.gwt.event.dom.client.HasAllMouseHandlers, com.google.gwt.event.dom.client.HasBlurHandlers, com.google.gwt.event.dom.client.HasClickHandlers, com.google.gwt.event.dom.client.HasDoubleClickHandlers, com.google.gwt.event.dom.client.HasFocusHandlers, com.google.gwt.event.dom.client.HasKeyDownHandlers, com.google.gwt.event.dom.client.HasKeyPressHandlers, com.google.gwt.event.dom.client.HasKeyUpHandlers, com.google.gwt.event.dom.client.HasLoadHandlers, com.google.gwt.event.dom.client.HasMouseDownHandlers, com.google.gwt.event.dom.client.HasMouseMoveHandlers, com.google.gwt.event.dom.client.HasMouseOutHandlers, com.google.gwt.event.dom.client.HasMouseOverHandlers, com.google.gwt.event.dom.client.HasMouseUpHandlers, com.google.gwt.event.dom.client.HasMouseWheelHandlers, com.google.gwt.event.dom.client.LoadHandler, com.google.gwt.event.shared.EventHandler, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener, com.google.gwt.user.client.ui.Focusable, com.google.gwt.user.client.ui.HasFocus, com.google.gwt.user.client.ui.HasHTML, com.google.gwt.user.client.ui.HasText, com.google.gwt.user.client.ui.SourcesClickEvents, com.google.gwt.user.client.ui.SourcesFocusEvents, com.google.gwt.user.client.ui.SourcesKeyboardEvents, com.google.gwt.user.client.ui.SourcesMouseEvents

public class RichTextArea
extends com.google.gwt.user.client.ui.RichTextArea
implements com.google.gwt.event.dom.client.HasDoubleClickHandlers, com.google.gwt.event.dom.client.HasLoadHandlers, com.google.gwt.event.dom.client.LoadHandler

Extends the rich text area provided by GWT to add support for advanced editing.

Version:
$Id: RichTextArea.java 24900 2009-11-06 16:53:01Z sdumitriu $

Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.RichTextArea
com.google.gwt.user.client.ui.RichTextArea.BasicFormatter, com.google.gwt.user.client.ui.RichTextArea.ExtendedFormatter, com.google.gwt.user.client.ui.RichTextArea.FontSize, com.google.gwt.user.client.ui.RichTextArea.Justification
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
 
Field Summary
static java.lang.String DIRTY
           
static java.lang.String LOADED
           
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
RichTextArea()
          Creates a new rich text area.
RichTextArea(CommandManager cm)
          Custom constructor allowing us to inject a mock command manager and a mock history.
 
Method Summary
 com.google.gwt.event.shared.HandlerRegistration addDoubleClickHandler(com.google.gwt.event.dom.client.DoubleClickHandler handler)
          
 com.google.gwt.event.shared.HandlerRegistration addLoadHandler(com.google.gwt.event.dom.client.LoadHandler handler)
          
 CommandManager getCommandManager()
           
 Document getDocument()
          NOTE: If the current browser doesn't support rich text editing this method returns null.
protected  com.google.gwt.user.client.ui.impl.RichTextAreaImpl getImpl()
          NOTE: We need this method because RichTextArea.impl is private.
 void onBrowserEvent(com.google.gwt.user.client.Event event)
          
 void onLoad(com.google.gwt.event.dom.client.LoadEvent event)
          
 void setHTML(java.lang.String html)
          
 
Methods inherited from class com.google.gwt.user.client.ui.RichTextArea
getBasicFormatter, getExtendedFormatter, getHTML, getText, onAttach, onDetach, setFocus, setText
 
Methods inherited from class com.google.gwt.user.client.ui.FocusWidget
addBlurHandler, addClickHandler, addClickListener, addFocusHandler, addFocusListener, addKeyboardListener, addKeyDownHandler, addKeyPressHandler, addKeyUpHandler, addMouseDownHandler, addMouseListener, addMouseMoveHandler, addMouseOutHandler, addMouseOverHandler, addMouseUpHandler, addMouseWheelHandler, addMouseWheelListener, getFocusImpl, getTabIndex, isEnabled, removeClickListener, removeFocusListener, removeKeyboardListener, removeMouseListener, removeMouseWheelListener, setAccessKey, setElement, setEnabled, setTabIndex
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addDomHandler, addHandler, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getParent, isAttached, isOrWasAttached, onLoad, onUnload, removeFromParent, sinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 
Methods inherited from interface com.google.gwt.user.client.ui.SourcesMouseEvents
addMouseListener, removeMouseListener
 
Methods inherited from interface com.google.gwt.event.dom.client.HasMouseDownHandlers
addMouseDownHandler
 
Methods inherited from interface com.google.gwt.event.dom.client.HasMouseUpHandlers
addMouseUpHandler
 
Methods inherited from interface com.google.gwt.event.dom.client.HasMouseOutHandlers
addMouseOutHandler
 
Methods inherited from interface com.google.gwt.event.dom.client.HasMouseOverHandlers
addMouseOverHandler
 
Methods inherited from interface com.google.gwt.event.dom.client.HasMouseMoveHandlers
addMouseMoveHandler
 
Methods inherited from interface com.google.gwt.event.dom.client.HasMouseWheelHandlers
addMouseWheelHandler
 

Field Detail

DIRTY

public static final java.lang.String DIRTY
See Also:
setHTML(String), Constant Field Values

LOADED

public static final java.lang.String LOADED
See Also:
onLoad(LoadEvent), Constant Field Values
Constructor Detail

RichTextArea

public RichTextArea()
Creates a new rich text area.


RichTextArea

public RichTextArea(CommandManager cm)
Custom constructor allowing us to inject a mock command manager and a mock history. It was mainly added to be used in unit tests.

Parameters:
cm - Custom command manager
Method Detail

getDocument

public Document getDocument()
NOTE: If the current browser doesn't support rich text editing this method returns null. You should test the returned value and fail save to an appropriate behavior!
The appropriate test would be:
 if (rta.isAttached() && rta.getDocument() == null) {
   // The current browser doesn't support rich text editing.
 }
 

Returns:
The DOM document being edited with this rich text area.

getCommandManager

public CommandManager getCommandManager()
Returns:
the CommandManager associated with this instance.

setHTML

public void setHTML(java.lang.String html)

Specified by:
setHTML in interface com.google.gwt.user.client.ui.HasHTML
Overrides:
setHTML in class com.google.gwt.user.client.ui.RichTextArea
See Also:
RichTextArea.setHTML(String), http://code.google.com/p/google-web-toolkit/issues/detail?id=3147, http://code.google.com/p/google-web-toolkit/issues/detail?id=3156

onBrowserEvent

public void onBrowserEvent(com.google.gwt.user.client.Event event)

Specified by:
onBrowserEvent in interface com.google.gwt.user.client.EventListener
Overrides:
onBrowserEvent in class com.google.gwt.user.client.ui.Widget
See Also:
Widget.onBrowserEvent(com.google.gwt.user.client.Event)

addDoubleClickHandler

public com.google.gwt.event.shared.HandlerRegistration addDoubleClickHandler(com.google.gwt.event.dom.client.DoubleClickHandler handler)

Specified by:
addDoubleClickHandler in interface com.google.gwt.event.dom.client.HasDoubleClickHandlers
See Also:
HasDoubleClickHandlers.addDoubleClickHandler(DoubleClickHandler)

addLoadHandler

public com.google.gwt.event.shared.HandlerRegistration addLoadHandler(com.google.gwt.event.dom.client.LoadHandler handler)

Specified by:
addLoadHandler in interface com.google.gwt.event.dom.client.HasLoadHandlers
See Also:
HasLoadHandlers.addLoadHandler(LoadHandler)

onLoad

public void onLoad(com.google.gwt.event.dom.client.LoadEvent event)

Specified by:
onLoad in interface com.google.gwt.event.dom.client.LoadHandler
See Also:
LoadHandler.onLoad(LoadEvent), RichTextArea.onAttach()

getImpl

protected com.google.gwt.user.client.ui.impl.RichTextAreaImpl getImpl()
NOTE: We need this method because RichTextArea.impl is private.

Returns:
the underlying rich text area browser-specific implementation


Copyright © 2004-2009 XWiki. All Rights Reserved.