code: public void cropTo(int fromItem, int toItem) {
          fromItem = Math.max(fromItem, 0);
          toItem = Math.min(toItem, cells.size());
          cells.forget(0, fromItem);
          cells.forget(toItem, cells.size());
      }
docs: Updates the list of cells to display
  
  @param fromItem the index of the first item to display
  @param toItem the index of the last item to display