On 2009/09/02, Sami Jaber wrote:
> Just a few remarks relating to the design changes...
> RequiresLayout.java : We expose now animation routines in this
interface. With
> those new animation methods this interface becomes more constraining
when you
> have to provide a subclass. What about a panel provider that would not
want to
> implement any animation stuff ? Maybe something like
> RequiresLayoutWithAnimation and RequiresLayoutWithoutAnimation or
design
> something that would lead to optional animation would be nice.
> LayoutPanel.java : ProvidesLayout is replaced by both interfaces
RequiresResize
> and ProvidesResize. IMHO this split seems to be redundant. Why this
separation
> if at the end onLayout() calls onResize() and onResize() calls
onResize() for
> all its children?
> ProvidesLayout.java: This class is removed and replaced by
ProvideResize but in
> the providers side, we have two different interfaces RequiresLayout
and
> RequiresResize...
> Joel, would be very interested to understand the limitations you got
in the
> previous design.
I probably should have explained this in more detail in the initial
change description. In the original design, we had {Requires,
Provides}Layout interfaces. These have simply been renamed to {Requires,
Provides}Resize. The reason is that the word "layout" had been badly
overloaded to mean both "realize any pending changes to this panel's
layout, possibly animating" and "notify this widget that its size may
have changed". The former is, IMHO, closer to the dictionary meaning of
"layout", while the latter is closer to the standard IE event "onresize"
(if only every browser had implemented that incredibly useful event, we
wouldn't even have to discuss this!).
As for the new version of RequiresLayout, I'm actually somewhat
ambivalent about this as an interface. Originally, they (layout(),
layout(int), and layout(int, callback)) were just instance methods on
individual panels, but they ended up being the same on LayoutPanel,
DockLayoutPanel, StackLayoutPanel, etc, and I really didn't want to
document them in 3+ different places. It was also nice to be able to say
"if this widget implements RequiresLayout, then you *must* call layout()
to realize any pending changes" in one place.
I wouldn't object to having RequiresLayout just contain the layout()
method, possibly moving the others to another interface (again, to avoid
the multiple-javadoc problem). Anyone have any thoughts on this
(preferably with an idea for what this interface should be called)?
http://gwt-code-reviews.appspot.com/63801
--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---