Olivier,
Thanks for the link.
If I try to summarize my problem : Which are the conventions that are
implicitly used by GIN to bind classes ?
I've already seen gwt-presenter, but it didn't helped me to understand
how to transform my code to such code :
public class AppModule extends AbstractGinModule {
@Override
protected void configure() {
bind(EventBus.class).to(DefaultEventBus.class);
bind(MainPresenter.Display.class).to(MainWidget.class);
bind(MenuPresenter.Display.class).to(MenuWidget.class);
bind(IssueEditPresenter.Display.class).to(IssueEditWidget.class);
bind(IssueDisplayPresenter.Display.class).to(IssueDisplayWidget.class);
}
}
(found here
http://code.google.com/p/gwt-mvp-sample/source/browse/branches/gwt-presenter/src/com/enunes/bit/client/gin/AppModule.java)
Is there any doc explaining what is behind the scene with all these
"bind().to()" calls ?
In my example, if I write something like
bind(SearchPresenter.Display.class).to(someWidget.class);
is it equivalent to
display = d;
display.getSearchButton().addClickHandler(new
ClickHandler() {
@Override
public void onClick(ClickEvent event) {
doSearch(event);
}
});
and how to tell GIN that I need to call doSearch() ?
Thanks !
Yves
On 27 juin, 19:05, olivier nouguier <[email protected]>
wrote:
> hi
> Google to gwt-presenter
> HIH
>
>
>
> On Sun, Jun 27, 2010 at 12:51 PM, yves <[email protected]> wrote:
> > Hi Everybody,
>
> > I've read the the "official" tutorial at
> >http://code.google.com/p/google-gin/wiki/GinTutorial,
> > but I still doesn't understand how to use GIN (as it is mainly based
> > on Guice that I don't know) and how it could help me :-( Sorry for
> > the tutorial writer :-)
>
> > I'm currently developping an MVP based app mainly inspired by the
> > google IO 2009 presentation
>
> >http://code.google.com/intl/fr/events/io/2009/sessions/GoogleWebToolk...
> > and also the article
> >http://code.google.com/intl/fr/webtoolkit/articles/mvp-architecture.html.
>
> > Here is an example of the code I would like to simplify using DI (as I
> > understand, GIN could do some part for me) :
>
> > public class SearchPresenter implements Presenter {
>
> > public interface Display {
> > HasClickHandlers getSearchButton();
> > }
>
> > Display display;
>
> > public void bind(Display d) {
> > display = d;
> > display.getSearchButton().addClickHandler(new ClickHandler()
> > {
>
> > �...@override
> > public void onClick(ClickEvent event) {
> > doSearch(event);
> > }
>
> > });
> > }
>
> > As I understand, perhaps I am wrong, GIN could do the bind() for me ?
> > But, how should I use GIN for that (if it is really suited for this) ?
>
> > Thanks for your help !
> > Yves
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google Web Toolkit" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected]<google-web-toolkit%[email protected]>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-web-toolkit?hl=en.
>
> --
> "Computers are useless. They can only give you answers."
> - Pablo Picasso -
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.