gabrial11392 / gwt-platform

Automatically exported from code.google.com/p/gwt-platform
0 stars 0 forks source link

Consider creating PresenterWiget's notifyReveal() #16

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Right now, there is a lot of confusion between the concept of "revealing" a 
presenter and "notifying a presenter that it has been revealed". There should 
be a way to clean-up these two concepts. Probably have "reveal()" only in 
Presenter (not in PresenterWidget) and a new notifyReveal() method in 
PresenterWidget.

Original Issue:
http://code.google.com/p/puzzlebazar/issues/detail?id=77

Original issue reported on code.google.com by philippe.beaudoin on 27 Mar 2010 at 6:11

GoogleCodeExporter commented 9 years ago
This has been radically simplified. No more notifyHide and notifyReveal. The 
logic 
was cleaned so that onReveal and onHide are called exactly once on presenters 
when 
they are revealed or hidden, and this is validated through an assert() in 
PresenterWidget#onReveal and #onHide. Failing this assert probably means the 
user 
failed to call super.onReveal() or super.onHide(). onReveal is called so that 
parents are made visible before their child. onHide is called so that child are 
made 
invisible before their parent.

The reveal() method is now only available only on a Presenter. It will defer 
the 
call to the proxy, so that everything is validated by the Place (i.e. 
canReveal() is 
checked). There is a new forceReveal() which is used by a proxy that wants its 
presenter to reveal itself. It should typically not be called by the user, 
although 
doint so probably wouldn't fail, it would just bypass the canReveal() 
validation.

The last little nasty bit left is in ProxyPlaceAbstract#handleRequest and it 
should 
be addressed with  Issue 15 .

Original comment by philippe.beaudoin on 27 Mar 2010 at 6:12