com.atlassian.confluence.util.breadcrumbs
Class AbstractBreadcrumb

java.lang.Object
  extended by com.atlassian.confluence.util.breadcrumbs.AbstractBreadcrumb
All Implemented Interfaces:
Breadcrumb
Direct Known Subclasses:
AbstractActionBreadcrumb, AbstractSpaceBreadcrumb, AdminBreadcrumb, AttachmentBreadcrumb, BlogPostBreadcrumb, BrowseSpaceBreadcrumb, DashboardBreadcrumb, ListPageTemplatesBreadcrumb, LongRunningTaskBreadcrumb, PageBreadcrumb, PeopleBreadcrumb, SimpleBreadcrumb, UserBreadcrumb, ViewBlogPostsByDateBreadcrumb

public abstract class AbstractBreadcrumb
extends java.lang.Object
implements Breadcrumb


Field Summary
protected  java.lang.String target
           
protected  java.lang.String title
           
 
Constructor Summary
protected AbstractBreadcrumb()
           
protected AbstractBreadcrumb(java.lang.String title, java.lang.String target)
           
 
Method Summary
 java.util.List<Breadcrumb> getBreadcrumbsTrail()
          Gets all the breadcrumbs required for displaying this breadcrumb.
protected  java.util.List<Breadcrumb> getMyCrumbs()
          Returns a list of breadcrumbs for the current breadcrumb.
protected abstract  Breadcrumb getParent()
          Gets the parent breadcrumb.
 java.lang.String getTarget()
          Gets the relative url for the target which a breadcrumb points to.
 java.lang.String getTitle()
          Gets the title of the breadcrumb for user display.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

title

protected java.lang.String title

target

protected java.lang.String target
Constructor Detail

AbstractBreadcrumb

protected AbstractBreadcrumb()

AbstractBreadcrumb

protected AbstractBreadcrumb(java.lang.String title,
                             java.lang.String target)
Method Detail

getTarget

public java.lang.String getTarget()
Description copied from interface: Breadcrumb
Gets the relative url for the target which a breadcrumb points to.

Specified by:
getTarget in interface Breadcrumb
Returns:
the relative url for the breadcrumb, or null if the breadcrumb has no link

getTitle

public java.lang.String getTitle()
Description copied from interface: Breadcrumb
Gets the title of the breadcrumb for user display. The title may be displayable text or an i18n key.

Specified by:
getTitle in interface Breadcrumb
Returns:
the display title of the breadcrumb

getBreadcrumbsTrail

public java.util.List<Breadcrumb> getBreadcrumbsTrail()
Gets all the breadcrumbs required for displaying this breadcrumb. By using recursion, we retrieve all the parent breadcrumbs and add the crumbs from itself as we go along (by calling {@link #getMyCrumbs()).

Specified by:
getBreadcrumbsTrail in interface Breadcrumb
Returns:
a List of breadcrumbs for display

getMyCrumbs

protected java.util.List<Breadcrumb> getMyCrumbs()
Returns a list of breadcrumbs for the current breadcrumb. For example, the BlogPostBreadcrumb overrides this method and returns 4 crumbs altogether to represent itself: 2007 > 11 > 28 > BlogTitle. By default my crumbs will be a list with size 1, containing itself.


getParent

protected abstract Breadcrumb getParent()
Gets the parent breadcrumb. By default the dashboard breadcrumb is returned.

Returns:
the parent breadcrumb.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2003-2010 Atlassian. All Rights Reserved.