Class DeckPanel

public class DeckPanel
extends ComplexPanel
A panel that displays all of its child widgets in a 'deck', where only one can be visible at a time. It is used by TabPanel.

Constructors

DeckPanel()Creates an empty deck panel.

Methods

add(Widget)
getVisibleWidget()Gets the index of the currently-visible widget.
insert(Widget, int)Inserts a widget into the panel
remove(Widget)
showWidget(int)Shows the widget at the specified index.

Constructor Detail

DeckPanel

public DeckPanel()
Creates an empty deck panel.

Method Detail

add

public boolean add(Widget w)

Parameters

w

getVisibleWidget

public int getVisibleWidget()
Gets the index of the currently-visible widget.

Return Value

the visible widget's index

insert

public boolean insert(Widget w, int beforeIndex)
Inserts a widget into the panel

Parameters

w
the widget to be inserted
beforeIndex
the index before which it will be inserted

Return Value

true on success (some panels place restrictions on how children may be added or inserted)

remove

public boolean remove(Widget w)

Parameters

w

showWidget

public void showWidget(int index)
Shows the widget at the specified index. This causes the currently- visible widget to be hidden.

Parameters

index
the index of the widget to be shown