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.StackLayoutPanel |
A panel that stacks its children vertically, displaying only one at a time, with a header for each child which the user can click to display.
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 StackLayoutPanel element in a
UiBinder
template may have a
unit
attribute with a
Style.Unit
value (it defaults to
PX).
The children of a StackLayoutPanel element are laid out in <g:stack>
elements. Each stack 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:StackLayoutPanel unit='PX'> <g:stack> <g:header size='3'><b>HTML</b> header</g:header> <g:Label>able</g:Label> </g:stack> <g:stack> <g:customHeader size='3'> <g:Label>Custom header</g:Label> </g:customHeader> <g:Label>baker</g:Label> </g:stack> </g:StackLayoutPanel>
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.gwt.user.client.ui.UIObject
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates an empty stack panel.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adds a child widget to this stack, along with a widget representing the
stack header.
| |||||||||||
Adds a child widget to this stack, along with a widget representing the
stack header.
| |||||||||||
Adds a child widget.
| |||||||||||
Adds a child widget to this stack, along with a widget representing the
stack header.
| |||||||||||
Adds a child widget to this stack, along with a widget representing the
stack header.
| |||||||||||
Removes all child widgets.
| |||||||||||
Gets the widget in the stack header at the given index.
| |||||||||||
Gets the widget in the stack header associated with the given child widget.
| |||||||||||
Gets the currently-selected index.
| |||||||||||
Gets the currently-selected widget.
| |||||||||||
Gets the child widget at the specified index.
| |||||||||||
Gets the number of child widgets in this panel.
| |||||||||||
Gets the index of the specified child widget.
| |||||||||||
Inserts a widget into the panel.
| |||||||||||
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.
| |||||||||||
This method must be called whenever the implementor's size has been
modified.
| |||||||||||
Removes a child widget.
| |||||||||||
Removes the widget at the specified index.
| |||||||||||
Sets a stack header's HTML contents.
| |||||||||||
Sets a stack header's HTML contents.
| |||||||||||
Sets a stack header's text contents.
| |||||||||||
Shows the widget at the specified index and fires events.
| |||||||||||
Shows the specified widget.
| |||||||||||
Shows the specified widget and fires events.
| |||||||||||
Shows the widget at the specified index.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
This method is called immediately after a widget becomes attached to the
browser's document.
|
[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 stack panel.
unit | the unit to be used for layout |
---|
Adds a child widget to this stack, along with a widget representing the stack header.
widget | the child widget to be added |
---|---|
header | the html to be shown on its header |
headerSize | the size of the header widget |
Adds a child widget to this stack, along with a widget representing the stack header.
widget | the child widget to be added |
---|---|
header | the header widget |
headerSize | the size of the header widget |
Adds a child widget to this stack, along with a widget representing the stack header.
widget | the child widget to be added |
---|---|
header | the text to be shown on its header |
headerSize | the size of the header widget |
Adds a child widget to this stack, along with a widget representing the stack header.
widget | the child widget to be added |
---|---|
header | the text to be shown on its header |
asHtml | true to treat the specified text as HTML |
headerSize | the size of the header widget |
Removes all child widgets.
Gets the widget in the stack header at the given index.
index | the index of the stack header to be retrieved |
---|
Gets the widget in the stack header associated with the given child widget.
child | the child whose stack header is to be retrieved |
---|
Gets the currently-selected index.
-1
if none is selected
Gets the currently-selected widget.
null
if none exist
Gets the child widget at the specified index.
index | the child widget's index |
---|
Gets the number of child widgets in this panel.
Gets the index of the specified child widget.
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 header |
asHtml | true to treat the specified text as HTML |
headerSize | the size of the header widget |
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 |
---|---|
html | the safe html to be shown on its header |
headerSize | the size of the header widget |
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 |
---|---|
header | the widget to be placed in the associated header |
headerSize | the size of the header widget |
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 header |
headerSize | the size of the header widget |
beforeIndex | the index before which it will be inserted |
Gets an iterator for the contained widgets. This iterator is required to
implement remove()
.
This method must be called whenever the implementor's size has been modified.
Removes a child widget.
child | 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
Sets a stack header's HTML contents.
index | the index of the header whose HTML is to be set |
---|---|
html | the header's new HTML contents |
Sets a stack header's HTML contents.
Use care when setting an object's HTML; it is an easy way to expose
script-based security problems. Consider using
setHeaderHTML(int, SafeHtml)
or
setHeaderText(int, String)
whenever possible.
index | the index of the header whose HTML is to be set |
---|---|
html | the header's new HTML contents |
Sets a stack header's text contents.
index | the index of the header whose text is to be set |
---|---|
text | the object's new text |
Shows the widget at the specified index and fires events.
index | the index of the child widget to be shown. |
---|
Shows the specified widget.
child | the child widget to be shown. |
---|---|
fireEvents | true to fire events, false not to |
Shows the specified widget and fires events.
child | the child widget to be shown. |
---|
Shows the widget at the specified index.
index | the index of the child widget to be shown. |
---|---|
fireEvents | true to fire events, false not to |
This method is called immediately after a widget becomes attached to the browser's document.