Thanks! Updated comment to reflect new handler names rather then the old listener ones.
Committed at r4305. On Thu, Dec 11, 2008 at 10:22 AM, John LaBanca <[EMAIL PROTECTED]> wrote: > I'm getting server errors, so here is your review: > > // Only fire the mouseEnter event if it's coming from outside this > > mouseEnter should be mouseOver since we are firing a MouseOverEvent > > // Only fire the mouseLeave event if it's actually leaving this > mouseLeave should be mouseOut since we are firing a MouseOutEvent > > Otherwise, LGTM > > Thanks, > John LaBanca > [EMAIL PROTECTED] > > > > On Thu, Dec 11, 2008 at 9:49 AM, <[EMAIL PROTECTED]> wrote: > >> Reviewers: jlabanca, >> >> Description: >> GWT issue: >> >> http://code.google.com/p/google-web-toolkit/issues/detail?id=3189&q=owner:ecc%20started >> >> Please review this at http://gwt-code-reviews.appspot.com/810 >> >> Affected files: >> user/src/com/google/gwt/user/client/ui/ListenerWrapper.java >> user/src/com/google/gwt/user/client/ui/Widget.java >> >> >> Index: user/src/com/google/gwt/user/client/ui/ListenerWrapper.java >> =================================================================== >> --- user/src/com/google/gwt/user/client/ui/ListenerWrapper.java (revision >> 4300) >> +++ user/src/com/google/gwt/user/client/ui/ListenerWrapper.java (working >> copy) >> @@ -287,23 +287,11 @@ >> } >> >> public void onMouseOut(MouseOutEvent event) { >> - // Only fire the mouseLeave event if it's actually leaving this >> - // widget. >> - Element to = event.getToElement(); >> - Widget source = source(event); >> - if (to == null || !source.getElement().isOrHasChild(to)) { >> - listener.onMouseLeave(source(event)); >> - } >> + listener.onMouseLeave(source(event)); >> } >> >> public void onMouseOver(MouseOverEvent event) { >> - // Only fire the mouseEnter event if it's coming from outside this >> - // widget. >> - Element from = event.getFromElement(); >> - Widget source = source(event); >> - if (from == null || !source.getElement().isOrHasChild(from)) { >> - listener.onMouseEnter(source(event)); >> - } >> + listener.onMouseEnter(source(event)); >> } >> >> public void onMouseUp(MouseUpEvent event) { >> Index: user/src/com/google/gwt/user/client/ui/Widget.java >> =================================================================== >> --- user/src/com/google/gwt/user/client/ui/Widget.java (revision 4298) >> +++ user/src/com/google/gwt/user/client/ui/Widget.java (working copy) >> @@ -15,6 +15,7 @@ >> */ >> package com.google.gwt.user.client.ui; >> >> +import com.google.gwt.dom.client.Element; >> import com.google.gwt.event.dom.client.DomEvent; >> import com.google.gwt.event.logical.shared.HasHandlers; >> import com.google.gwt.event.shared.EventHandler; >> @@ -88,8 +89,25 @@ >> return handlerManager != null && handlerManager.isEventHandled(type); >> } >> >> - public void onBrowserEvent(Event nativeEvent) { >> - DomEvent.fireNativeEvent(nativeEvent, handlerManager); >> + public void onBrowserEvent(Event event) { >> + switch (DOM.eventGetType(event)) { >> + case Event.ONMOUSEOVER: >> + // Only fire the mouseEnter event if it's coming from outside >> this >> + // widget. >> + Element from = event.getFromElement(); >> + if (from != null && getElement().isOrHasChild(from)) { >> + return; >> + } >> + break; >> + case Event.ONMOUSEOUT: >> + // Only fire the mouseLeave event if it's actually leaving this >> + // widget. >> + Element to = event.getToElement(); >> + if (to != null && getElement().isOrHasChild(to)) { >> + return; >> + } >> + } >> + DomEvent.fireNativeEvent(event, handlerManager); >> } >> >> /** >> >> >> > -- "There are only 10 types of people in the world: Those who understand binary, and those who don't" --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~----------~----~----~----~------~----~------~--~---