wicket.extensions.breadcrumb
Class BreadCrumbBar

java.lang.Object
  extended bywicket.Component
      extended bywicket.MarkupContainer
          extended bywicket.markup.html.WebMarkupContainer
              extended bywicket.markup.html.WebMarkupContainerWithAssociatedMarkup
                  extended bywicket.markup.html.panel.Panel
                      extended bywicket.extensions.breadcrumb.BreadCrumbBar
All Implemented Interfaces:
IBreadCrumbModel, java.io.Serializable

public class BreadCrumbBar
extends wicket.markup.html.panel.Panel
implements IBreadCrumbModel

A component that renders bread crumbs. By default, it renders a horizontal list from left to right (oldest left) with bread crumb links and a ' / ' as a seperator, e.g.

 first / second / third
 
This component also functions as a implementation of bread crumb model. This component holds the state as well as doing the rendering. Override and provide your own markup file if you want to work with other elements, e.g. uls instead of spans.

Author:
Eelco Hillenius
See Also:
Serialized Form

Nested Class Summary
protected  class BreadCrumbBar.BreadCrumbsListView
          List view for rendering the bread crumbs.
 
Nested classes inherited from class wicket.markup.html.WebMarkupContainerWithAssociatedMarkup
wicket.markup.html.WebMarkupContainerWithAssociatedMarkup.HeaderPartContainer
 
Nested classes inherited from class wicket.Component
wicket.Component.ComponentModelChange, wicket.Component.EnabledChange, wicket.Component.IVisitor, wicket.Component.VisibilityChange
 
Field Summary
 
Fields inherited from class wicket.Component
ENABLE, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED6, FLAG_RESERVED7, FLAG_RESERVED8, PATH_SEPARATOR, RENDER
 
Constructor Summary
BreadCrumbBar(java.lang.String id)
          Construct.
BreadCrumbBar(java.lang.String id, boolean addDefaultCssStyle)
          Deprecated. As of 1.2.1 calling this method with addDefaultCssStyle == true doesn't add any style anymore. Use your own markup file or css header contribution if you want a different style/ look. The default implementation doesn't use unnumbered lists anymore because of the issues described here This method will be removed in 2.0
 
Method Summary
protected  void activate(IBreadCrumbParticipant breadCrumbParticipant)
          Activates the bread crumb participant.
 void addDefaultCssStyle()
          Deprecated. As of 1.2.1 calling this method is a no-op. Use your own markup file or css header contribution if you want a different style/ look. The default implementation doesn't use unnumbered lists anymore because of the issues described here This method will be removed in 2.0
 void addListener(IBreadCrumbModelListener listener)
          Adds a bread crumb model listener.
 java.util.List allBreadCrumbParticipants()
          Lists the bread crumb participants in this model.
 IBreadCrumbParticipant getActive()
          Gets the currently active participant, if any.
protected  boolean getEnableLinkToCurrent()
          Gets whether the current bread crumb should be displayed as a link (e.g.
protected  wicket.Component newBreadCrumbComponent(java.lang.String id, int index, int total, IBreadCrumbParticipant breadCrumbParticipant)
          Creates a new bread crumb component.
 void removeListener(IBreadCrumbModelListener listener)
          Removes a bread crumb model listener.
 void setActive(IBreadCrumbParticipant breadCrumbParticipant)
          Sets the bread crumb as the active one.
 
Methods inherited from class wicket.markup.html.panel.Panel
onComponentTag, onComponentTagBody, renderHead
 
Methods inherited from class wicket.markup.html.WebMarkupContainerWithAssociatedMarkup
newHeaderPartContainer, renderHeadFromAssociatedMarkupFile
 
Methods inherited from class wicket.markup.html.WebMarkupContainer
getMarkupType, getWebPage
 
Methods inherited from class wicket.MarkupContainer
add, autoAdd, contains, findMarkupStream, get, getAssociatedMarkupStream, getMarkupStream, internalAdd, internalAttach, internalDetach, isTransparentResolver, iterator, iterator, newMarkupResourceStream, onRender, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderComponentTagBody, replace, setMarkupStream, setModel, size, toString, toString, visitChildren, visitChildren
 
Methods inherited from class wicket.Component
add, addStateChange, checkComponentTag, checkComponentTagAttribute, continueToOriginalDestination, debug, detachBehaviors, detachModel, detachModels, error, exceptionMessage, fatal, findPage, findParent, findParentWithAssociatedMarkup, getApplication, getApplicationPages, getApplicationSettings, getBehaviors, getBehaviors, getClassRelativePath, getConverter, getEscapeModelStrings, getFeedbackMessage, getFlag, getFlag, getId, getLocale, getLocalizer, getMarkupAttributes, getMarkupId, getMetaData, getModel, getModelComparator, getModelObject, getModelObjectAsString, getOutputMarkupId, getPage, getPageFactory, getPageRelativePath, getParent, getPath, getRenderBodyOnly, getRequest, getRequestCycle, getResponse, getSession, getSizeInBytes, getString, getString, getString, getStyle, getVariation, hasErrorMessage, hasFeedbackMessage, info, initModel, internalOnAttach, internalOnDetach, internalOnModelChanged, isActionAuthorized, isAncestorOf, isBehaviorAccepted, isEnableAllowed, isEnabled, isHeadRendered, isIgnoreAttributeModifier, isRenderAllowed, isVersioned, isVisible, isVisibleInHierarchy, modelChanged, modelChanging, newPage, newPage, onAfterRender, onAttach, onBeforeRender, onBeginRequest, onDetach, onEndRequest, onModelChanged, onModelChanging, onRender, redirectToInterceptPage, remove, render, render, renderComponent, renderComponent, renderComponentTag, rendered, renderedBehaviors, replaceComponentTagBody, replaceWith, resetHeadRendered, sameRootModel, sameRootModel, setAuto, setEnabled, setEscapeModelStrings, setFlag, setFlag, setIgnoreAttributeModifier, setMetaData, setModelObject, setOutputMarkupId, setRedirect, setRenderBodyOnly, setResponsePage, setResponsePage, setResponsePage, setVersioned, setVisible, urlFor, urlFor, urlFor, urlFor, urlFor, visitParents, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BreadCrumbBar

public BreadCrumbBar(java.lang.String id)
Construct. Adds the default style.

Parameters:
id - Component id

BreadCrumbBar

public BreadCrumbBar(java.lang.String id,
                     boolean addDefaultCssStyle)
Deprecated. As of 1.2.1 calling this method with addDefaultCssStyle == true doesn't add any style anymore. Use your own markup file or css header contribution if you want a different style/ look. The default implementation doesn't use unnumbered lists anymore because of the issues described here This method will be removed in 2.0

Construct.

Parameters:
id - Component id
addDefaultCssStyle - Whether the default style should be added *
Method Detail

addDefaultCssStyle

public final void addDefaultCssStyle()
Deprecated. As of 1.2.1 calling this method is a no-op. Use your own markup file or css header contribution if you want a different style/ look. The default implementation doesn't use unnumbered lists anymore because of the issues described here This method will be removed in 2.0

Will let the bread crumb bar contribute a CSS include to the page's header. It will add BreadCrumbBar.css from this package. This method is typically called by the class that creates the bread crumb bar.


addListener

public final void addListener(IBreadCrumbModelListener listener)
Description copied from interface: IBreadCrumbModel
Adds a bread crumb model listener.

Specified by:
addListener in interface IBreadCrumbModel
Parameters:
listener - The listener to add
See Also:
IBreadCrumbModel.addListener(wicket.extensions.breadcrumb.IBreadCrumbModelListener)

allBreadCrumbParticipants

public final java.util.List allBreadCrumbParticipants()
Description copied from interface: IBreadCrumbModel
Lists the bread crumb participants in this model.

Specified by:
allBreadCrumbParticipants in interface IBreadCrumbModel
Returns:
The bread crumbs particpants, as list with bread crumb participants.
See Also:
IBreadCrumbModel.allBreadCrumbParticipants()

getActive

public IBreadCrumbParticipant getActive()
Description copied from interface: IBreadCrumbModel
Gets the currently active participant, if any.

Specified by:
getActive in interface IBreadCrumbModel
Returns:
The currently active participant, may be null
See Also:
IBreadCrumbModel.getActive()

removeListener

public final void removeListener(IBreadCrumbModelListener listener)
Description copied from interface: IBreadCrumbModel
Removes a bread crumb model listener.

Specified by:
removeListener in interface IBreadCrumbModel
Parameters:
listener - The listener to remove
See Also:
IBreadCrumbModel.removeListener(wicket.extensions.breadcrumb.IBreadCrumbModelListener)

setActive

public final void setActive(IBreadCrumbParticipant breadCrumbParticipant)
Description copied from interface: IBreadCrumbModel
Sets the bread crumb as the active one. Implementations should call bread crumb added when the bread crumb was not yet part of the model, and bread crumb removed for every crumb that was removed as the result of this call.

Specified by:
setActive in interface IBreadCrumbModel
Parameters:
breadCrumbParticipant - The bread crump that should be set as the currently active
See Also:
IBreadCrumbModel.setActive(wicket.extensions.breadcrumb.IBreadCrumbParticipant)

activate

protected final void activate(IBreadCrumbParticipant breadCrumbParticipant)
Activates the bread crumb participant.

Parameters:
breadCrumbParticipant - The participant to activate

getEnableLinkToCurrent

protected boolean getEnableLinkToCurrent()
Gets whether the current bread crumb should be displayed as a link (e.g. for refreshing) or as a disabled link (effictively just a label). The latter is the default. Override if you want different behavior.

Returns:
Whether the current bread crumb should be displayed as a link; this method returns false

newBreadCrumbComponent

protected wicket.Component newBreadCrumbComponent(java.lang.String id,
                                                  int index,
                                                  int total,
                                                  IBreadCrumbParticipant breadCrumbParticipant)
Creates a new bread crumb component. That component will be rendered as part of the bread crumbs list (which is a <ul> <li> structure).

Parameters:
id - The component id
index - The index of the bread crumb
total - The total number of bread crumbs in the current model
breadCrumbParticipant - the bread crumb
Returns:
A new bread crumb component


Copyright © 2004-2008 Wicket developers. All Rights Reserved.