code: private Component prepareFolderFacets(CmsSolrResultList solrResultList, CmsSearchResultWrapper resultWrapper) {
  
          FacetField folderFacets = solrResultList.getFacetField(CmsListManager.FIELD_PARENT_FOLDERS);
          I_CmsSearchControllerFacetField facetController = resultWrapper.getController().getFieldFacets().getFieldFacetController().get(
              CmsListManager.FIELD_PARENT_FOLDERS);
          if ((folderFacets != null) && (folderFacets.getValueCount() > 0)) {
              VerticalLayout folderLayout = new VerticalLayout();
              for (final Count value : filterFolderFacets(folderFacets.getValues())) {
                  Button folder = new Button(getFolderLabel(value.getName()) + " (" + value.getCount() + ")");
                  folder.addStyleName(ValoTheme.BUTTON_TINY);
                  folder.addStyleName(ValoTheme.BUTTON_BORDERLESS);
                  Boolean selected = facetController.getState().getIsChecked().get(value.getName());
                  if ((selected != null) && selected.booleanValue()) {
                      folder.addStyleName(SELECTED_STYLE);
                  }
                  folder.addClickListener(new ClickListener() {
  
                      private static final long serialVersionUID = 1L;
  
                      public void buttonClick(ClickEvent event) {
  
                          if (isSelected(event.getComponent())) {
                              resetFacetsAndSearch();
                          } else {
                              selectFieldFacet(CmsListManager.FIELD_PARENT_FOLDERS, value.getName());
                          }
                      }
                  });
                  folderLayout.addComponent(folder);
              }
              Panel folderPanel = new Panel(CmsVaadinUtils.getMessageText(Messages.GUI_LISTMANAGER_FACET_FOLDERS_0));
              folderPanel.setContent(folderLayout);
              return folderPanel;
          } else {
              return null;
          }
      }
docs: Prepares the folder facets for the given search result.<p>
  
  @param solrResultList the search result list
  @param resultWrapper the result wrapper
  
  @return the folder facets component