Build fixes; sorted RichTextImpls and removed no longer supported change listener hookup from kitchen sink. git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@1108 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/RichTextToolbar.java b/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/RichTextToolbar.java index ed93adf..ff166ec 100644 --- a/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/RichTextToolbar.java +++ b/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/RichTextToolbar.java
@@ -410,7 +410,6 @@ // We only use these listeners for updating status, so don't hook them up // unless at least basic editing is supported. - richText.addChangeListener(listener); richText.addKeyboardListener(listener); richText.addClickListener(listener); }
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 0b8ce57..911fe0d 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
@@ -23,29 +23,6 @@ */ public class RichTextAreaImplIE6 extends RichTextAreaImplStandard { - native void initEvents() /*-{ - var elem = this.@com.google.gwt.user.client.ui.impl.RichTextAreaImpl::elem; - var handler = function() { - if (elem.__listener) { - // Weird: this code has the context of the script frame, but we need the - // event from the edit iframe's window. - var evt = elem.contentWindow.event; - elem.__listener.@com.google.gwt.user.client.ui.RichTextArea::onBrowserEvent(Lcom/google/gwt/user/client/Event;)(evt); - } - }; - - var body = elem.contentWindow.document.body; - body.onkeydown = - body.onkeyup = - body.onkeypress = - body.onmousedown = - body.onmouseup = - body.onmousemove = - body.onmouseover = - body.onmouseout = - body.onclick = handler; - }-*/; - private static native void detachEvents(Element elem) /*-{ var body = elem.contentWindow.document.body; body.onkeydown = @@ -93,6 +70,29 @@ detachEvents(elem); } + native void initEvents() /*-{ + var elem = this.@com.google.gwt.user.client.ui.impl.RichTextAreaImpl::elem; + var handler = function() { + if (elem.__listener) { + // Weird: this code has the context of the script frame, but we need the + // event from the edit iframe's window. + var evt = elem.contentWindow.event; + elem.__listener.@com.google.gwt.user.client.ui.RichTextArea::onBrowserEvent(Lcom/google/gwt/user/client/Event;)(evt); + } + }; + + var body = elem.contentWindow.document.body; + body.onkeydown = + body.onkeyup = + body.onkeypress = + body.onmousedown = + body.onmouseup = + body.onmousemove = + body.onmouseover = + body.onmouseout = + body.onclick = handler; + }-*/; + boolean isRichEditingActive(Element elem) { return true; }
diff --git a/user/src/com/google/gwt/user/client/ui/impl/RichTextAreaImplOpera.java b/user/src/com/google/gwt/user/client/ui/impl/RichTextAreaImplOpera.java index 5d3fef0..1b2b997 100644 --- a/user/src/com/google/gwt/user/client/ui/impl/RichTextAreaImplOpera.java +++ b/user/src/com/google/gwt/user/client/ui/impl/RichTextAreaImplOpera.java
@@ -23,8 +23,8 @@ */ public class RichTextAreaImplOpera extends RichTextAreaImplStandard { - private static boolean richTextSupported = detectEditingSupport(); private static RichTextAreaImpl old; + private static boolean richTextSupported = detectEditingSupport(); static { // If rich text is not supported by this version of Opera, create an @@ -90,6 +90,12 @@ return richTextSupported; } + public void setBackColor(String color) { + // Opera uses 'BackColor' for the *entire area's* background. 'HiliteColor' + // does what we actually want. + execCommand("HiliteColor", color); + } + public native void setFocus(boolean focused) /*-{ // Opera needs the *iframe* focused, not its window. if (focused) { @@ -121,10 +127,4 @@ } super.unhookEvents(); } - - public void setBackColor(String color) { - // Opera uses 'BackColor' for the *entire area's* background. 'HiliteColor' - // does what we actually want. - execCommand("HiliteColor", color); - } }