com.google.gwt.user.client.ui
Class TabBar

java.lang.Object
  extended bycom.google.gwt.user.client.ui.UIObject
      extended bycom.google.gwt.user.client.ui.Widget
          extended bycom.google.gwt.user.client.ui.Composite
              extended bycom.google.gwt.user.client.ui.TabBar
All Implemented Interfaces:
ClickListener, EventListener, EventListener, SourcesTabEvents

public class TabBar
extends Composite
implements SourcesTabEvents, ClickListener

A horizontal bar of folder-style tabs, most commonly used as part of a TabPanel.

CSS Style Rules

Example

code


Field Summary
 
Fields inherited from class java.lang.Object
typeId, typeName
 
Constructor Summary
TabBar()
          Creates an empty tab bar.
 
Method Summary
 void addTab(String text)
          Adds a new tab with the specified text.
 void addTab(String text, boolean asHTML)
          Adds a new tab with the specified text.
 void addTabListener(TabListener listener)
          Adds a listener interface to receive click events.
 int getSelectedTab()
          Gets the tab that is currently selected.
 int getTabCount()
          Gets the number of tabs present.
 String getTabHTML(int index)
          Gets the specified tab's HTML.
 void insertTab(String text, boolean asHTML, int beforeIndex)
          Inserts a new tab at the specified index.
 void insertTab(String text, int beforeIndex)
          Inserts a new tab at the specified index.
 void onClick(Widget sender)
          Fired when the user clicks on a widget.
 void removeTab(int index)
          Removes the tab at the specified index.
 void removeTabListener(TabListener listener)
          Removes a previously added listener interface.
 boolean selectTab(int index)
          Programmatically selects the specified tab.
 
Methods inherited from class com.google.gwt.user.client.ui.Composite
getElement, onAttach, onDetach, setWidget
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
getParent, isAttached, onBrowserEvent, onLoad
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleName, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, isVisible, isVisible, removeStyleName, setElement, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setVisible, setVisible, setWidth, sinkEvents, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
equals, finalize, hashCode
 

Constructor Detail

TabBar

public TabBar()
Creates an empty tab bar.

Method Detail

addTab

public void addTab(String text)
Adds a new tab with the specified text.

Parameters:
text - the new tab's text

addTab

public void addTab(String text,
                   boolean asHTML)
Adds a new tab with the specified text.

Parameters:
text - the new tab's text
asHTML - true to treat the specified text as html

addTabListener

public void addTabListener(TabListener listener)
Description copied from interface: SourcesTabEvents
Adds a listener interface to receive click events.

Specified by:
addTabListener in interface SourcesTabEvents
Parameters:
listener - the listener interface to add

getSelectedTab

public int getSelectedTab()
Gets the tab that is currently selected.

Returns:
the selected tab

getTabCount

public int getTabCount()
Gets the number of tabs present.

Returns:
the tab count

getTabHTML

public String getTabHTML(int index)
Gets the specified tab's HTML.

Parameters:
index - the index of the tab whose HTML is to be retrieved
Returns:
the tab's HTML

insertTab

public void insertTab(String text,
                      boolean asHTML,
                      int beforeIndex)
Inserts a new tab at the specified index.

Parameters:
text - the new tab's text
asHTML - true to treat the specified text as HTML
beforeIndex - the index before which this tab will be inserted

insertTab

public void insertTab(String text,
                      int beforeIndex)
Inserts a new tab at the specified index.

Parameters:
text - the new tab's text
beforeIndex - the index before which this tab will be inserted

onClick

public void onClick(Widget sender)
Description copied from interface: ClickListener
Fired when the user clicks on a widget.

Specified by:
onClick in interface ClickListener
Parameters:
sender - the widget sending the event.

removeTab

public void removeTab(int index)
Removes the tab at the specified index.

Parameters:
index - the index of the tab to be removed

removeTabListener

public void removeTabListener(TabListener listener)
Description copied from interface: SourcesTabEvents
Removes a previously added listener interface.

Specified by:
removeTabListener in interface SourcesTabEvents
Parameters:
listener - the listener interface to remove

selectTab

public boolean selectTab(int index)
Programmatically selects the specified tab.

Parameters:
index - the index of the tab to be selected
Returns:
true if successful, false if the change is denied by the TabListener.


This javadoc distribution was not produced by Google. The official documentation is here.