On Mar 31, 8:07 am, mic <mina...@gmail.com> wrote:
> Just sharing some thoughts....
>
> Would the MenuItem class need to implement HasClickHandler  so that
> when a MenuItem is clicked, the action can be handled in the
> presenter. At this time, the MenuItem needs an object that implements
> the Command interface, so the view seems to know about the presenter.
>
> I would like to know what others think about this.

I've recently migrated from views with many HasXxxHandlers getters to
views with a setListener method that the presenter "injects" into its
view. The listener defines "callback methods" such as save(), close(),
italicize(), bold(), delete(), etc.
It makes unit tests waaay easier to write (you don't have to mock each
HasXxxHandlers, capturing each added XxxHandler, eventually mocking
the XxxEvent, etc.) and in your case would make things easier: the
Command is an implementation detail of the view.

-- 
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-tool...@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