com.logabit.webtools.navigation
Class Navigation

java.lang.Object
  extended by com.logabit.webtools.navigation.NavigationEntryContainer
      extended by com.logabit.webtools.navigation.Navigation

public class Navigation
extends NavigationEntryContainer

A navigation object contains all navigation entries. Furthermore it holds the state of the currently activated navigation entry and is able to prepare and return additional information like the current bread crumb for example.

Author:
Stephan Niedermeier, http://www.logabit.com

Constructor Summary
Navigation()
           
 
Method Summary
 NavigationEntry createChild(java.lang.String id, java.lang.String uri, java.lang.String label, java.lang.String hint, boolean isDefault, boolean isHidden, boolean isClickable)
          A factory method which creates a new navigation entry already containing the current navigation object.
 boolean entryExists(java.lang.String id)
           
 java.util.Map<java.lang.String,NavigationEntry> getAllEntries()
          Returns a map that contains all entries of the navigation.
 java.util.List<NavigationEntry> getBreadCrumb()
          Prepares the bread crumb based on the currently activated entry id.
 java.lang.String getCurrentEntryId()
           
 Navigation getNavigation()
          Return the navigation, this container belongs to.
 NavigationEntry getParent()
          Returns the parent entry of this entry or null if this entry is a first level entry.
 void setCurrentEntryId(java.lang.String currentEntryId)
           
 
Methods inherited from class com.logabit.webtools.navigation.NavigationEntryContainer
addChild, getChildren, getNumberOfChildren, hasChildren
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Navigation

public Navigation()
Method Detail

setCurrentEntryId

public void setCurrentEntryId(java.lang.String currentEntryId)

getCurrentEntryId

public java.lang.String getCurrentEntryId()

getBreadCrumb

public java.util.List<NavigationEntry> getBreadCrumb()
Prepares the bread crumb based on the currently activated entry id.

Returns:
The prepared breadcrump.

getAllEntries

public java.util.Map<java.lang.String,NavigationEntry> getAllEntries()
Returns a map that contains all entries of the navigation. The key of the map is the id of the entry. This can be used for example to easily access a navigation entry by its id within a template and without recursive search.

Returns:

getNavigation

public Navigation getNavigation()
Description copied from class: NavigationEntryContainer
Return the navigation, this container belongs to.

Specified by:
getNavigation in class NavigationEntryContainer
Returns:

createChild

public NavigationEntry createChild(java.lang.String id,
                                   java.lang.String uri,
                                   java.lang.String label,
                                   java.lang.String hint,
                                   boolean isDefault,
                                   boolean isHidden,
                                   boolean isClickable)
Description copied from class: NavigationEntryContainer
A factory method which creates a new navigation entry already containing the current navigation object.

Specified by:
createChild in class NavigationEntryContainer
Parameters:
id - - The id of the entry to create.
Returns:

getParent

public NavigationEntry getParent()
Description copied from class: NavigationEntryContainer
Returns the parent entry of this entry or null if this entry is a first level entry.

Specified by:
getParent in class NavigationEntryContainer
Returns:

entryExists

public boolean entryExists(java.lang.String id)


Copyright © 2007. All Rights Reserved.