Search in sources :

Example 6 with IBreadcrumbHandler

use of org.alfresco.web.ui.common.component.IBreadcrumbHandler in project acs-community-packaging by Alfresco.

the class BreadcrumbRenderer method encodeBegin.

/**
 * @see javax.faces.render.Renderer#encodeBegin(javax.faces.context.FacesContext, javax.faces.component.UIComponent)
 */
public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
    // always check for this flag - as per the spec
    if (component.isRendered() == true) {
        Writer out = context.getResponseWriter();
        UIBreadcrumb breadcrumb = (UIBreadcrumb) component;
        // get the List of IBreadcrumbHandler elements from the component
        List<IBreadcrumbHandler> elements = (List) breadcrumb.getValue();
        boolean first = true;
        for (int index = 0; index < elements.size(); index++) {
            IBreadcrumbHandler element = elements.get(index);
            // handle not optionally hiding the root part
            if (index != 0 || breadcrumb.getShowRoot() == true) {
                out.write(renderBreadcrumb(context, breadcrumb, element.toString(), index, first));
                first = false;
            }
        }
    }
}
Also used : IBreadcrumbHandler(org.alfresco.web.ui.common.component.IBreadcrumbHandler) List(java.util.List) UIBreadcrumb(org.alfresco.web.ui.common.component.UIBreadcrumb) Writer(java.io.Writer)

Aggregations

IBreadcrumbHandler (org.alfresco.web.ui.common.component.IBreadcrumbHandler)6 NodeRef (org.alfresco.service.cmr.repository.NodeRef)4 FacesContext (javax.faces.context.FacesContext)3 Node (org.alfresco.web.bean.repository.Node)3 ArrayList (java.util.ArrayList)2 List (java.util.List)2 ChildAssociationRef (org.alfresco.service.cmr.repository.ChildAssociationRef)2 CategoryBreadcrumbHandler (org.alfresco.web.bean.categories.CategoriesDialog.CategoryBreadcrumbHandler)2 UIBreadcrumb (org.alfresco.web.ui.common.component.UIBreadcrumb)2 IRepoBreadcrumbHandler (org.alfresco.web.ui.repo.component.IRepoBreadcrumbHandler)2 Serializable (java.io.Serializable)1 Writer (java.io.Writer)1 Collection (java.util.Collection)1 HashMap (java.util.HashMap)1 RetryingTransactionHelper (org.alfresco.repo.transaction.RetryingTransactionHelper)1 RetryingTransactionCallback (org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback)1 QName (org.alfresco.service.namespace.QName)1 MapNode (org.alfresco.web.bean.repository.MapNode)1 UIModeList (org.alfresco.web.ui.common.component.UIModeList)1