PageView
Retained page container that keeps exactly one page visible at a time.
Overview
Retained page container that keeps exactly one page visible at a time. Provides extensive layout configuration and interaction capabilities.
Basic Usage
PageView pageView = new PageView();
pageView.addPage(new Label("Page 1"));
pageView.addPage(new Label("Page 2"));
pageView.selectedIndex(0);
Related links
- TabControl: Tabbed navigation container with a scrollable header bar and switched content area.
API
PageView::addPage(Widget)
Appends a page widget to the end of the page list.
| Parameter | Type | Description |
|---|---|---|
page |
Widget |
The page widget. |
Returns PageView: This instance for chaining..
PageView::clearPages()
Removes all pages from the container.
Returns PageView: This instance for chaining..
PageView::insertPage(int, Widget)
Inserts a page widget at the specified index.
| Parameter | Type | Description |
|---|---|---|
index |
int |
The index position. |
page |
Widget |
The page widget. |
Returns PageView: This instance for chaining..
PageView::onSelectionChanged(EventListener)
Registers a listener invoked when the selected page index changes.
| Parameter | Type | Description |
|---|---|---|
listener |
EventListener |
The event listener callback. |
Returns EventSubscription: The event subscription handle..
PageView::pageCount()
Returns the total number of pages.
Returns int: The total number of pages..
PageView::pages()
Returns an unmodifiable list of all contained page widgets.
Returns List: An unmodifiable list of page widgets..
PageView::removePage(Widget)
Removes the specified page widget.
| Parameter | Type | Description |
|---|---|---|
page |
Widget |
The page widget. |
Returns PageView: This instance for chaining..
PageView::removePage(int)
Removes the page at the specified index.
| Parameter | Type | Description |
|---|---|---|
index |
int |
The index position. |
Returns PageView: This instance for chaining..
PageView::selectRelative(int)
Shifts current page selection by the specified relative delta offset.
| Parameter | Type | Description |
|---|---|---|
delta |
int |
The relative offset delta. |
Returns PageView: This instance for chaining..
PageView::selectedIndex()
Returns the 0-based index of the currently selected page.
Returns int: The selected index, or -1 if none..
PageView::selectedIndex(int)
Selects the active page by index, firing a selection change event.
| Parameter | Type | Description |
|---|---|---|
selectedIndex |
int |
The selected index. |
Returns PageView: This instance for chaining..
PageView::selectedPage()
Returns the currently selected active page widget, or null if none.
Returns Widget: The selected page widget, or null if none..
PageView::silentSelectedIndex(int)
Silently selects a page index without emitting selection change events.
| Parameter | Type | Description |
|---|---|---|
selectedIndex |
int |
The selected index. |
Returns PageView: This instance for chaining..