public abstract class NavigationGraph extends Object
PageNode
and contain injected TransitionTo
fields.
The concrete implementation of this class is usually generated at compile-time by scanning for page classes. It is
expected to fill in the pagesByName
map in its constructor.
Modifier and Type | Class and Description |
---|---|
protected static class |
NavigationGraph.PageNodeCreationalCallback<W extends com.google.gwt.user.client.ui.IsWidget> |
Modifier and Type | Field and Description |
---|---|
protected AsyncBeanManager |
bm |
protected Map<String,PageNode<? extends com.google.gwt.user.client.ui.IsWidget>> |
pagesByName
Maps page names to the classes that implement them.
|
protected com.google.common.collect.Multimap<Class<? extends PageRole>,PageNode<? extends com.google.gwt.user.client.ui.IsWidget>> |
pagesByRole |
Constructor and Description |
---|
NavigationGraph() |
Modifier and Type | Method and Description |
---|---|
Collection<PageNode<? extends com.google.gwt.user.client.ui.IsWidget>> |
getAllPages() |
<W extends com.google.gwt.user.client.ui.IsWidget> |
getPage(Class<W> type)
Returns an instance of the given page type.
|
<W extends com.google.gwt.user.client.ui.IsWidget> |
getPage(String name)
Returns an instance of the given page type.
|
PageNode |
getPageByRole(Class<? extends UniquePageRole> role) |
Collection<PageNode<? extends com.google.gwt.user.client.ui.IsWidget>> |
getPagesByRole(Class<? extends PageRole> role)
Returns all pages that have the specified role.
|
boolean |
isEmpty()
Returns true if and only if there are no pages in this nagivation graph.
|
protected final AsyncBeanManager bm
protected final Map<String,PageNode<? extends com.google.gwt.user.client.ui.IsWidget>> pagesByName
public <W extends com.google.gwt.user.client.ui.IsWidget> PageNode<W> getPage(String name)
name
- The page name, as defined by the implementation of page.public <W extends com.google.gwt.user.client.ui.IsWidget> PageNode<W> getPage(Class<W> type)
type
- The Class object for the bean that implements the page.public Collection<PageNode<? extends com.google.gwt.user.client.ui.IsWidget>> getPagesByRole(Class<? extends PageRole> role)
getPage(Class)
PageRole
role
- the role used to lookup the pagespublic PageNode getPageByRole(Class<? extends UniquePageRole> role)
public boolean isEmpty()
public Collection<PageNode<? extends com.google.gwt.user.client.ui.IsWidget>> getAllPages()
PageNodes
in the navigation graph.Copyright © 2013-2015 JBoss, a division of Red Hat. All Rights Reserved.