code: void filterTree(String filter) {
  
          HierarchicalContainer container = (HierarchicalContainer)m_tree.getContainerDataSource();
          container.removeAllContainerFilters();
          if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(filter)) {
              final String lowerCaseFilter = filter.toLowerCase();
              container.addContainerFilter(new Filter() {
  
                  private static final long serialVersionUID = 1L;
  
                  public boolean appliesToProperty(Object propertyId) {
  
                      return true;
                  }
  
                  public boolean passesFilter(Object itemId, Item item) throws UnsupportedOperationException {
  
                      CmsCategory cat = (CmsCategory)itemId;
  
                      return cat.getPath().toLowerCase().contains(lowerCaseFilter)
                          || ((cat.getTitle() != null) && cat.getTitle().toLowerCase().contains(lowerCaseFilter));
                  }
              });
          }
      }
docs: Adds a filter to the category tree container.<p>
  
  @param filter the filter to add