java.lang.Object | |||||
↳ | com.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.ResizeComposite | ||||
↳ | com.google.gwt.user.client.ui.TabLayoutPanel |
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 text, HTML, or widgets.
This widget will only work in standards mode, which requires that the HTML page in which it is run have an explicit <!DOCTYPE> declaration.
A TabLayoutPanel element in a UiBinder
template must have a barHeight
attribute with a double
value, and may have a barUnit
attribute with a
Style.Unit
value.
barUnit
defaults to PX.
The children of a TabLayoutPanel element are laid out in <g:tab>
elements. Each tab can have one widget child and one of two types of header
elements. A <g:header> element can hold html, or a <g:customHeader>
element can hold a widget. (Note that the tags of the header elements are
not capitalized. This is meant to signal that the head is not a runtime
object, and so cannot have a ui:field
attribute.)
For example:
<g:TabLayoutPanel barUnit='EM' barHeight='3'> <g:tab> <g:header size='7'><b>HTML</b> header</g:header> <g:Label>able</g:Label> </g:tab> <g:tab> <g:customHeader size='7'> <g:Label>Custom header</g:Label> </g:customHeader> <g:Label>baker</g:Label> </g:tab> </g:TabLayoutPanel>
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.gwt.user.client.ui.UIObject
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates an empty tab panel.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Convenience overload to allow
IsWidget to be used directly. | |||||||||||
Adds a widget to the panel.
| |||||||||||
Adds a widget to the panel.
| |||||||||||
Convenience overload to allow
IsWidget to be used directly. | |||||||||||
Adds a child widget.
| |||||||||||
Adds a widget to the panel.
| |||||||||||
Convenience overload to allow
IsWidget to be used directly. | |||||||||||
Adds a widget to the panel.
| |||||||||||
Convenience overload to allow
IsWidget to be used directly. | |||||||||||
Removes all child widgets.
| |||||||||||
Gets the index of the currently-selected tab.
| |||||||||||
Gets the widget in the tab associated with the given child widget.
| |||||||||||
Gets the widget in the tab at the given index.
| |||||||||||
Convenience overload to allow
IsWidget to be used directly. | |||||||||||
Returns the widget at the given index.
| |||||||||||
Returns the number of tabs and widgets.
| |||||||||||
Convenience overload to allow
IsWidget to be used directly. | |||||||||||
Returns the index of the given child, or -1 if it is not a child.
| |||||||||||
Inserts a widget into the panel.
| |||||||||||
Convenience overload to allow
IsWidget to be used directly. | |||||||||||
Convenience overload to allow
IsWidget to be used directly. | |||||||||||
Inserts a widget into the panel.
| |||||||||||
Convenience overload to allow
IsWidget to be used directly. | |||||||||||
Convenience overload to allow
IsWidget to be used directly. | |||||||||||
Inserts a widget into the panel.
| |||||||||||
Inserts a widget into the panel.
| |||||||||||
Inserts a widget into the panel.
| |||||||||||
Gets an iterator for the contained widgets.
| |||||||||||
Removes a child widget.
| |||||||||||
Removes the widget at the specified index.
| |||||||||||
Programmatically selects the specified tab.
| |||||||||||
Programmatically selects the specified tab and fires events.
| |||||||||||
Convenience overload to allow
IsWidget to be used directly. | |||||||||||
Programmatically selects the specified tab and fires events.
| |||||||||||
Convenience overload to allow
IsWidget to be used directly. | |||||||||||
Programmatically selects the specified tab.
| |||||||||||
Sets a tab's HTML contents.
| |||||||||||
Sets a tab's HTML contents.
| |||||||||||
Sets a tab's text contents.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.gwt.user.client.ui.ResizeComposite
| |||||||||||
From class
com.google.gwt.user.client.ui.Composite
| |||||||||||
From class
com.google.gwt.user.client.ui.Widget
| |||||||||||
From class
com.google.gwt.user.client.ui.UIObject
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface com.google.gwt.event.logical.shared.HasAttachHandlers | |||||||||||
From interface com.google.gwt.event.logical.shared.HasBeforeSelectionHandlers | |||||||||||
From interface com.google.gwt.event.logical.shared.HasSelectionHandlers | |||||||||||
From interface com.google.gwt.event.shared.HasHandlers | |||||||||||
From interface
com.google.gwt.user.client.EventListener
| |||||||||||
From interface
com.google.gwt.user.client.ui.HasWidgets
| |||||||||||
From interface
com.google.gwt.user.client.ui.IndexedPanel
| |||||||||||
From interface
com.google.gwt.user.client.ui.IndexedPanel.ForIsWidget
| |||||||||||
From interface
com.google.gwt.user.client.ui.IsWidget
| |||||||||||
From interface
com.google.gwt.user.client.ui.RequiresResize
| |||||||||||
From interface
java.lang.Iterable
|
Creates an empty tab panel.
barHeight | the size of the tab bar |
---|---|
barUnit | the unit in which the tab bar size is specified |
Convenience overload to allow IsWidget
to be used directly.
Adds a widget to the panel. If the Widget is already attached, it will be moved to the right-most index.
child | the widget to be added |
---|---|
tab | the widget to be placed in the associated tab |
Adds a widget to the panel. If the Widget is already attached, it will be moved to the right-most index.
child | the widget to be added |
---|---|
text | the text to be shown on its tab |
asHtml | true to treat the specified text as HTML
|
Convenience overload to allow IsWidget
to be used directly.
Adds a widget to the panel. If the Widget is already attached, it will be moved to the right-most index.
child | the widget to be added |
---|---|
html | the html to be shown on its tab |
Convenience overload to allow IsWidget
to be used directly.
Adds a widget to the panel. If the Widget is already attached, it will be moved to the right-most index.
child | the widget to be added |
---|---|
text | the text to be shown on its tab |
Removes all child widgets.
Gets the index of the currently-selected tab.
-1
if none is selected.
Gets the widget in the tab associated with the given child widget.
child | the child whose tab is to be retrieved |
---|
Gets the widget in the tab at the given index.
index | the index of the tab to be retrieved |
---|
Convenience overload to allow IsWidget
to be used directly.
Returns the widget at the given index.
index | the child widget's index |
---|
Returns the number of tabs and widgets.
Convenience overload to allow IsWidget
to be used directly.
Returns the index of the given child, or -1 if it is not a child.
child | the widget to be found |
---|
-1
if it is not a child of this
panel
Inserts a widget into the panel. If the Widget is already attached, it will be moved to the requested index.
child | the widget to be added |
---|---|
text | the text to be shown on its tab |
beforeIndex | the index before which it will be inserted |
Convenience overload to allow IsWidget
to be used directly.
Convenience overload to allow IsWidget
to be used directly.
Inserts a widget into the panel. If the Widget is already attached, it will be moved to the requested index.
child | the widget to be added |
---|---|
tab | the widget to be placed in the associated tab |
beforeIndex | the index before which it will be inserted |
Convenience overload to allow IsWidget
to be used directly.
Convenience overload to allow IsWidget
to be used directly.
Inserts a widget into the panel. If the Widget is already attached, it will be moved to the requested index.
child | the widget to be added |
---|---|
html | the html to be shown on its tab |
beforeIndex | the index before which it will be inserted |
Inserts a widget into the panel. If the Widget is already attached, it will be moved to the requested index.
child | the widget to be added |
---|---|
beforeIndex | the index before which it will be inserted |
Inserts a widget into the panel. If the Widget is already attached, it will be moved to the requested index.
child | the widget to be added |
---|---|
text | the text to be shown on its tab |
asHtml | true to treat the specified text as HTML |
beforeIndex | the index before which it will be inserted |
Gets an iterator for the contained widgets. This iterator is required to
implement remove()
.
Removes a child widget.
w | the widget to be removed |
---|
true
if the widget was present
Removes the widget at the specified index.
index | the index of the widget to be removed |
---|
false
if the widget is not present
Programmatically selects the specified tab.
child | the child whose tab is to be selected |
---|---|
fireEvents | true to fire events, false not to |
Programmatically selects the specified tab and fires events.
index | the index of the tab to be selected |
---|
Programmatically selects the specified tab and fires events.
child | the child whose tab is to be selected |
---|
Convenience overload to allow IsWidget
to be used directly.
Programmatically selects the specified tab.
index | the index of the tab to be selected |
---|---|
fireEvents | true to fire events, false not to |
Sets a tab's HTML contents.
Use care when setting an object's HTML; it is an easy way to expose
script-based security problems. Consider using
setTabHTML(int, SafeHtml)
or
setTabText(int, String)
whenever possible.
index | the index of the tab whose HTML is to be set |
---|---|
html | the tab's new HTML contents |
Sets a tab's HTML contents.
index | the index of the tab whose HTML is to be set |
---|---|
html | the tab's new HTML contents |
Sets a tab's text contents.
index | the index of the tab whose text is to be set |
---|---|
text | the object's new text |