On 6 mai, 18:56, Sudhir <[email protected]> wrote:
> I've made horizontal and vertical flow panels and put them up here:
>
> http://blog.sudhirj.com/2009/05/vertical-and-horizontal-flow-panels-i...
>
> Any idea why something like this isn't in GWT in the first place? It
> would be useful...

Principle of least surprise:
a) your HorizontalFlowPanel would probably behave strangely once you
add a widget based on a <table>, or a widget based on, say, a <div>
but containing other block elements
b) your panels change the child widgets' style, so moving them into
another panel would break your assumptions (add FlowPanel to a
HorizontalFlowPanel and then move it to a FlowPanel)

And, last but not least, it's so easy for a developer to use a
FlowPanel and opt-in to use "display: inline" on its child widgets
(and/or use your code or something similar if he knows what he's
doing) that it isn't worth it to add those flow widgets to GWT
(compared to the side effects enlightened above); the key word here is
"opt-in".

> The tables implementation seems very messy.

Yes, but they're known to work in most (if not every) situation, and
they allow *per widget* vertical (for the HorizontalPanel) and
horizontal (for VerticalPanel) alignment.

What's actually missing in GWT is an InlineFlowPanel, i.e. a FlowPanel
based on a <span> rather than a <div>, but again it could easily break
your assumptions as soon as you add "block" child widgets (hopefully,
"inline" would be a better description than "horizontal" and people,
even newbies, could easily understand which kind of widgets they can
add as a child and which they shouldn't; provided that the widgets are
explicitly documented as being an "inline widget" or "block widget" --
most if not all layout widgets are "blocks", and most other widgets
are "inline", notable exception: Hyperlink).
On the other hand, making your own InlineFlowPanel is really easy too
(copy FlowPanel and replace the div with a span; or eventually inherit
FlowPanel and use replaceElement in your constructor, but you'll then
create a div that is immediately discarded and replaced with a span...)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to