I'm only making guesses here as well... but perhaps either:

interface Display {
    HasFocusHandlers getEntryFocus();
    HasBlurHandlers  getEntryBlur();
}

or something like:

interface FocusableTextEntry extends HasValue<String>,
HasFocusHandlers, HasBlurHandlers {}
interface Display {
    FocusableTextEntry getLoginEntry();
}

Not sure what is preferable... to many methods is messay, but a
wildgrowth of interface is also not good - but I suppose you could
combine them to a few basic ones, perhaps something like.

Another thing is, is focus management supposed to be in the Presenter?
I'd guess it's supposed to go in the View... the blur event handlers
come from com.google.gwt.event.dom.client, which implies to me the
need for a GwtTestcase, and the whole idea is to be able to test your
presenter _without_ the need for any displayable widgets and related
code.

On Jun 30, 10:12 pm, Zheren <benzhe...@gmail.com> wrote:
> So if for a TextBox I need to bind both FocusHandler and BlurHandler,
> I need to have two interfaces and combine them?
>
> How does that work?
>
> On Jun 30, 6:54 am, gscholt <gsch...@gmail.com> wrote:
>
> > On Jun 29, 11:13 pm, Daniel Jue <teamp...@gmail.com> wrote:
>
> > > Does anyone have a working MVP/Eventbus sample of something simple
> > > like the PhoneEditor?
> > > I don't think I'm doing it right.  The code from the IO presentation
> > > leaves out enough details so that I'm not sure what to do.
> > > For instance, in my Presenter.class,
>
> > > I have something like this:
> > > public class Presenter {
> > > ...
> > > private Display display;
> > >         interface Display {
> > >                 HasClickHandlers getSaveButton();
> > >                 HasClickHandlers getCancelButton();
> > >                 HasClickHandlers getNumberField();
> > >                 HasClickHandlers getLabelPicker();
> > >         }
> > >         void editPhone(Phone phone) {
> > >                 this.phone = Phone.from(phone);
> > >                 display.getNumberField().setValue(phone.getNumber());
> > >                 display.getLabelPicker().setValue(phone.getLabel());
> > >         }
> > > ...}
>
> > > Obviously, a HasClickHandlers object doesn't have a setValue method.
> > > It doesn't feel like I should be casting to the widget here, since we
> > > went through all the trouble of using the Display interface.
>
> > > I started looking at Mvp4g, but it seems to go off on a tangent with a
> > > code generation class to wire up presenters and views via 
> > > xml.http://code.google.com/p/mvp4g/
> > > It's also intertwined with some mvc4g classes.
>
> > > I just want something basic that works, so I can seed my project from
> > > there.  A minimalist, working command style RPC example would be nice
> > > too.
> > > Anyone?  If you're in the DC area, I'll buy you a drink!
>
> > interface Display {
> >     HasClickHandlers getSaveButton();
> >     HasClickHandlers getCancelButton();
> >     HasValue<String> getNumberField();
> >     HasValue<String> getLabelPicker();
>
> > }
>
> > This will work for this example at least. If you want to bind events
> > AND set a value to those fields you'd need to combine the two
> > interfaces in a new one, or perhaps have two accessor methods.
>
> > Gert
>
>
--~--~---------~--~----~------------~-------~--~----~
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