Class AbstractBreadcrumb

    • Field Detail

      • title

        protected String title
      • target

        protected String target
      • tooltip

        protected String tooltip
      • displayTitle

        protected String displayTitle
      • cssClass

        protected String cssClass
      • filterTrailingBreadcrumb

        protected boolean filterTrailingBreadcrumb
    • Constructor Detail

      • AbstractBreadcrumb

        protected AbstractBreadcrumb()
      • AbstractBreadcrumb

        protected AbstractBreadcrumb​(String title,
                                     String target)
      • AbstractBreadcrumb

        protected AbstractBreadcrumb​(String title,
                                     String target,
                                     String tooltip)
    • Method Detail

      • getTarget

        public 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
      • getTooltip

        public String getTooltip()
        Description copied from interface: Breadcrumb
        Gets the breadcrumb's tooltip.
        Specified by:
        getTooltip in interface Breadcrumb
        Returns:
        the tooltip to display for the breadcrumb
      • getDisplayTitle

        public String getDisplayTitle()
        Description copied from interface: Breadcrumb
        Gets the display title of the breadcrumb for user display.
        Specified by:
        getDisplayTitle in interface Breadcrumb
        Returns:
        display title of the breadcrumb or null if not defined
      • getBreadcrumbsTrail

        public List<Breadcrumb> getBreadcrumbsTrail()
        Gets all the breadcrumbs required for displaying this breadcrumb.

        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()).

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

        protected 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, unless the current breadcrumb has no title.

      • getParent

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

        public void setCssClass​(String cssClass)
        Description copied from interface: Breadcrumb
        Override the default CSS class of the breadcrumb
        Specified by:
        setCssClass in interface Breadcrumb
        Parameters:
        cssClass - the default string to write in the class attribute
      • getCssClass

        public String getCssClass()
        Description copied from interface: Breadcrumb
        CSS class to apply to the breadcrumb
        Specified by:
        getCssClass in interface Breadcrumb
        Returns:
        a String or null
      • setFilterTrailingBreadcrumb

        public void setFilterTrailingBreadcrumb​(boolean filterTrailingBreadcrumb)
        Description copied from interface: Breadcrumb
        Override the breadcrumb's default value for whether or not the last breadcrumb in the trail should be filtered out.
        Specified by:
        setFilterTrailingBreadcrumb in interface Breadcrumb
        Parameters:
        filterTrailingBreadcrumb - true if the last breadcrumb in the trail should be filtered out.
      • filterTrailingBreadcrumb

        public boolean filterTrailingBreadcrumb()
        Description copied from interface: Breadcrumb
        Whether or not the last breadcrumb in the breadcrumbs trail should be filtered out. For example, we don't want to duplicate the page title in the breadcrumbs trail when it's already displayed on the page.
        Specified by:
        filterTrailingBreadcrumb in interface Breadcrumb