votorola.a.web
Class NavTab

java.lang.Object
  extended by NavTab
Direct Known Subclasses:
SuperTab, WP_Election.ElectionTab, WP_Voter.VoterTab

@ThreadSafe
public abstract class NavTab
extends Object

A tab in a navigation bar, serving as a link to a page.


Constructor Summary
NavTab()
           
 
Method Summary
abstract  Bookmark bookmark()
          Returns a bookmark for the page to which this tab links.
 boolean isEnabled(VRequestCycle cycle)
          Answers whether or not the tab is to be enabled, when it is off the selection path.
 NavBar navBar()
          Returns the navigation bar that contains this tab.
 Class pageClass()
          Returns the class of pages to which this tab links; or null, if there is no single class.
 RequestCycleRunner runner(VRequestCycle cycle)
          Returns a runner to handle any clicks on this tab (experimental).
 NavTab setNavBar(NavBar navBar)
          Sets the navigation bar that contains this tab.
abstract  String shortTitle(VRequestCycle cycle)
          Returns a short title for this tab, suitable as the body of a link.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NavTab

public NavTab()
Method Detail

bookmark

public abstract Bookmark bookmark()
Returns a bookmark for the page to which this tab links.


isEnabled

public boolean isEnabled(VRequestCycle cycle)
Answers whether or not the tab is to be enabled, when it is off the selection path. Tabs on the selection path are always disabled. The default implementation of this method (in NavTab) returns true.


navBar

public final NavBar navBar()
Returns the navigation bar that contains this tab.

Throws:
NullPointerException - if the navbar has not been set
See Also:
setNavBar(NavBar)

setNavBar

public final NavTab setNavBar(NavBar navBar)
Sets the navigation bar that contains this tab. Called once only, during construction of the navigation bar.

Returns:
this navigation tab
Throws:
IllegalStateException - if a second call to this method is detected (detection not guaranteed)
See Also:
navBar()

pageClass

public Class pageClass()
Returns the class of pages to which this tab links; or null, if there is no single class. The default implementation of this method (in NavTab) returns the page class of this tab's bookmark.


runner

public RequestCycleRunner runner(VRequestCycle cycle)
Returns a runner to handle any clicks on this tab (experimental). The default implementation of this method (in NavTab) constructs and returns a bookmark runner for this tab's bookmark.

See Also:
BookmarkRunner

shortTitle

public abstract String shortTitle(VRequestCycle cycle)
Returns a short title for this tab, suitable as the body of a link.