I already tried it, but it didn't work. I found a solution, but a very ugly one:

    private class FlexTableTd extends UIObject implements HasMouseOutHandlers,
            HasMouseOverHandlers, EventListener {

        public FlexTableTd(Element element) {
            this.setElement(element);
            DOM.setEventListener(this.getElement(), this);
        }

        public HandlerRegistration addMouseOutHandler(MouseOutHandler handler) {
            this.sinkEvents(Event.ONMOUSEOUT);
            return
ensureHandlers().addHandler(MouseOutEvent.getType(), handler);
        }

        public HandlerRegistration
addMouseOverHandler(MouseOverHandler handler) {
            this.sinkEvents(Event.ONMOUSEOVER);
            return
ensureHandlers().addHandler(MouseOverEvent.getType(), handler);
        }

        public void fireEvent(GwtEvent<?> event) {
            ensureHandlers().fireEvent(event);
        }

        public void onBrowserEvent(Event event) {
            switch (DOM.eventGetType(event)) {
                case Event.ONMOUSEOVER:
                case Event.ONMOUSEOUT:
                    Element related = event.getRelatedTarget();
                    if (related != null && getElement().isOrHasChild(related)) {
                        return;
                    }
                    break;
            }
            DomEvent.fireNativeEvent(event, this, this.getElement());
        }
        private HandlerManager handlerManager;

        HandlerManager ensureHandlers() {
            return handlerManager == null ? handlerManager = new
HandlerManager(this)
                    : handlerManager;
        }
    }



On Fri, Jun 12, 2009 at 4:46 PM, matthew jones<bigboxe...@gmail.com> wrote:
>
> Try this instead.
>
> addMouseOverHandler(MouseOverHandler handler) {
>            return addDomHandler(handler, MouseOverEvent.getType());
>        }
>
> On Jun 12, 12:52 pm, Eduardo Nunes <esnu...@gmail.com> wrote:
>> Well, the subject says everything, I would like to know how can I add
>> a MouseOutHandler to a FlexTable cell. I tried a lot of things but
>> none of them with success. I tried a wrap class:
>>
>>     private class FlexTableTd extends Widget implements HasMouseOutHandlers,
>>             HasMouseOverHandlers {
>>
>>         public FlexTableTd(Element element) {
>>             setElement(element);
>>         }
>>
>>         public HandlerRegistration addMouseOutHandler(MouseOutHandler 
>> handler) {
>>             return addHandler(handler, MouseOutEvent.getType());
>>         }
>>
>>         public HandlerRegistration
>> addMouseOverHandler(MouseOverHandler handler) {
>>             return addHandler(handler, MouseOverEvent.getType());
>>         }
>>     }
>>
>> and I tried
>>
>> FlexTableTd td = new FlexTableTd(table.getFlexCellFormatter().getElement(0, 
>> 0));
>> td.addMouseOverHandler(...);
>>
>> but it doesn't work.
>>
>> --
>> Eduardo S. Nuneshttp://e-nunes.com.br
>
> >
>



-- 
Eduardo S. Nunes
http://e-nunes.com.br

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to