|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectFlowPanel
org.spiffyui.client.nav.HasNavBarListenersPanel
org.spiffyui.client.nav.MainNavBar
public class MainNavBar
This is the navigation bar for the main page.
Field Summary | |
---|---|
protected static java.lang.String |
SELECTED_CLASS
The class used for selected navigation items |
Constructor Summary | |
---|---|
MainNavBar()
Create a new MainNavBar |
Method Summary | |
---|---|
void |
add(Widget w)
|
protected void |
addHistoryItem(java.lang.String historyToken)
Deprecated. This method is deprecated and will not be called. |
protected void |
addHistoryItem(java.lang.String historyToken,
java.lang.String title)
A routine to store a history token that this Navbar can use when called in the future when the forward or back button's are called. |
protected void |
addNavItem(NavItem item)
Addes a nav item to the list of anchors to listen to |
void |
clear()
Remove all the items from this navigation bar. |
void |
fireEvent(NavItem item,
boolean addToHistory)
Fires the click event on the specified nav item |
boolean |
getBookmarkable()
|
NavItem |
getItem(java.lang.String id)
Gets a navigation item from the navigation menu. |
NavItem |
getSelectedItem()
Get the currently selected navigation item in this navigation bar. |
void |
historyChanged(java.lang.String id)
Call-back when the history item is retrieved after a browser back or forward button is pressed. |
void |
onClick(ClickEvent event)
|
void |
remove(NavItem item)
Remove the specified NavItem from the navigation bar. |
boolean |
selectItem(NavItem item)
Selects the specified navigation item and fires the navigation event to let all listeners know it was selected. |
boolean |
selectItem(NavItem item,
boolean addToHistory,
boolean doFirePreEvent)
Selects the specified navigation item and fires the navigation event to let all listeners know it was selected. |
boolean |
selectItem(NavItem item,
boolean addToHistory,
boolean doFirePreEvent,
boolean doFireSelectEvent)
Selects the specified navigation item and can fire the navigation event to let all listeners know it was selected, if the doFireSelectedEvent parameter is set accordingly. |
void |
setBookmarkable(boolean bookmarkable)
|
void |
setEnabled(boolean enabled)
Set the navigation bar to be enabled or disabled. |
Methods inherited from class org.spiffyui.client.nav.HasNavBarListenersPanel |
---|
addListener, fireEvent, firePreEvent, isEnabled, removeListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.String SELECTED_CLASS
Constructor Detail |
---|
public MainNavBar()
Method Detail |
---|
public void add(Widget w)
protected void addNavItem(NavItem item)
item
- the nav item to addpublic void onClick(ClickEvent event)
public void historyChanged(java.lang.String id)
NavItem
reference and select the one with the same ID.
If you subclass and overload the addHistoryItem(String,String)
routine, you
will probably need to overload this method as well, to ensure that the supplied id
(or history token) is translated correctly for your subclass.
historyChanged
in interface HistoryCallback
id
- The history token previously stored on the history stack.public boolean selectItem(NavItem item)
item
- the item to select
public boolean selectItem(NavItem item, boolean addToHistory, boolean doFirePreEvent)
item
- the item to selectaddToHistory
- true if this item should be added to the browser's history and false otherwisedoFirePreEvent
- true to allow interception and cancelling of the event, false to not fire the pre-event
public boolean selectItem(NavItem item, boolean addToHistory, boolean doFirePreEvent, boolean doFireSelectEvent)
item
- the item to selectaddToHistory
- true if this item should be added to the browser's history and false otherwisedoFirePreEvent
- true to allow interception and cancelling of the event, false to not fire the pre-eventdoFireSelectEvent
- true to fire the selection event to navbar listeners, false to not fire the event
public NavItem getSelectedItem()
public NavItem getItem(java.lang.String id)
id
- The id of the item to get
public void setEnabled(boolean enabled)
setEnabled
in class HasNavBarListenersPanel
enabled
- true for enabled and false for disabledpublic void fireEvent(NavItem item, boolean addToHistory)
HasNavBarListenersPanel
fireEvent
in class HasNavBarListenersPanel
item
- the nav item that was clickedaddToHistory
- true if this item should be added to the browser history and false otherwise@Deprecated protected void addHistoryItem(java.lang.String historyToken)
This is available for subclasses to overload if they wish to store a token that is not based on the NavItem's ID. For instance the situation where there are multiple types of identifiers being used to reconstitute a past application state.
Please note that if you overload this method you will need to provide an alternative implementation
of the history callback routine historyChanged(String)
. That will need to translate the
stored token that your overloaded addHistoryItem routine stored.
historyToken
- A string value that will server as a token about the applications stateMainNavBar.addHistoryItem
protected void addHistoryItem(java.lang.String historyToken, java.lang.String title)
This is available for subclasses to overload if they wish to store a token that is not based on the NavItem's ID. For instance the situation where there are multiple types of identifiers being used to reconstitute a past application state.
Please note that if you overload this method you will need to provide an alternative implementation
of the history callback routine historyChanged(String)
. That will need to translate the
stored token that your overloaded addHistoryItem routine stored.
historyToken
- A string value that will server as a token about the applications statetitle
- the window title for this history itempublic void setBookmarkable(boolean bookmarkable)
public boolean getBookmarkable()
public void clear()
public void remove(NavItem item)
item
- the item to remove
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |