tags:

views:

21

answers:

1

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.

+2  A: 

To use custome tags for you widget like <g:tab> and <g:header> you need to create a custom ElementParse and register it with the UiBinderWriter. Unfortanatly there is no simple way of doing this yet without editing the sourcecode for gwt.

Usefull links:

A link to the issue of not being able to create custom ElementParser

TabLayoutPanelParser

pathed
Well, that's not really worth it. I suppose I can just use a simple composite container. First child is a header, second is the contents. Thanks!
Matt Olenik