|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.google.gwt.user.client.ui.Composite
com.google.gwt.user.client.ui.TabPanel
A panel that represents a tabbed set of pages, each of which contains another widget. Its child widgets are shown as the user selects the various tabs associated with them. The tabs can contain arbitrary HTML.
Note that this widget is not a panel per se, but rather a
Composite
that aggregates a
TabBar
and a
DeckPanel
. It does, however, implement
HasWidgets
.
code
Field Summary |
Fields inherited from class java.lang.Object |
typeId, typeName |
Constructor Summary | |
TabPanel()
Creates an empty tab panel. |
Method Summary | |
void |
add(Widget w,
String tabText)
Adds a widget to the tab panel. |
void |
add(Widget w,
String tabText,
boolean asHTML)
Adds a widget to the tab panel. |
void |
addTabListener(TabListener listener)
Adds a listener interface to receive click events. |
DeckPanel |
getDeckPanel()
Gets the deck panel within this tab panel. |
TabBar |
getTabBar()
Gets the tab bar within this tab panel |
Widget |
getWidget(int index)
|
int |
getWidgetCount()
Gets the number of widgets in this tab panel. |
int |
getWidgetIndex(Widget child)
|
void |
insert(Widget widget,
String tabText,
boolean asHTML,
int beforeIndex)
Inserts a widget into the tab panel. |
void |
insert(Widget widget,
String tabText,
int beforeIndex)
Inserts a widget into the tab panel. |
Iterator |
iterator()
Gets an iterator for the contained widgets. |
boolean |
onBeforeTabSelected(SourcesTabEvents sender,
int tabIndex)
Fired just before a tab is selected. |
void |
onTabSelected(SourcesTabEvents sender,
int tabIndex)
Fired when a tab is selected |
void |
remove(Widget widget)
Removes the given widget, and its associated tab. |
void |
removeTabListener(TabListener listener)
Removes a previously added listener interface. |
void |
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 |
public TabPanel()
Method Detail |
public void add(Widget w, String tabText)
w
- the widget to be addedtabText
- the text to be shown on its tabpublic void add(Widget w, String tabText, boolean asHTML)
w
- the widget to be addedtabText
- the text to be shown on its tabasHTML
- true
to treat the specified text as HTMLpublic void addTabListener(TabListener listener)
SourcesTabEvents
addTabListener
in interface SourcesTabEvents
listener
- the listener interface to addpublic DeckPanel getDeckPanel()
public TabBar getTabBar()
public Widget getWidget(int index)
public int getWidgetCount()
public int getWidgetIndex(Widget child)
public void insert(Widget widget, String tabText, boolean asHTML, int beforeIndex)
widget
- the widget to be insertedtabText
- the text to be shown on its tabasHTML
- true
to treat the specified text as HTMLbeforeIndex
- the index before which it will be insertedpublic void insert(Widget widget, String tabText, int beforeIndex)
widget
- the widget to be insertedtabText
- the text to be shown on its tabbeforeIndex
- the index before which it will be insertedpublic Iterator iterator()
HasWidgets
iterator
in interface HasWidgets
HasWidgets.iterator()
public boolean onBeforeTabSelected(SourcesTabEvents sender, int tabIndex)
TabListener
onBeforeTabSelected
in interface TabListener
sender
- the TabBar
or TabPanel
whose tab was
selected.tabIndex
- the index of the tab about to be selected
false
to disallow the selection. If any listener
returns false, then the selection will be disallowed.public void onTabSelected(SourcesTabEvents sender, int tabIndex)
TabListener
onTabSelected
in interface TabListener
sender
- the TabBar
or TabPanel
whose tab was selectedtabIndex
- the index of the tab that was selectedpublic void remove(Widget widget)
widget
- the widget to be removedpublic void removeTabListener(TabListener listener)
SourcesTabEvents
removeTabListener
in interface SourcesTabEvents
listener
- the listener interface to removepublic void selectTab(int index)
index
- the index of the tab to be selected
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |