|
Errai 3.0.1-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.errai.ui.nav.client.local.Navigation
public class Navigation
Central control point for navigating between pages of the application.
Configuration is decentralized: it is based on fields and annotations present in other application classes. This configuration is gathered at compile time.
Page
,
PageState
,
PageShowing
,
PageShown
,
PageHiding
,
PageHidden
Field Summary | |
---|---|
protected PageNode<com.google.gwt.user.client.ui.IsWidget> |
currentPage
|
protected com.google.gwt.user.client.ui.IsWidget |
currentWidget
|
Constructor Summary | |
---|---|
Navigation()
|
Method Summary | ||
---|---|---|
void |
cleanUp()
Public for testability. |
|
com.google.gwt.user.client.ui.IsWidget |
getContentPanel()
Returns the panel that this Navigation object manages. |
|
PageNode<com.google.gwt.user.client.ui.IsWidget> |
getCurrentPage()
Return the current page that is being displayed. |
|
Collection<PageNode<? extends com.google.gwt.user.client.ui.IsWidget>> |
getPagesByRole(Class<? extends PageRole> pageRole)
Return all PageNode instances that have specified pageRole. |
|
|
goTo(Class<W> toPage,
com.google.common.collect.Multimap<String,String> state)
Looks up the PageNode instance that provides content for the given widget type, sets the state on that page, then makes the widget visible in the content area. |
|
void |
goTo(String toPage)
Same as goTo(Class, com.google.common.collect.Multimap) but then with the page name. |
|
void |
goToWithRole(Class<? extends UniquePageRole> role)
Looks up the PageNode instance of the page that has the unique role set and makes the widget visible in the content area. |
|
void |
setErrorHandler(PageNavigationErrorHandler handler)
Set an error handler that is called in case of a PageNotFoundException error during page navigation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected PageNode<com.google.gwt.user.client.ui.IsWidget> currentPage
protected com.google.gwt.user.client.ui.IsWidget currentWidget
Constructor Detail |
---|
public Navigation()
Method Detail |
---|
public void setErrorHandler(PageNavigationErrorHandler handler)
PageNotFoundException
error during page navigation.
handler
- An error handler for navigation. Setting this to null assigns the DefaultNavigationErrorHandler
@PreDestroy public void cleanUp()
public <W extends com.google.gwt.user.client.ui.IsWidget> void goTo(Class<W> toPage, com.google.common.collect.Multimap<String,String> state)
toPage
- The content type of the page node to look up and display. Normally, this is a Widget subclass that has
been annotated with @Page
.state
- The state information to set on the page node before showing it. Normally the map keys correspond with the
names of fields annotated with @PageState
in the widget class, but this is not required.public void goTo(String toPage)
goTo(Class, com.google.common.collect.Multimap)
but then with the page name.
toPage
- the name of the page node to lookup and display.public void goToWithRole(Class<? extends UniquePageRole> role)
role
- The unique role of the page that needs to be displayed.public Collection<PageNode<? extends com.google.gwt.user.client.ui.IsWidget>> getPagesByRole(Class<? extends PageRole> pageRole)
pageRole
- the role to find PageNodes by
public PageNode<com.google.gwt.user.client.ui.IsWidget> getCurrentPage()
public com.google.gwt.user.client.ui.IsWidget getContentPanel()
|
Errai 3.0.1-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |