That's how I solved the problem:
Instead of putting the logic of handle the events in the root presenter, which would hurt the principle of Separation of Concerns, I let this logic inside the PresenterWidget.
But, How could I "wake up" the PresenterWidget inside himself?
Well, It happens that he is awaken at boot time, and in the construction he registers his self as the listener of his opening event. For showing him up, I injected the RootPresenter in the PresenterWidget and in the handling method I put himself into the PopupSlot.
In practice...
class MyPresenterWidget ... implements MyOpeningEvent {
MyPresenterWidget(EventBus eventBus, ApplicationPresenter applicationPresenter) {
...
eventBus.addHandler(MyOpeningEvent.TYPE, this);
}
public void onMyOpening() {
...
applicationPresenter.addToPopupSlot(this);
}
}
The insight was to bind the PresenterWidget as EagerSingleton.
It would be good to have some auto-generated proxy feature for PresenterWidgets. :)
--
D. Reinert