I´m looking for a way to show and hide a working indicator in my web application. I use GWT with model view presenter pattern and have places for my different pages and activities, which are my presenter objects.
What I tried so far:
View objects have to implement an
public interface HasWorkingIndicator
void showWorkingIndicator(boolean show);
Activity objects call the showWorkingIndicator on their view object in a start method.
@Override
public void start(final AcceptsOneWidget panel, EventBus eventBus){
page.showWorkingIndicator(true);
//more code...
}
So what is the best way to hide the WorkingIndicatorView? I cant call showWorkingIndicator(false) at the end of the start(), because the page is not set up at that time.
Maybe any patterns to look at?
If you are using activities this becomes a pretty easy task to accomplish.
I have an AbstractActity that implements Activity, this handles things like my clientfactory and the parent panel.
The Activity interface implements mayStop(), onStop and onStart etc.
The activity would look something like this.