code: public void setFilter(TreeModelFilter filter)
      {
          this.filter = filter;
          if (this.filter == null)
          {
              this.filter = TreeModelFilters.acceptingAll();
          }
          if (root != null)
          {
              root.notifyFilterChanged();
          }
          fireTreeStructureChanged(this, new TreeNode[] { root }, null, null);
      }
docs: Set the {@link TreeModelFilter} for this model. If the given
  filter is <code>null</code>, then all nodes of the delegate
  model will be shown.
  
  @param filter The filter to use