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;
}
}
}
}
Aggregations