I've found the GWT tab panels clunky for the styling I need to do, so I'm trying to make my own, simple tab panel. Basically an HTML5 <nav> element for tabs and a DeckPanel to display the content. Let the use figure out the rest with CSS3.
The GWT TabLayoutPanel has these "special" tags it uses to define the contents of a tab:
<g:TabLayoutPanel>
<g:tab>
<g:header>Tab Title</g:header>
<g:OtherWidget>Tab contents</g:OtherWidget>
</g:tab>
</g:TabLayoutPanel>
I'm referring to <g:tab> and <g:header>. I see these type of tags used in various places but I have no idea how to create them. Looking at the TabLayoutPanel source, I see that it has an add method that expects two widgets, and from that it puts one widget (the contents) into a panel for display and another (the header) into an instance of TabLayoutPanel.Tab. But I have no idea how to duplicate this kind of functionality.
In GWT 2.1 there's the UiChild attribute. It's quite cool.
@UiChild public void addTabDef(Widget page, String title) {...}
The title parameter will be filled with an attribute of the same name in the tabdef tag, like so:
<v:tabdef title="Tab one"><g:Label>Page one.</g:Label></v:tabdef>
Edit: to be clear, tabdef isn't defined anywhere as a class; the desired behaviour during parsing is defined by UiChild attribute.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With