Remember the good old PHP when you want to include header and footer then you would do this
CONTENT
..Unfortunately with GWT you can't do something like that. Well, you can if you define your layout as a widget and include it everywhere within your new view's UiBinder. Now, thats too much work and hassle. Imagine if you have 1000 views? That would be 3,000 extra lines of code (header widget, footer widget and sidebar widget). With GWTP, you only have to change the following once you defined your header/footer file
RevealRootContentEvent.fire(this, this);
..into
RevealContentEvent.fire(this, IncludePresenter.TYPE_SetMainContent , this);
..pretty easy right? BUT that is still too much typing. Worry not! With the gwtp eclipse plugin, you can easily select the parent presenter and it will auto generate the code above for you! How awesome is that?!!
The plugin and video tutorial is available here: http://code.google.com/p/gwt-platform/wiki/EclipsePlugin
No comments:
Post a Comment