com.github.gwtbootstrap.client.ui
Class Tab

java.lang.Object
  extended by com.github.gwtbootstrap.client.ui.Tab
All Implemented Interfaces:
HasIcon, HasStyle, IsResponsive, HasClickHandlers, HasHandlers, HasWidgets, IsWidget, Iterable<Widget>

public class Tab
extends Object
implements IsWidget, HasWidgets, HasClickHandlers, HasStyle, IsResponsive, HasIcon

The tab widget for TabPanel.

It's for UiBinder. Tab class provide easy syntax on UiBinder.

Example:
 <b:TabPanel>
  <b:Tab heading="Typically">
    <b:Heading size="3">Typically Tab</b:Heading>
    <b:Paragraph>
        huhuhu hahha
    </b:Paragraph>
  </b:Tab>
  <b:Tab heading="Custom">
    <b:customTab>
      <b:Image resources="{res.logo}"/>
    </b:customTab>
    <b:Heading size="3">CustomTab Tab</b:Heading>
  </b:Tab>
 </b:TabPanel>
 
 
}

Since:
2.0.4.0
Author:
ohashi keisuke

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgets
HasWidgets.ForIsWidget
 
Constructor Summary
Tab()
          Create tmpy tab
 
Method Summary
 void add(Widget w)
          Add widget to tab pane.
 HandlerRegistration addClickHandler(ClickHandler handler)
          add ClickEventHandler to TabLink
 void addDecorate(Widget w)
           
 void addStyle(Style style)
          add TabLink style Adds the provided style to the widget.
 TabLink asTabLink()
          Return TabLink
 Widget asWidget()
          Tab as a TabLink
 void clear()
          Clear tab pane children
 void fireEvent(GwtEvent<?> event)
          fire TabLink event
 String getHeading()
          Get Tab text
protected  TabPane getTabPane()
          Get Container TabPane
 boolean isActive()
          has active style name
 Iterator<Widget> iterator()
          call ComplexPanel.iterator()
 boolean remove(Widget w)
          call ComplexPanel.remove(Widget)
 void removeStyle(Style style)
          remove TabLink style Removes the provided style from the widget.
 void setActive(boolean active)
          Set tab active
 void setHeading(String text)
          Set tab text
 void setHideOn(Device device)
          Set TabLink and TabPane show on device.
 void setIcon(IconType type)
          set TabLink icon type.
 void setIconSize(IconSize size)
          Set TabLink icon size Sets the size of the icon.
 void setShowOn(Device device)
          Set TabLink and TabPane show on device.
 void setStyle(Style style)
          set TabLink style Replaces the widet's style with the provided one.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Tab

public Tab()
Create tmpy tab

Method Detail

asWidget

public Widget asWidget()
Tab as a TabLink

Specified by:
asWidget in interface IsWidget

getTabPane

protected TabPane getTabPane()
Get Container TabPane

Returns:
TabPane

asTabLink

public TabLink asTabLink()
Return TabLink

Returns:
tabLink

setActive

public void setActive(boolean active)
Set tab active

Parameters:
active -

isActive

public boolean isActive()
has active style name

Returns:
true:active false:deactive

setHeading

public void setHeading(String text)
Set tab text

Parameters:
text - tab text

getHeading

public String getHeading()
Get Tab text

Returns:
tab text

add

public void add(Widget w)
Add widget to tab pane.

Specified by:
add in interface HasWidgets

clear

public void clear()
Clear tab pane children

Specified by:
clear in interface HasWidgets

iterator

public Iterator<Widget> iterator()
call ComplexPanel.iterator()

Specified by:
iterator in interface HasWidgets
Specified by:
iterator in interface Iterable<Widget>

remove

public boolean remove(Widget w)
call ComplexPanel.remove(Widget)

Specified by:
remove in interface HasWidgets
Returns:
ComplexPanel.remove(Widget) result

addClickHandler

public HandlerRegistration addClickHandler(ClickHandler handler)
add ClickEventHandler to TabLink

Specified by:
addClickHandler in interface HasClickHandlers

setIcon

public void setIcon(IconType type)
set TabLink icon type. Sets the Type of the Icon.

Specified by:
setIcon in interface HasIcon

setIconSize

public void setIconSize(IconSize size)
Set TabLink icon size Sets the size of the icon.

Default is DEFAULT.

Specified by:
setIconSize in interface HasIcon
Parameters:
size - the new size.

setShowOn

public void setShowOn(Device device)
Set TabLink and TabPane show on device. Sets the kind of device, this widget is shown on.

The widget is not shown on any other device.

Only works if responsive design is turned on!

Specified by:
setShowOn in interface IsResponsive
See Also:
Configurator.hasResponsiveDesign(), IsResponsive.setHideOn(Device)

setHideOn

public void setHideOn(Device device)
Set TabLink and TabPane show on device. Sets the kind of device, this widget is hidden on.

The widget is not hidden on any other device.

Only works if responsive design is turned on!

Specified by:
setHideOn in interface IsResponsive
See Also:
Configurator.hasResponsiveDesign(), IsResponsive.setShowOn(Device)

setStyle

public void setStyle(Style style)
set TabLink style Replaces the widet's style with the provided one.

Specified by:
setStyle in interface HasStyle
Parameters:
style - the style to be applied to the Widget.

addStyle

public void addStyle(Style style)
add TabLink style Adds the provided style to the widget.

Specified by:
addStyle in interface HasStyle
Parameters:
style - the style to be added to the Widget.

removeStyle

public void removeStyle(Style style)
remove TabLink style Removes the provided style from the widget.

Specified by:
removeStyle in interface HasStyle
Parameters:
style - the style to be removed from the Widget.

fireEvent

public void fireEvent(GwtEvent<?> event)
fire TabLink event

Specified by:
fireEvent in interface HasHandlers

addDecorate

@UiChild(limit=1,
         tagname="customTab")
public void addDecorate(Widget w)


Copyright © 2012 gwtbootstrap. All Rights Reserved.