public abstract class Page extends Object
An application creates a screen by extending this class and implementing getContent().
A page is a lightweight factory for its visual content, not the content itself: the navigator asks
the page to build its widget each time the page is about to be shown, so a fresh widget is produced
on every navigation to the page.
A page is never constructed by the Navigator: the application's PageFactory builds
it from the page's int key. Per-navigation data is supplied through the page's own
constructor (constructor injection performed by the factory); the framework owns no parameter slot,
and the public navigation API accepts keys, never page instances. The data itself may come from the
navigation that triggered the build: Navigator.navigateTo(int, Object) and
Navigator.replaceWith(int, Object) carry an argument to
PageFactory.create(int, Object), which the factory injects. A page navigates through
Navigator.getInstance().
| Constructor and Description |
|---|
Page() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract Widget |
getContent()
Creates the visual content of this page.
|
protected void |
onEntered()
Notifies this page that it has become the active page.
|
protected void |
onExited()
Notifies this page that it has ceased to be the active page.
|
protected abstract Widget getContent()
Called by the Navigator when the page is about to be shown. A fresh widget is produced on
each navigation to the page.
protected void onEntered()
Invoked immediately after the navigation operation, before the transition animation starts. A navigation requested from this callback is deferred and performed once the navigation in progress is finished. This default implementation does nothing.
protected void onExited()
Invoked with the same timing as onEntered(). This default implementation does nothing.