Fixed missing FocusWidget changes needed for RichTextArea; resorted members; added image for doc.
Review by: knorton
           rdayal


git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@844 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/doc/src/RichTextArea.png b/doc/src/RichTextArea.png
new file mode 100644
index 0000000..edcab8e
--- /dev/null
+++ b/doc/src/RichTextArea.png
Binary files differ
diff --git a/user/src/com/google/gwt/user/client/ui/FocusWidget.java b/user/src/com/google/gwt/user/client/ui/FocusWidget.java
index 022940b..bd67f92 100644
--- a/user/src/com/google/gwt/user/client/ui/FocusWidget.java
+++ b/user/src/com/google/gwt/user/client/ui/FocusWidget.java
@@ -49,13 +49,19 @@
   private KeyboardListenerCollection keyboardListeners;
 
   /**
-   * Creates a new focus component that wraps the specified browser element.
+   * Creates a new focus widget with no element. {@link #setElement(Element)}
+   * must be called before any other methods.
+   */
+  protected FocusWidget() {
+  }
+
+  /**
+   * Creates a new focus widget that wraps the specified browser element.
    * 
    * @param elem the element to be wrapped
    */
   protected FocusWidget(Element elem) {
     setElement(elem);
-    sinkEvents(Event.ONCLICK | Event.FOCUSEVENTS | Event.KEYEVENTS);
   }
 
   public void addClickListener(ClickListener listener) {
@@ -161,6 +167,11 @@
     impl.setTabIndex(getElement(), index);
   }
 
+  protected void setElement(Element elem) {
+    super.setElement(elem);
+    sinkEvents(Event.ONCLICK | Event.FOCUSEVENTS | Event.KEYEVENTS);
+  }
+
   /**
    * Fire all current {@link ClickListener}.
    */
diff --git a/user/src/com/google/gwt/user/client/ui/RichTextArea.java b/user/src/com/google/gwt/user/client/ui/RichTextArea.java
index fae4aad..3f9a249 100644
--- a/user/src/com/google/gwt/user/client/ui/RichTextArea.java
+++ b/user/src/com/google/gwt/user/client/ui/RichTextArea.java
@@ -100,6 +100,11 @@
     boolean isUnderlined();

 

     /**

+     * Selects all the text.

+     */

+    void selectAll();

+

+    /**

      * Sets the background color.

      * 

      * @param color the new background color

@@ -158,68 +163,6 @@
      * Toggles underline.

      */

     void toggleUnderline();

-

-    /**

-     * Selects all the text.

-     */

-    void selectAll();

-  }

-

-  /**

-   * Font size enumeration. Represents the seven basic HTML font sizes, as

-   * defined in CSS.

-   */

-  public static class FontSize {

-

-    /**

-     * Represents an XX-Small font.

-     */

-    public static final FontSize XX_SMALL = new FontSize(1);

-

-    /**

-     * Represents an X-Small font.

-     */

-    public static final FontSize X_SMALL = new FontSize(2);

-

-    /**

-     * Represents a Small font.

-     */

-    public static final FontSize SMALL = new FontSize(3);

-

-    /**

-     * Represents a Medium font.

-     */

-    public static final FontSize MEDIUM = new FontSize(4);

-

-    /**

-     * Represents a Large font.

-     */

-    public static final FontSize LARGE = new FontSize(5);

-

-    /**

-     * Represents an X-Large font.

-     */

-    public static final FontSize X_LARGE = new FontSize(6);

-

-    /**

-     * Represents an XX-Large font.

-     */

-    public static final FontSize XX_LARGE = new FontSize(7);

-

-    private int number;

-

-    private FontSize(int number) {

-      this.number = number;

-    }

-

-    /**

-     * Gets the HTML font number associated with this font size.

-     * 

-     * @return an integer from 1 to 7 inclusive

-     */

-    public int getNumber() {

-      return number;

-    }

   }

 

   /**

@@ -293,6 +236,63 @@
   }

 

   /**

+   * Font size enumeration. Represents the seven basic HTML font sizes, as

+   * defined in CSS.

+   */

+  public static class FontSize {

+

+    /**

+     * Represents an XX-Small font.

+     */

+    public static final FontSize XX_SMALL = new FontSize(1);

+

+    /**

+     * Represents an X-Small font.

+     */

+    public static final FontSize X_SMALL = new FontSize(2);

+

+    /**

+     * Represents a Small font.

+     */

+    public static final FontSize SMALL = new FontSize(3);

+

+    /**

+     * Represents a Medium font.

+     */

+    public static final FontSize MEDIUM = new FontSize(4);

+

+    /**

+     * Represents a Large font.

+     */

+    public static final FontSize LARGE = new FontSize(5);

+

+    /**

+     * Represents an X-Large font.

+     */

+    public static final FontSize X_LARGE = new FontSize(6);

+

+    /**

+     * Represents an XX-Large font.

+     */

+    public static final FontSize XX_LARGE = new FontSize(7);

+

+    private int number;

+

+    private FontSize(int number) {

+      this.number = number;

+    }

+

+    /**

+     * Gets the HTML font number associated with this font size.

+     * 

+     * @return an integer from 1 to 7 inclusive

+     */

+    public int getNumber() {

+      return number;

+    }

+  }

+

+  /**

    * Justification enumeration. The three values are <code>left</code>,

    * <code>right</code>, <code>center</code>.

    */

diff --git a/user/src/com/google/gwt/user/client/ui/impl/RichTextAreaImplIE6.java b/user/src/com/google/gwt/user/client/ui/impl/RichTextAreaImplIE6.java
index 153c42d..45a487a 100644
--- a/user/src/com/google/gwt/user/client/ui/impl/RichTextAreaImplIE6.java
+++ b/user/src/com/google/gwt/user/client/ui/impl/RichTextAreaImplIE6.java
@@ -20,6 +20,10 @@
  */

 public class RichTextAreaImplIE6 extends RichTextAreaImplStandard {

 

+  public native String getText() /*-{

+    return this.@com.google.gwt.user.client.ui.impl.RichTextAreaImpl::elem.contentWindow.document.body.innerText;

+  }-*/;

+

   public native void initElement() /*-{

     var elem = this.@com.google.gwt.user.client.ui.impl.RichTextAreaImpl::elem;

     var _this = this;

@@ -57,8 +61,4 @@
     body.attachEvent('onmouseout', handler);

     body.attachEvent('onclick', handler);

   }-*/;

-

-  public native String getText() /*-{

-    return this.@com.google.gwt.user.client.ui.impl.RichTextAreaImpl::elem.contentWindow.document.body.innerText;

-  }-*/;

 }