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

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.Panel
              extended bycom.google.gwt.user.client.ui.ComplexPanel
                  extended bycom.google.gwt.user.client.ui.StackPanel
All Implemented Interfaces:
EventListener, HasWidgets

public class StackPanel
extends ComplexPanel

A panel that stacks its children vertically, displaying only one at a time, with a header for each that the user can click to display it.

CSS Style Rules

Example

code


Field Summary
 
Fields inherited from class java.lang.Object
typeId, typeName
 
Constructor Summary
StackPanel()
          Creates an empty stack panel.
 
Method Summary
 boolean add(Widget w)
          Adds a new child widget to the panel.
 boolean add(Widget w, String stackText)
          Adds a widget to the panel, along with its header.
 boolean add(Widget w, String stackText, boolean asHTML)
          Adds a widget to the panel, along with its header, optionally interpreting the header as HTML.
 void onBrowserEvent(Event event)
          Fired whenever a browser event is received.
 boolean remove(Widget child)
          Removes a widget from the panel.
 void setStackText(int index, String text)
          Sets the text associated with a widget, by its index.
 void setStackText(int index, String text, boolean asHTML)
          Sets the text associated with a widget, by its index.
 void showStack(int index)
          Shows the widget at the specified index.
 
Methods inherited from class com.google.gwt.user.client.ui.ComplexPanel
clear, getWidget, getWidgetCount, getWidgetIndex, insert, iterator
 
Methods inherited from class com.google.gwt.user.client.ui.Panel
adopt, disown, onAttach, onDetach
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
getParent, isAttached, onLoad
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleName, getAbsoluteLeft, getAbsoluteTop, getElement, 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

StackPanel

public StackPanel()
Creates an empty stack panel.

Method Detail

add

public boolean add(Widget w)
Description copied from class: Panel
Adds a new child widget to the panel.

Overrides:
add in class ComplexPanel

add

public boolean add(Widget w,
                   String stackText)
Adds a widget to the panel, along with its header.

Parameters:
w - the widget to be added
stackText - the header text associated with this widget
Returns:
true if successful

add

public boolean add(Widget w,
                   String stackText,
                   boolean asHTML)
Adds a widget to the panel, along with its header, optionally interpreting the header as HTML.

Parameters:
w - the widget to be added
stackText - the header text associated with this widget
asHTML - true to treat the specified text as HTML
Returns:
true if successful

onBrowserEvent

public void onBrowserEvent(Event event)
Description copied from interface: EventListener
Fired whenever a browser event is received.

Specified by:
onBrowserEvent in interface EventListener
Overrides:
onBrowserEvent in class Widget

remove

public boolean remove(Widget child)
Description copied from class: Panel
Removes a widget from the panel.

Overrides:
remove in class ComplexPanel

setStackText

public void setStackText(int index,
                         String text)
Sets the text associated with a widget, by its index.

Parameters:
index - the index of the widget whose text is to be set
text - the text to be associated with it

setStackText

public void setStackText(int index,
                         String text,
                         boolean asHTML)
Sets the text associated with a widget, by its index.

Parameters:
index - the index of the widget whose text is to be set
text - the text to be associated with it
asHTML - true to treat the specified text as HTML

showStack

public void showStack(int index)
Shows the widget at the specified index.

Parameters:
index - the widget index to be shown


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