public abstract class AbstractBreadcrumb extends Object implements Breadcrumb
Modifier and Type | Field and Description |
---|---|
protected String |
cssClass |
protected String |
displayTitle |
protected boolean |
filterTrailingBreadcrumb |
protected static int |
MAX_BREADCRUMBS |
protected String |
target |
protected String |
title |
protected String |
tooltip |
Modifier | Constructor and Description |
---|---|
protected |
AbstractBreadcrumb() |
protected |
AbstractBreadcrumb(String title,
String target) |
protected |
AbstractBreadcrumb(String title,
String target,
String tooltip) |
Modifier and Type | Method and Description |
---|---|
boolean |
filterTrailingBreadcrumb()
Whether or not the last breadcrumb in the breadcrumbs trail should be filtered out.
|
List<Breadcrumb> |
getBreadcrumbsTrail()
Gets all the breadcrumbs required for displaying this breadcrumb.
|
String |
getCssClass()
CSS class to apply to the breadcrumb
|
String |
getDisplayTitle()
Gets the display title of the breadcrumb for user display.
|
protected List<Breadcrumb> |
getMyCrumbs()
Returns a list of breadcrumbs for the current breadcrumb.
|
protected abstract Breadcrumb |
getParent()
Gets the parent breadcrumb.
|
String |
getTarget()
Gets the relative url for the target which a breadcrumb points to.
|
String |
getTitle()
Gets the i18n key for the title of the breadcrumb.
|
String |
getTooltip()
Gets the breadcrumb's tooltip.
|
void |
setCssClass(String cssClass)
Override the default CSS class of the breadcrumb
|
void |
setFilterTrailingBreadcrumb(boolean filterTrailingBreadcrumb)
Override the breadcrumb's default value for whether or not the last breadcrumb in the trail
should be filtered out.
|
String |
toString() |
protected String title
protected String target
protected String tooltip
protected String displayTitle
protected String cssClass
protected boolean filterTrailingBreadcrumb
protected static final int MAX_BREADCRUMBS
public String getTarget()
Breadcrumb
getTarget
in interface Breadcrumb
public String getTitle()
Breadcrumb
Breadcrumb.getDisplayTitle()
for
titles that don't need to be translated.getTitle
in interface Breadcrumb
public String getTooltip()
Breadcrumb
getTooltip
in interface Breadcrumb
public String getDisplayTitle()
Breadcrumb
getDisplayTitle
in interface Breadcrumb
public List<Breadcrumb> getBreadcrumbsTrail()
By using the power of a while loop, we retrieve all the parent breadcrumbs and add
the crumbs from itself as we go along (by calling getMyCrumbs()
).
getBreadcrumbsTrail
in interface Breadcrumb
List
of breadcrumbs for displayprotected List<Breadcrumb> getMyCrumbs()
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, unless the current breadcrumb has no title.
protected abstract Breadcrumb getParent()
public void setCssClass(String cssClass)
Breadcrumb
setCssClass
in interface Breadcrumb
cssClass
- the default string to write in the class attributepublic String getCssClass()
Breadcrumb
getCssClass
in interface Breadcrumb
public void setFilterTrailingBreadcrumb(boolean filterTrailingBreadcrumb)
Breadcrumb
setFilterTrailingBreadcrumb
in interface Breadcrumb
filterTrailingBreadcrumb
- true if the last breadcrumb in the trail should be filtered out.public boolean filterTrailingBreadcrumb()
Breadcrumb
filterTrailingBreadcrumb
in interface Breadcrumb
Copyright © 2003–2020 Atlassian. All rights reserved.