How to use EventBus for non-Presenter class in GWTP?
I am using GWTP platform & eClipse to build webapp. In Eclipse, when creating a Presenter, it will create 3 files (ex: SearchPresenter.java, SearchView.java, & SearchView.ui.xml):
public class SearchView extends ViewImpl implements SearchPresenter.MyView public class SearchPresenter extends Presenter<SearchPresenter.MyView, SearchPresenter.MyProxy>{ .... private EventBus eventBus; @Inject public SearchPresenter(final EventBus eventBus, final MyView view) { super(eventBus, view); this.eventBus=eventBus; } }
To use eventBus, we just simply use eclipse to create EventBus file, ex MyEvent.java, then we call eventBus in SearchPresenter by using this code:
MyEvent mEvent=new MyEvent(); SearchPresenter.this.eventBus.fireEvent(mEvent);
now suppose I got a non-presenter class public class SearchDialogBox extends DialogBox
, then my question is how can i use MyEvent in SearchDialogBox? How to getEventBus() in SearchDialogBox?
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home