I took a similar approach but made it more generic and didn't add
special Widget wrapping methods (I just add ElementPanel("LI") to an
ElementPanel("UL") or ElementPanel("OL"). I like your approach which
enforces usage.
/**
* A generic element panel for Hx, UL, LI, etc.
*/
public class ElementPanel extends ComplexPanel implements HasText,
HasHTML {
public ElementPanel(String tagname) {
setElement(DOM.createElement(tagname));
}
// more stuff in here .....
}
I'm not sure I understand the need for the special clear() method
implementation in your code.
-Andy
On Sep 24, 5:51 pm, Markus Kramer <[email protected]> wrote:
> Hi, for my current GWT project I wanted to make more use of HTML UL/LI
> elements than the table based layouts that you normally use in GWT
> applications.
> Biggest advantages for me is that other people can make changes to the
> layout/design of the page without having to touch the code itself.
>
> I couldn't find a class in GWT or anywhere else that helps with that,
> so I wrote my own. I can now create HTML like this:
>
> <ul class="sampleList">
> <li>Widget A</li>
> <li>Widget B</li>
> </ul>
>
> with this code:
>
> UlListPanel ulList = new UlListPanel();
> ulList.addStyleName("sampleList");
> ulList.add(widgetA);
> ulList.add(widgetB);
>
> For the code go
> here:http://markusbraindump.blogspot.com/2010/09/gwt-panel-for-html-ulli-l...
>
> Or did I reinvent the wheel?
>
> Markus
--
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.