|
||||||||||
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.Panel
com.google.gwt.user.client.ui.ComplexPanel
com.google.gwt.user.client.ui.StackPanel
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.
public class StackPanelExample implements EntryPoint { public void onModuleLoad() { // Create a stack panel containing three labels. StackPanel panel = new StackPanel(); panel.add(new Label("Foo"), "foo"); panel.add(new Label("Bar"), "bar"); panel.add(new Label("Baz"), "baz"); // Add it to the root panel. RootPanel.get().add(panel); } }
Constructor Summary | |
StackPanel()
Creates an empty stack panel. |
Method Summary | |
void |
add(Widget w)
Adds a widget to the stack. |
void |
add(Widget w,
java.lang.String stackText)
Adds a widget to the panel, along with its header. |
void |
add(Widget w,
java.lang.String stackText,
boolean asHTML)
Adds a widget to the panel, along with its header, optionally interpreting the header as HTML. |
Widget |
getWidget(int index)
Gets the child widget at the specified index. |
int |
getWidgetCount()
Gets the number of child widgets in this panel. |
int |
getWidgetIndex(Widget child)
Gets the index of the specified child widget. |
void |
onBrowserEvent(Event event)
Fired whenever a browser event is received. |
boolean |
remove(int index)
Removes the widget at the specified index. |
boolean |
remove(Widget child)
Removes a child widget. |
void |
setStackText(int index,
java.lang.String text)
Sets the text associated with a widget, by its index. |
void |
setStackText(int index,
java.lang.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 |
add, getChildren, insert, iterator |
Methods inherited from class com.google.gwt.user.client.ui.Panel |
adopt, clear, disown, onAttach, onDetach |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
getParent, isAttached, onLoad, removeFromParent |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
addStyleName, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleName, getTitle, isVisible, isVisible, removeStyleName, setElement, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setTitle, setVisible, setVisible, setWidth, sinkEvents, toString, unsinkEvents |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public StackPanel()
Method Detail |
public void add(Widget w)
add
in interface HasWidgets
add
in class Panel
w
- the widget to be addedpublic void add(Widget w, java.lang.String stackText)
w
- the widget to be addedstackText
- the header text associated with this widgetpublic void add(Widget w, java.lang.String stackText, boolean asHTML)
w
- the widget to be addedstackText
- the header text associated with this widgetasHTML
- true
to treat the specified text as HTMLpublic Widget getWidget(int index)
IndexedPanel
getWidget
in interface IndexedPanel
index
- the child widget's index
public int getWidgetCount()
IndexedPanel
getWidgetCount
in interface IndexedPanel
public int getWidgetIndex(Widget child)
IndexedPanel
getWidgetIndex
in interface IndexedPanel
child
- the widget to be found
-1
if it is not a child of
this panelpublic void onBrowserEvent(Event event)
EventListener
onBrowserEvent
in interface EventListener
onBrowserEvent
in class Widget
public boolean remove(int index)
IndexedPanel
remove
in interface IndexedPanel
index
- the index of the widget to be removed
false
if the widget is not presentpublic boolean remove(Widget child)
HasWidgets
remove
in interface HasWidgets
remove
in class ComplexPanel
public void setStackText(int index, java.lang.String text)
index
- the index of the widget whose text is to be settext
- the text to be associated with itpublic void setStackText(int index, java.lang.String text, boolean asHTML)
index
- the index of the widget whose text is to be settext
- the text to be associated with itasHTML
- true
to treat the specified text as HTMLpublic void showStack(int index)
index
- the widget index to be shown
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |