After going through multiple documents online for GWT and reading upon the recommended MVP pattern for GWT, I found out that setting up the amount of classes and interfaces needed to bootstrap a simple GWT application that follows the pattern is quite tedious everytime. So I wrote some boilerplate code that can help me with creating new applications.
The program consists of a simple textbox that takes any non-zero length input and then echos back the string in the next page with a "Hello," prepended to that text.
- Implements a simple Application controller in AppController.java.
- Implements an eventBus using the internal GWT eventBus.
- Implements the basic Presenter interface, and a couple of Presenters for PageOne and PageTwo.
- Implements the Views for PageOne and PageTwo using the UIBinder interface.
- Implements a basic Event handler Interface for PageOne which is captured in Application Controller.
- Demonstrates the usage of "History" to browse the pages.
The application leaves "shared" and "server" packages empty since the focus of the example is to demonstrate the MVP, but the packages are kept empty for consistency purposes, especially when creating example applications using webAppCreator
Also there is no GWT RPC class implemented in any of the classes, which will be required incase this boilerplate code is planned to be used with a RPC backend.