Vertical TabPanel

The default TabPanel in GWT supports only a Horizontal TabBar. If you want to create a TabPanel which has a Vertical TabBar on the left side of the TabPanel you need to create a complete new implementation, because it is not possible to subclass the TabPanel class and modify the layout. Take the KitchenSink example. This is a Vertical TabPanel, but not implemented as one. With a VerticalTabPanel you can get the same layout.
The following 2 classes are modified versions of the TabPanel and the TabBar to display as a VerticalTabPanel:

VerticalTabPanel.java

VerticalTabBar.java

Notes:

The TabPanel and TabBar are based on the not yet released GWT 1.4 TabBar, which include the feature to add widgets to the tabBar.

Furthermore, I added the method getSelectedTabWidget which returns, just as it implies, the widget of the selected tab. This can be useful if you want to dynamically change the style on a selected tab, for example set a different background color.

One Response to “Vertical TabPanel”

  1. Nitin Says:

    Hi,
    I am using this Vertical TabPanel ; and I have one specific requirement, i.e. i have to add two check boxes in the the bottom edge of the bar. and I am not able to get access to that HTML

    HTML first = new HTML(” ”, true),
    rest = new HTML(” ”, true); line no.123

    u know how can i manage to add checkboxes in the “rest” HTML which is added in to VerticalTabBar.

    Could u please help in to this.u can reply me on nitipatil@gmail.com

    Thanks in advance !!

    Nitin