Tuesday, May 1, 2012

EventBus mechanism

Hi everyone, now that i am working with GWT i am facing a problem with
the event handling mechanism the first problem was (
http://groups.google.com/group/google-web-toolkit/browse_thread/thread/17b679b499311756/8f06531e30bf0996#8f06531e30bf0996
), but when i read this article MVP II (
https://developers.google.com/web-toolkit/articles/mvp-architecture-2
) - actually i read it several times - i still don't understand when u
to use EventBus mechanism and when not ? and if i have to use when u
use EventBus Handler and HandlerManage ?.
Here is what confuses me:

public class ContactsPresenter implements Presenter,
ContactsView.Presenter<ContactDetails> {
......
public void onAddButtonClicked() {
eventBus.fireEvent(new AddContactEvent());
}

public void onDeleteButtonClicked() {
deleteSelectedContacts();
}

public void onItemClicked(ContactDetails contactDetails) {
eventBus.fireEvent(new EditContactEvent(contactDetails.getId()));
}

....
}

Why one method fires and event and the other just do some logic witch
is defined the class ?

Thank you all for your replies.

the source code of the example is here :
http://google-web-toolkit.googlecode.com/files/Tutorial-Contacts2.zip

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment